Java Code Examples for com.captainbern.minecraft.reflection.MinecraftReflection#isUsingNetty()
The following examples show how to use
com.captainbern.minecraft.reflection.MinecraftReflection#isUsingNetty() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InfoCommand.java From HoloAPI with GNU General Public License v3.0 | 6 votes |
@Command( command = "info", description = "View information on active holograms", permission = "holoapi.holo.info" ) public boolean command(CommandEvent event) { if (HoloAPI.getManager().getAllComplexHolograms().isEmpty()) { event.respond(Lang.NO_ACTIVE_HOLOGRAMS.getValue()); return true; } event.respond(Lang.ACTIVE_DISPLAYS.getValue()); info(event.sender(), HoloAPI.getManager().getAllComplexHolograms().keySet()); if (MinecraftReflection.isUsingNetty() && event.sender() instanceof Player) { event.respond(Lang.TIP_HOVER_PREVIEW.getValue()); } return true; }
Example 2
Source File: TagFormatter.java From HoloAPI with GNU General Public License v3.0 | 5 votes |
public String formatForOldClient(String content) { int limit = 64; if (content.length() > limit && !MinecraftReflection.isUsingNetty()) { // 1.6.x client crashes if a name tag is longer than 64 characters // Unfortunate, but it must be accounted for content = content.substring(limit / 4, limit - (limit / 4)); } return content; }
Example 3
Source File: NearbyCommand.java From HoloAPI with GNU General Public License v3.0 | 5 votes |
@Command( command = "nearby <radius>", description = "View information on all nearby holograms within the specified radius", permission = "holoapi.holo.nearby" ) public boolean command(CommandEvent<Player> event) { int radius; try { radius = GeneralUtil.toInteger(event.variable("radius")); } catch (NumberFormatException e) { event.respond(Lang.INT_ONLY.getValue("string", event.variable("radius"))); return true; } ArrayList<Hologram> nearby = new ArrayList<Hologram>(); for (Hologram hologram : HoloAPI.getManager().getAllComplexHolograms().keySet()) { if (GeometryUtil.getNearbyEntities(hologram.getDefaultLocation(), radius).contains(event.sender())) { nearby.add(hologram); } } if (nearby.isEmpty()) { event.respond(Lang.NO_NEARBY_HOLOGRAMS.getValue("radius", radius)); return true; } event.respond(Lang.HOLOGRAM_NEARBY.getValue("radius", radius)); InfoCommand.info(event.sender(), nearby); if (MinecraftReflection.isUsingNetty()) { event.respond(Lang.TIP_HOVER_PREVIEW.getValue()); } return true; }
Example 4
Source File: HelpCommand.java From HoloAPI with GNU General Public License v3.0 | 5 votes |
@Command( command = "help", description = "Retrieve help for all HoloAPI commands" ) public boolean help(CommandEvent event) { HoloAPI.getCommandManager().getHelpService().sendPage(event.sender(), 1); if (MinecraftReflection.isUsingNetty() && event.sender() instanceof Player) { event.respond(Lang.TIP_HOVER_COMMANDS.getValue()); } return true; }
Example 5
Source File: HelpCommand.java From HoloAPI with GNU General Public License v3.0 | 5 votes |
@Command( command = "help <index>", description = "Retrieve a certain help page of all HoloAPI commands" ) public boolean helpPage(CommandEvent event) { try { HoloAPI.getCommandManager().getHelpService().sendPage(event.sender(), GeneralUtil.toInteger(event.variable("index"))); if (MinecraftReflection.isUsingNetty() && event.sender() instanceof Player) { event.respond(Lang.TIP_HOVER_COMMANDS.getValue()); } } catch (NumberFormatException e) { event.respond(Lang.HELP_INDEX_TOO_BIG.getValue("index", event.variable("index"))); } return true; }