Advertisement
nicka101

SuperSimpleSpawners Modification (Line 212 Start)

Apr 23rd, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. CreatureSpawner spawner = (CreatureSpawner) placedBlock.getState();
  2.         // We're going to change the item type to a monster spawner so it looks like that's what the
  3.         // player is placing for the fake block place event.
  4.         //itemInHand.setType(Material.MOB_SPAWNER); //Unneeded. BlockPlaceEvent can be called with actual itemInHand
  5.         // Create a block place event for compatibility, then call it.
  6.         BlockPlaceEvent bpEvent = new BlockPlaceEvent(placedBlock, previousState, targetBlock,
  7.                 itemInHand, player, canBuild(player, placedBlock.getX(), placedBlock.getZ()));
  8.         Bukkit.getPluginManager().callEvent(bpEvent);
  9.         // Now we'll switch that monster spawner back to spawn eggs so the player sees no change
  10.         /*if (itemInHand.getType() == Material.MOB_SPAWNER) {
  11.             itemInHand.setType(Material.MONSTER_EGG);
  12.         }*/ //Above Was Unneeded so this is too
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement