Pangamma

FarPlacer source code

Jul 15th, 2017
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 17.44 KB | None | 0 0
  1. package com.lumengaming.farplacer;
  2.  
  3. import java.util.HashSet;
  4. import java.util.List;
  5. import java.util.UUID;
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.GameMode;
  8. import org.bukkit.Material;
  9. import org.bukkit.block.*;
  10. import org.bukkit.command.Command;
  11. import org.bukkit.command.CommandExecutor;
  12. import org.bukkit.command.CommandSender;
  13. import org.bukkit.entity.Player;
  14. import org.bukkit.event.Event;
  15. import org.bukkit.event.EventHandler;
  16. import org.bukkit.event.HandlerList;
  17. import org.bukkit.event.Listener;
  18. import org.bukkit.event.block.Action;
  19. import org.bukkit.event.block.BlockBreakEvent;
  20. import org.bukkit.event.block.BlockPlaceEvent;
  21. import org.bukkit.event.inventory.InventoryOpenEvent;
  22. import org.bukkit.event.player.PlayerCommandPreprocessEvent;
  23. import org.bukkit.event.player.PlayerInteractEvent;
  24. import org.bukkit.inventory.Inventory;
  25. import org.bukkit.inventory.InventoryHolder;
  26. import org.bukkit.inventory.ItemStack;
  27. import org.bukkit.material.*;
  28. import org.bukkit.plugin.java.JavaPlugin;
  29.  
  30. /**
  31.  *
  32.  * @author prota
  33.  */
  34. public class Main extends JavaPlugin implements Listener, CommandExecutor {
  35.  
  36.     private HashSet<UUID> farplacers = new HashSet<>();
  37.  
  38.     @Override
  39.     public void onEnable() {
  40.         this.getServer().getPluginManager().registerEvents(this, this);
  41.         getCommand("farplace").setExecutor(this);
  42.     }
  43.  
  44.     @Override
  45.     public void onDisable() {
  46.         HandlerList.unregisterAll((JavaPlugin) this);
  47.         this.farplacers.clear();
  48.         Bukkit.getScheduler().cancelTasks(this);
  49.     }
  50.  
  51.     @Override
  52.     public boolean onCommand(CommandSender cs, Command cmnd, String string, String[] args) {
  53.         return doCommand(cs, args);
  54.     }
  55.  
  56.     @EventHandler
  57.     public void onFarpon(PlayerCommandPreprocessEvent e) {
  58.         if (e.getMessage().equalsIgnoreCase("/farpon")) {
  59.             doCommand(e.getPlayer(), new String[]{"on"});
  60.             e.setCancelled(true);
  61.         } else if (e.getMessage().equalsIgnoreCase("/farpoff")) {
  62.             doCommand(e.getPlayer(), new String[]{"off"});
  63.             e.setCancelled(true);
  64.         }
  65.     }
  66.  
  67.     private boolean doCommand(CommandSender cs, String[] args) {
  68.         if (args.length == 1) {
  69.             if (cs instanceof Player) {
  70.                 if (cs.hasPermission("farplacer.use") || cs.isOp()) {
  71.                     if (args[0].equalsIgnoreCase("on")) {
  72.                         this.farplacers.add(((Player) cs).getUniqueId());
  73.                         cs.sendMessage("§aFarplacing is now enabled. §7For some reason, interact events in air are only fired if you are holding an item.");
  74.                     } else if (args[0].equalsIgnoreCase("off")) {
  75.                         this.farplacers.remove(((Player) cs).getUniqueId());
  76.                         cs.sendMessage("§aFarplacing is now disabled.");
  77.                     } else {
  78.                         cs.sendMessage("§c/farp on/off");
  79.                     }
  80.                 } else {
  81.                     cs.sendMessage("§cOh no! D: You lack the 'farplacer.use' permission node. You can't use this command.");
  82.                 }
  83.             } else {
  84.                 cs.sendMessage("§cYou have to be a player.");
  85.             }
  86.         } else {
  87.             cs.sendMessage("§c/farp on/off");
  88.         }
  89.         return true;
  90.     }
  91.  
  92.     @EventHandler(ignoreCancelled = false)
  93.     public void onFarPlace(PlayerInteractEvent e) {
  94.         Player p = e.getPlayer();
  95.         if (!this.isFarPlacer(p.getUniqueId())) {
  96.             return;
  97.         }
  98.         HashSet<Material> dummySet = null;
  99.         if (e.getAction() == Action.RIGHT_CLICK_AIR) {
  100.             //<editor-fold defaultstate="collapsed" desc="place block">
  101.             List lastBlocks = null;
  102.             try {
  103.                 lastBlocks = p.getLastTwoTargetBlocks(dummySet, 100);
  104.             } catch (IllegalStateException ex) {
  105.                 lastBlocks = null;
  106.             }
  107.             if ((lastBlocks == null) || (lastBlocks.size() < 2) || (((Block) lastBlocks.get(1)).getType() == Material.AIR)) {
  108.                 p.sendMessage("§ctarget is out of range.");
  109.                 return; // no block found.
  110.             }
  111.             ItemStack item = p.getItemInHand();
  112.             Block block = (Block) lastBlocks.get(0);
  113.             Block against = (Block) lastBlocks.get(1);
  114.             BlockState blockState = block.getState();
  115.             PlayerInteractEvent evt = new PlayerInteractEvent(p, Action.RIGHT_CLICK_BLOCK, item, against, against.getFace(block));
  116.             Bukkit.getServer().getPluginManager().callEvent(evt);
  117.             if (!evt.isCancelled()) {
  118.                 //place block.
  119.                 //if interact(block, player)....
  120.                 boolean interacted = false;
  121.                 if (!p.isSneaking()) {
  122.                     interacted = Interact(p, against);
  123.                 }
  124.                 if (!interacted) {
  125.                     block.setTypeIdAndData(item.getTypeId(), (byte) item.getDurability(), true);
  126.                     BlockPlaceEvent event = new BlockPlaceEvent(block, blockState, against, p.getItemInHand(), p, true);
  127.                     Bukkit.getServer().getPluginManager().callEvent(event);
  128.                     if (event.isCancelled()) {
  129.                         blockState.update(true);
  130.                         return;
  131.                     }
  132.                 }
  133.             }
  134.             //</editor-fold>
  135.         } else if (e.getAction() == Action.LEFT_CLICK_AIR) {
  136.             //<editor-fold defaultstate="collapsed" desc="remove block">
  137.             List lastBlocks = null;
  138.             try {
  139.                 lastBlocks = p.getLastTwoTargetBlocks(dummySet, 80);
  140.             } catch (IllegalStateException ex) {
  141.                 lastBlocks = null;
  142.             }
  143.             if ((lastBlocks == null) || (lastBlocks.size() < 2) || (((Block) lastBlocks.get(1)).getType() == Material.AIR)) {
  144.                 p.sendMessage("§ctarget is out of range.");
  145.                 return; // no block found.
  146.             }
  147.             Block block = (Block) lastBlocks.get(1);
  148.             if (block != null) {
  149.                 PlayerInteractEvent evt = new PlayerInteractEvent(p, Action.LEFT_CLICK_BLOCK, p.getItemInHand(), block, BlockFace.SELF);
  150.                 Bukkit.getServer().getPluginManager().callEvent(evt);
  151.                 if (!evt.isCancelled()) {
  152.                     BlockBreakEvent event = new BlockBreakEvent(block, p);
  153.                     Bukkit.getServer().getPluginManager().callEvent(event);
  154.                     if (!event.isCancelled()) {
  155.                         if (p.getGameMode() == GameMode.CREATIVE){
  156.                             block.setType(Material.AIR);
  157.                         }else{
  158.                             block.breakNaturally();
  159.                         }
  160.                     }
  161.                 }
  162.             }
  163.             //</editor-fold>
  164.         }
  165.     }
  166.  
  167. //<editor-fold defaultstate="collapsed" desc="Interact?">
  168.     /**
  169.      * Check if the material is a block and is interactive
  170.      *
  171.      * @param p
  172.      * @param b
  173.      * @return True if this material is a block and it was interacted with.
  174.      *
  175.      */
  176.     public boolean Interact(Player p, Block b) {
  177.         if (b == null) {
  178.             return false;
  179.         }
  180.         Material m = b.getType();
  181.         Inventory inv;
  182.  
  183.         switch (m) {
  184.             case LEVER:
  185.                 Lever lever = (Lever) b.getState();
  186.                 lever.setPowered(lever.isPowered());
  187.                 return true;
  188.             //case REDSTONE_ORE:
  189.             case WOOD_BUTTON:
  190.             case STONE_BUTTON:
  191.                 Button stoneButton = (Button) b.getState();
  192.                 stoneButton.setPowered(true);
  193.                 return true;
  194.             case FENCE_GATE:
  195.             case SPRUCE_FENCE_GATE:
  196.             case BIRCH_FENCE_GATE:
  197.             case JUNGLE_FENCE_GATE:
  198.             case DARK_OAK_FENCE_GATE:
  199.             case ACACIA_FENCE_GATE:
  200.             case TRAP_DOOR:
  201.             case WOOD_DOOR:
  202.             case WOODEN_DOOR:
  203.             case SPRUCE_DOOR:
  204.             case BIRCH_DOOR:
  205.             case JUNGLE_DOOR:
  206.             case ACACIA_DOOR:
  207.             case DARK_OAK_DOOR:
  208.                 if (b.getState() instanceof Openable){
  209.                     Openable td = (Openable) b.getState();
  210.                     td.setOpen(!td.isOpen());
  211.                     return true;
  212.                 }else{
  213.                     return false;
  214.                 }
  215.             case DRAGON_EGG:
  216.                 //fuck dragon eggs.
  217.                 b.setType(Material.AIR);
  218.                 return true;
  219. //          case HOPPER:
  220. //              Hopper hopper = (Hopper) b.getState();
  221. //              inv = hopper.getInventory();
  222. //              p.openInventory(inv);
  223. //              return false;
  224. //              case CAULDRON:
  225.             case WORKBENCH:
  226.                 p.openWorkbench(b.getLocation(), false);
  227.                 return true;
  228.             case ENCHANTMENT_TABLE:
  229.                 p.openEnchanting(b.getLocation(), false);
  230.                 return true;
  231.             case ENDER_CHEST:
  232.                 inv = p.getEnderChest();
  233.                 p.openInventory(inv);
  234.                 return true;
  235.             case BEACON:
  236.             case BREWING_STAND:
  237.             case BURNING_FURNACE:
  238.             case FURNACE:
  239.             case TRAPPED_CHEST:
  240.             case DISPENSER:
  241.             case CHEST:
  242.             case WHITE_SHULKER_BOX:
  243.             case ORANGE_SHULKER_BOX:
  244.             case MAGENTA_SHULKER_BOX:
  245.             case LIGHT_BLUE_SHULKER_BOX:
  246.             case YELLOW_SHULKER_BOX:
  247.             case LIME_SHULKER_BOX:
  248.             case PINK_SHULKER_BOX:
  249.             case GRAY_SHULKER_BOX:
  250.             case SILVER_SHULKER_BOX:
  251.             case CYAN_SHULKER_BOX:
  252.             case PURPLE_SHULKER_BOX:
  253.             case BLUE_SHULKER_BOX:
  254.             case BROWN_SHULKER_BOX:
  255.             case GREEN_SHULKER_BOX:
  256.             case RED_SHULKER_BOX:
  257.             case BLACK_SHULKER_BOX:
  258.             case DROPPER:
  259.             case HOPPER:
  260.                 if (b.getState() instanceof InventoryHolder){
  261.                     InventoryHolder invHolder = (InventoryHolder) b.getState();
  262.                     inv = invHolder.getInventory();
  263.                     p.openInventory(inv);
  264.                     return true;
  265.                 }else{
  266.                     return false;
  267.                 }
  268.             case JUKEBOX:
  269.             case CAULDRON:
  270.             case COMMAND:
  271.             case DIODE:
  272.             case DIODE_BLOCK_OFF:
  273.             case DIODE_BLOCK_ON:
  274.             case REDSTONE_COMPARATOR_OFF:
  275.             case REDSTONE_COMPARATOR_ON:
  276.             case DAYLIGHT_DETECTOR:
  277.             case OBSERVER:
  278.             case COMMAND_REPEATING:
  279.             case COMMAND_CHAIN:
  280.             case STRUCTURE_VOID:
  281.             case REDSTONE_COMPARATOR:
  282.             case EXPLOSIVE_MINECART:
  283.             case HOPPER_MINECART:
  284.             case COMMAND_MINECART:
  285.             case END_CRYSTAL:
  286.             case KNOWLEDGE_BOOK:
  287.             case STORAGE_MINECART:
  288.             case POWERED_MINECART:
  289.             //<editor-fold defaultstate="collapsed" desc="No effect">
  290.             case AIR:
  291.             case STONE:
  292.             case GRASS:
  293.             case DIRT:
  294.             case COBBLESTONE:
  295.             case WOOD:
  296.             case SAPLING:
  297.             case BEDROCK:
  298.             case WATER:
  299.             case STATIONARY_WATER:
  300.             case LAVA:
  301.             case STATIONARY_LAVA:
  302.             case SAND:
  303.             case GRAVEL:
  304.             case GOLD_ORE:
  305.             case IRON_ORE:
  306.             case COAL_ORE:
  307.             case LOG:
  308.             case LEAVES:
  309.             case SPONGE:
  310.             case GLASS:
  311.             case LAPIS_ORE:
  312.             case LAPIS_BLOCK:
  313.             case SANDSTONE:
  314.             case NOTE_BLOCK:
  315.             case BED_BLOCK:
  316.             case POWERED_RAIL:
  317.             case DETECTOR_RAIL:
  318.             case PISTON_STICKY_BASE:
  319.             case WEB:
  320.             case LONG_GRASS:
  321.             case DEAD_BUSH:
  322.             case PISTON_BASE:
  323.             case PISTON_EXTENSION:
  324.             case WOOL:
  325.             case PISTON_MOVING_PIECE:
  326.             case YELLOW_FLOWER:
  327.             case RED_ROSE:
  328.             case BROWN_MUSHROOM:
  329.             case RED_MUSHROOM:
  330.             case GOLD_BLOCK:
  331.             case IRON_BLOCK:
  332.             case DOUBLE_STEP:
  333.             case STEP:
  334.             case BRICK:
  335.             case TNT:
  336.             case BOOKSHELF:
  337.             case MOSSY_COBBLESTONE:
  338.             case OBSIDIAN:
  339.             case TORCH:
  340.             case FIRE:
  341.             case MOB_SPAWNER:
  342.             case WOOD_STAIRS:
  343.             case REDSTONE_WIRE:
  344.             case DIAMOND_ORE:
  345.             case DIAMOND_BLOCK:
  346.             case CROPS:
  347.             case SOIL:
  348.             case SIGN_POST:
  349.             case LADDER:
  350.             case RAILS:
  351.             case COBBLESTONE_STAIRS:
  352.             case WALL_SIGN:
  353.             case STONE_PLATE:
  354.             case IRON_DOOR_BLOCK:
  355.             case WOOD_PLATE:
  356.             case REDSTONE_ORE:
  357.             case GLOWING_REDSTONE_ORE:
  358.             case REDSTONE_TORCH_OFF:
  359.             case REDSTONE_TORCH_ON:
  360.             case SNOW:
  361.             case ICE:
  362.             case SNOW_BLOCK:
  363.             case CACTUS:
  364.             case CLAY:
  365.             case SUGAR_CANE_BLOCK:
  366.             case FENCE:
  367.             case PUMPKIN:
  368.             case NETHERRACK:
  369.             case SOUL_SAND:
  370.             case GLOWSTONE:
  371.             case PORTAL:
  372.             case JACK_O_LANTERN:
  373.             case CAKE_BLOCK:
  374.             case STAINED_GLASS:
  375.             case MONSTER_EGGS:
  376.             case SMOOTH_BRICK:
  377.             case HUGE_MUSHROOM_1:
  378.             case HUGE_MUSHROOM_2:
  379.             case IRON_FENCE:
  380.             case THIN_GLASS:
  381.             case MELON_BLOCK:
  382.             case PUMPKIN_STEM:
  383.             case MELON_STEM:
  384.             case VINE:
  385.             case BRICK_STAIRS:
  386.             case SMOOTH_STAIRS:
  387.             case MYCEL:
  388.             case WATER_LILY:
  389.             case NETHER_BRICK:
  390.             case NETHER_FENCE:
  391.             case NETHER_BRICK_STAIRS:
  392.             case NETHER_WARTS:
  393.             case ENDER_PORTAL:
  394.             case ENDER_PORTAL_FRAME:
  395.             case ENDER_STONE:
  396.             case REDSTONE_LAMP_OFF:
  397.             case REDSTONE_LAMP_ON:
  398.             case WOOD_DOUBLE_STEP:
  399.             case WOOD_STEP:
  400.             case COCOA:
  401.             case SANDSTONE_STAIRS:
  402.             case EMERALD_ORE:
  403.             case TRIPWIRE_HOOK:
  404.             case TRIPWIRE:
  405.             case EMERALD_BLOCK:
  406.             case SPRUCE_WOOD_STAIRS:
  407.             case BIRCH_WOOD_STAIRS:
  408.             case JUNGLE_WOOD_STAIRS:
  409.             case COBBLE_WALL:
  410.             case FLOWER_POT:
  411.             case CARROT:
  412.             case POTATO:
  413.             case SKULL:
  414.             case ANVIL:
  415.             case GOLD_PLATE:
  416.             case IRON_PLATE:
  417.             case REDSTONE_BLOCK:
  418.             case QUARTZ_ORE:
  419.             case QUARTZ_BLOCK:
  420.             case QUARTZ_STAIRS:
  421.             case ACTIVATOR_RAIL:
  422.             case STAINED_CLAY:
  423.             case STAINED_GLASS_PANE:
  424.             case LEAVES_2:
  425.             case LOG_2:
  426.             case ACACIA_STAIRS:
  427.             case DARK_OAK_STAIRS:
  428.             case SLIME_BLOCK:
  429.             case BARRIER:
  430.             case PRISMARINE:
  431.             case SEA_LANTERN:
  432.             case HAY_BLOCK:
  433.             case CARPET:
  434.             case HARD_CLAY:
  435.             case COAL_BLOCK:
  436.             case PACKED_ICE:
  437.             case DOUBLE_PLANT:
  438.             case STANDING_BANNER:
  439.             case WALL_BANNER:
  440.             case DAYLIGHT_DETECTOR_INVERTED:
  441.             case RED_SANDSTONE:
  442.             case RED_SANDSTONE_STAIRS:
  443.             case DOUBLE_STONE_SLAB2:
  444.             case STONE_SLAB2:
  445.             case SPRUCE_FENCE:
  446.             case BIRCH_FENCE:
  447.             case JUNGLE_FENCE:
  448.             case DARK_OAK_FENCE:
  449.             case ACACIA_FENCE:
  450.             case END_ROD:
  451.             case CHORUS_PLANT:
  452.             case CHORUS_FLOWER:
  453.             case PURPUR_BLOCK:
  454.             case PURPUR_PILLAR:
  455.             case PURPUR_STAIRS:
  456.             case PURPUR_DOUBLE_SLAB:
  457.             case PURPUR_SLAB:
  458.             case END_BRICKS:
  459.             case BEETROOT_BLOCK:
  460.             case GRASS_PATH:
  461.             case END_GATEWAY:
  462.             case FROSTED_ICE:
  463.             case MAGMA:
  464.             case NETHER_WART_BLOCK:
  465.             case RED_NETHER_BRICK:
  466.             case BONE_BLOCK:
  467.             case WHITE_GLAZED_TERRACOTTA:
  468.             case ORANGE_GLAZED_TERRACOTTA:
  469.             case MAGENTA_GLAZED_TERRACOTTA:
  470.             case LIGHT_BLUE_GLAZED_TERRACOTTA:
  471.             case YELLOW_GLAZED_TERRACOTTA:
  472.             case LIME_GLAZED_TERRACOTTA:
  473.             case PINK_GLAZED_TERRACOTTA:
  474.             case GRAY_GLAZED_TERRACOTTA:
  475.             case SILVER_GLAZED_TERRACOTTA:
  476.             case CYAN_GLAZED_TERRACOTTA:
  477.             case PURPLE_GLAZED_TERRACOTTA:
  478.             case BLUE_GLAZED_TERRACOTTA:
  479.             case BROWN_GLAZED_TERRACOTTA:
  480.             case GREEN_GLAZED_TERRACOTTA:
  481.             case RED_GLAZED_TERRACOTTA:
  482.             case BLACK_GLAZED_TERRACOTTA:
  483.             case CONCRETE:
  484.             case CONCRETE_POWDER:
  485.             case STRUCTURE_BLOCK:
  486.             case IRON_SPADE:
  487.             case IRON_PICKAXE:
  488.             case IRON_AXE:
  489.             case FLINT_AND_STEEL:
  490.             case APPLE:
  491.             case BOW:
  492.             case ARROW:
  493.             case COAL:
  494.             case DIAMOND:
  495.             case IRON_INGOT:
  496.             case GOLD_INGOT:
  497.             case IRON_SWORD:
  498.             case WOOD_SWORD:
  499.             case WOOD_SPADE:
  500.             case WOOD_PICKAXE:
  501.             case WOOD_AXE:
  502.             case STONE_SWORD:
  503.             case IRON_TRAPDOOR:
  504.             case IRON_DOOR:
  505.             case STONE_SPADE:
  506.             case STONE_PICKAXE:
  507.             case STONE_AXE:
  508.             case DIAMOND_SWORD:
  509.             case DIAMOND_SPADE:
  510.             case DIAMOND_PICKAXE:
  511.             case DIAMOND_AXE:
  512.             case STICK:
  513.             case BOWL:
  514.             case MUSHROOM_SOUP:
  515.             case GOLD_SWORD:
  516.             case GOLD_SPADE:
  517.             case GOLD_PICKAXE:
  518.             case GOLD_AXE:
  519.             case STRING:
  520.             case FEATHER:
  521.             case SULPHUR:
  522.             case WOOD_HOE:
  523.             case STONE_HOE:
  524.             case IRON_HOE:
  525.             case DIAMOND_HOE:
  526.             case GOLD_HOE:
  527.             case SEEDS:
  528.             case WHEAT:
  529.             case BREAD:
  530.             case LEATHER_HELMET:
  531.             case LEATHER_CHESTPLATE:
  532.             case LEATHER_LEGGINGS:
  533.             case LEATHER_BOOTS:
  534.             case CHAINMAIL_HELMET:
  535.             case CHAINMAIL_CHESTPLATE:
  536.             case CHAINMAIL_LEGGINGS:
  537.             case CHAINMAIL_BOOTS:
  538.             case IRON_HELMET:
  539.             case IRON_CHESTPLATE:
  540.             case IRON_LEGGINGS:
  541.             case IRON_BOOTS:
  542.             case DIAMOND_HELMET:
  543.             case DIAMOND_CHESTPLATE:
  544.             case DIAMOND_LEGGINGS:
  545.             case DIAMOND_BOOTS:
  546.             case GOLD_HELMET:
  547.             case GOLD_CHESTPLATE:
  548.             case GOLD_LEGGINGS:
  549.             case GOLD_BOOTS:
  550.             case FLINT:
  551.             case PORK:
  552.             case GRILLED_PORK:
  553.             case PAINTING:
  554.             case GOLDEN_APPLE:
  555.             case SIGN:
  556.             case BUCKET:
  557.             case WATER_BUCKET:
  558.             case LAVA_BUCKET:
  559.             case MINECART:
  560.             case SADDLE:
  561.             case REDSTONE:
  562.             case SNOW_BALL:
  563.             case BOAT:
  564.             case LEATHER:
  565.             case MILK_BUCKET:
  566.             case CLAY_BRICK:
  567.             case CLAY_BALL:
  568.             case SUGAR_CANE:
  569.             case PAPER:
  570.             case BOOK:
  571.             case SLIME_BALL:
  572.             case EGG:
  573.             case COMPASS:
  574.             case FISHING_ROD:
  575.             case WATCH:
  576.             case GLOWSTONE_DUST:
  577.             case RAW_FISH:
  578.             case COOKED_FISH:
  579.             case INK_SACK:
  580.             case BONE:
  581.             case SUGAR:
  582.             case CAKE:
  583.             case BED:
  584.             case COOKIE:
  585.             case MAP:
  586.             case SHEARS:
  587.             case MELON:
  588.             case PUMPKIN_SEEDS:
  589.             case MELON_SEEDS:
  590.             case RAW_BEEF:
  591.             case COOKED_BEEF:
  592.             case RAW_CHICKEN:
  593.             case COOKED_CHICKEN:
  594.             case ROTTEN_FLESH:
  595.             case ENDER_PEARL:
  596.             case BLAZE_ROD:
  597.             case GHAST_TEAR:
  598.             case GOLD_NUGGET:
  599.             case NETHER_STALK:
  600.             case POTION:
  601.             case GLASS_BOTTLE:
  602.             case SPIDER_EYE:
  603.             case FERMENTED_SPIDER_EYE:
  604.             case BLAZE_POWDER:
  605.             case MAGMA_CREAM:
  606.             case BREWING_STAND_ITEM:
  607.             case CAULDRON_ITEM:
  608.             case EYE_OF_ENDER:
  609.             case SPECKLED_MELON:
  610.             case MONSTER_EGG:
  611.             case EXP_BOTTLE:
  612.             case FIREBALL:
  613.             case BOOK_AND_QUILL:
  614.             case WRITTEN_BOOK:
  615.             case EMERALD:
  616.             case ITEM_FRAME:
  617.             case FLOWER_POT_ITEM:
  618.             case CARROT_ITEM:
  619.             case POTATO_ITEM:
  620.             case BAKED_POTATO:
  621.             case POISONOUS_POTATO:
  622.             case EMPTY_MAP:
  623.             case GOLDEN_CARROT:
  624.             case SKULL_ITEM:
  625.             case CARROT_STICK:
  626.             case NETHER_STAR:
  627.             case PUMPKIN_PIE:
  628.             case FIREWORK:
  629.             case FIREWORK_CHARGE:
  630.             case ENCHANTED_BOOK:
  631.             case NETHER_BRICK_ITEM:
  632.             case QUARTZ:
  633.             case PRISMARINE_SHARD:
  634.             case PRISMARINE_CRYSTALS:
  635.             case RABBIT:
  636.             case COOKED_RABBIT:
  637.             case RABBIT_STEW:
  638.             case RABBIT_FOOT:
  639.             case RABBIT_HIDE:
  640.             case ARMOR_STAND:
  641.             case IRON_BARDING:
  642.             case GOLD_BARDING:
  643.             case DIAMOND_BARDING:
  644.             case LEASH:
  645.             case NAME_TAG:
  646.             case MUTTON:
  647.             case COOKED_MUTTON:
  648.             case BANNER:
  649.             case SPRUCE_DOOR_ITEM:
  650.             case BIRCH_DOOR_ITEM:
  651.             case JUNGLE_DOOR_ITEM:
  652.             case ACACIA_DOOR_ITEM:
  653.             case DARK_OAK_DOOR_ITEM:
  654.             case CHORUS_FRUIT:
  655.             case CHORUS_FRUIT_POPPED:
  656.             case BEETROOT:
  657.             case BEETROOT_SEEDS:
  658.             case BEETROOT_SOUP:
  659.             case DRAGONS_BREATH:
  660.             case SPLASH_POTION:
  661.             case SPECTRAL_ARROW:
  662.             case TIPPED_ARROW:
  663.             case LINGERING_POTION:
  664.             case SHIELD:
  665.             case ELYTRA:
  666.             case BOAT_SPRUCE:
  667.             case BOAT_BIRCH:
  668.             case BOAT_JUNGLE:
  669.             case BOAT_ACACIA:
  670.             case BOAT_DARK_OAK:
  671.             case TOTEM:
  672.             case SHULKER_SHELL:
  673.             case IRON_NUGGET:
  674.             case GOLD_RECORD:
  675.             case GREEN_RECORD:
  676.             case RECORD_3:
  677.             case RECORD_4:
  678.             case RECORD_5:
  679.             case RECORD_6:
  680.             case RECORD_7:
  681.             case RECORD_8:
  682.             case RECORD_9:
  683.             case RECORD_10:
  684.             case RECORD_11:
  685.             case RECORD_12:
  686.             default:
  687.                 return false;
  688.             //</editor-fold>
  689.         }
  690.     }
  691.  
  692.     //</editor-fold>
  693.  
  694.     private boolean isFarPlacer(UUID uniqueId) {
  695.         return this.farplacers.contains(uniqueId);
  696.     }
  697. }
Advertisement
Add Comment
Please, Sign In to add comment