Paste Search Dynamic
Recent pastes
package net minecraft server
  1. package net.minecraft.server;
  2.  
  3. import java.util.Set;
  4.  
  5. import com.google.common.collect.Sets;
  6.  
  7. public class ItemHammer extends ItemTool{
  8.  
  9.     private static final Set<Block> c = Sets.newHashSet(new Block[] { Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB});
  10.  
  11.     protected ItemHammer(Item.EnumToolMaterial item_enumtoolmaterial) {
  12.         super(2.0F, item_enumtoolmaterial, ItemHammer.c);
  13.     }
  14.  
  15.     public boolean canDestroySpecialBlock(Block block) {
  16.         return block == Blocks.OBSIDIAN ? this.b.d() == 3 : (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE ? (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK ? (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE ? (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE ? (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE ? (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE ? (block.getMaterial() == Material.STONE ? true : (block.getMaterial() == Material.ORE ? true : block.getMaterial() == Material.HEAVY)) : this.b.d() >= 2) : this.b.d() >= 1) : this.b.d() >= 1) : this.b.d() >= 2) : this.b.d() >= 2) : this.b.d() >= 2);
  17.     }
  18.  
  19.     public float getDestroySpeed(ItemStack itemstack, Block block) {
  20.         return block.getMaterial() != Material.ORE && block.getMaterial() != Material.HEAVY && block.getMaterial() != Material.STONE ? super.getDestroySpeed(itemstack, block) : this.a;
  21.     }
  22.    
  23.     public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPosition blockposition, EntityLiving entityliving) {
  24.        
  25.         BlockPosition posdown = blockposition.down();
  26.         BlockPosition posup = blockposition.up();
  27.         BlockPosition posright = null;
  28.         BlockPosition posleft = null;
  29.         BlockPosition postopleft = null;
  30.         BlockPosition postopright = null;
  31.         BlockPosition posdownleft = null;
  32.         BlockPosition posdownright = null;
  33.        
  34.         EnumDirection enumfacing = entityliving.getDirection();
  35.        
  36.         switch(enumfacing)
  37.         {
  38.                 case NORTH:
  39.                         posright = blockposition.east();
  40.                         posleft = blockposition.west();
  41.                        
  42.                         postopright = blockposition.up().east();
  43.                         posdownright = blockposition.down().east();
  44.                        
  45.                         postopleft = blockposition.up().west();
  46.                         posdownleft = blockposition.down().west();
  47.                        
  48.                 break;
  49.                
  50.                 case SOUTH:
  51.                         posright = blockposition.east();
  52.                         posleft = blockposition.west();
  53.                        
  54.                         postopright = posright.up();
  55.                         posdownright = posright.down();
  56.                        
  57.                         postopleft = posleft.up();
  58.                         posdownleft = posleft.down();
  59.                        
  60.                 break;
  61.                
  62.                 case EAST:
  63.                         posright = blockposition.north();
  64.                         posleft = blockposition.south();
  65.                        
  66.                         postopright = posright.up();
  67.                         posdownright = posright.down();
  68.                        
  69.                         postopleft = posleft.up();
  70.                         posdownleft = posleft.down();
  71.                        
  72.                 break;
  73.                
  74.                 case WEST:
  75.                         posright = blockposition.north();
  76.                         posleft = blockposition.south();
  77.                        
  78.                         postopright = posright.up();
  79.                         posdownright = posright.down();
  80.                        
  81.                         postopleft = posleft.up();
  82.                         posdownleft = posleft.down();
  83.                        
  84.                 break;
  85.         }
  86.        
  87.         world.setAir(posdown, true);
  88.         world.setAir(posup, true);
  89.         world.setAir(posright, true);
  90.         world.setAir(posleft, true);
  91.         world.setAir(postopleft, true);
  92.         world.setAir(postopright, true);
  93.         world.setAir(posdownleft, true);
  94.         world.setAir(posdownright, true);
  95.        
  96.         return super.a(itemstack, world, block, blockposition, entityliving);
  97.  
  98.     }
  99. }
Parsed in 0.008 seconds