diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.java | 73 |
1 files changed, 40 insertions, 33 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.java index e73fc6b1..e809ed72 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.java @@ -14,39 +14,46 @@ import net.minecraft.util.EnumChatFormatting; public class PackDevCommand extends ClientCommandBase { - public PackDevCommand() { - super("neupackdev"); - } + public PackDevCommand() { + super("neupackdev"); + } - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (args.length == 1 && args[0].equalsIgnoreCase("getnpc")) { - double distSq = 25; - EntityPlayer closestNPC = null; - EntityPlayerSP p = Minecraft.getMinecraft().thePlayer; - for (EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) { - if (player instanceof AbstractClientPlayer && p != player && player.getUniqueID().version() != 4) { - double dSq = player.getDistanceSq(p.posX, p.posY, p.posZ); - if (dSq < distSq) { - distSq = dSq; - closestNPC = player; - } - } - } + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length == 1 && args[0].equalsIgnoreCase("getnpc")) { + double distSq = 25; + EntityPlayer closestNPC = null; + EntityPlayerSP p = Minecraft.getMinecraft().thePlayer; + for (EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) { + if (player instanceof AbstractClientPlayer && p != player && player.getUniqueID().version() != 4) { + double dSq = player.getDistanceSq(p.posX, p.posY, p.posZ); + if (dSq < distSq) { + distSq = dSq; + closestNPC = player; + } + } + } - if (closestNPC == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "No NPCs found within 5 blocks :(")); - } else { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Copied entity texture id to clipboard")); - MiscUtils.copyToClipboard(((AbstractClientPlayer) closestNPC).getLocationSkin().getResourcePath().replace("skins/", "")); - } - return; - } - NotEnoughUpdates.INSTANCE.packDevEnabled = !NotEnoughUpdates.INSTANCE.packDevEnabled; - if (NotEnoughUpdates.INSTANCE.packDevEnabled) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Enabled pack developer mode.")); - } else { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Disabled pack developer mode.")); - } - } + if (closestNPC == null) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.RED + "No NPCs found within 5 blocks :(")); + } else { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.GREEN + "Copied entity texture id to clipboard")); + MiscUtils.copyToClipboard(((AbstractClientPlayer) closestNPC) + .getLocationSkin() + .getResourcePath() + .replace("skins/", "")); + } + return; + } + NotEnoughUpdates.INSTANCE.packDevEnabled = !NotEnoughUpdates.INSTANCE.packDevEnabled; + if (NotEnoughUpdates.INSTANCE.packDevEnabled) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.GREEN + "Enabled pack developer mode.")); + } else { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + EnumChatFormatting.RED + "Disabled pack developer mode.")); + } + } } |
