protected boolean generateChest(World worldIn, StructureBoundingBox structurebb, Random randomIn, int x, int y, int z, ResourceLocation loot) { BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); if (structurebb.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getMaterial() == Material.AIR && worldIn.getBlockState(blockpos.down()).getMaterial() != Material.AIR) { IBlockState iblockstate = Blocks.RAIL.getDefaultState().withProperty(BlockRail.SHAPE, randomIn.nextBoolean() ? BlockRailBase.EnumRailDirection.NORTH_SOUTH : BlockRailBase.EnumRailDirection.EAST_WEST); this.setBlockState(worldIn, iblockstate, x, y, z, structurebb); EntityMinecartChest entityminecartchest = new EntityMinecartChest(worldIn, (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F)); entityminecartchest.setLootTable(loot, randomIn.nextLong()); worldIn.spawnEntityInWorld(entityminecartchest); return true; } else { return false; } }
/** * Adds chest to the structure and sets its contents */ protected boolean generateChest(World worldIn, StructureBoundingBox structurebb, Random randomIn, int x, int y, int z, ResourceLocation loot) { BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); if (structurebb.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getMaterial() == Material.AIR && worldIn.getBlockState(blockpos.down()).getMaterial() != Material.AIR) { IBlockState iblockstate = Blocks.RAIL.getDefaultState().withProperty(BlockRail.SHAPE, randomIn.nextBoolean() ? BlockRailBase.EnumRailDirection.NORTH_SOUTH : BlockRailBase.EnumRailDirection.EAST_WEST); this.setBlockState(worldIn, iblockstate, x, y, z, structurebb); EntityMinecartChest entityminecartchest = new EntityMinecartChest(worldIn, (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F)); entityminecartchest.setLootTable(loot, randomIn.nextLong()); worldIn.spawnEntityInWorld(entityminecartchest); return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT6(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)) && world.getBlock(x, y, z) instanceof RailMonoMagnetBase) { if (!world.isRemote) { LocoBase entityminecart = new NSPCT4M(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)) && world.getBlock(x, y, z) instanceof RailMonoMagnetBase) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT4(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT5L(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT8(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSBT1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT5(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT2(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSTCT1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { MinecartBase entityminecart = new NSPCT3(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { LocoBase entityminecart = new NSET2(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { LocoBase entityminecart = new NSPCT8J(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { LocoBase entityminecart = new NSPCT6L(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { LocoBase entityminecart = new NSET1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { LocoBase entityminecart = new NSPCT8M(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { LocoBase entityminecart = new NSPCT7(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { LocoBase entityminecart = new NSPCT6C(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5); if (itemStack.hasDisplayName()) { entityminecart.setMinecartName(itemStack.getDisplayName()); } world.spawnEntityInWorld(entityminecart); } --itemStack.stackSize; return true; } else { return false; } }
static boolean isStairish(Coord c) { Block b = c.getBlock(); if (b == null) { return false; } if (b instanceof BlockRailBase) { return true; } AxisAlignedBB ab = c.getCollisionBoundingBox(); ArrayList<AxisAlignedBB> list = new ArrayList<AxisAlignedBB>(); b.addCollisionBoxesToList(c.w, c.toBlockPos(), c.getState(), ab, list, null); for (AxisAlignedBB bb : list) { if (bb.maxY - c.y <= 0.51) { return true; } } return false; }
@Override public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { IBlockState iblockstate = worldIn.getBlockState(pos); if (!BlockRailBase.isRailBlock(iblockstate)) { return EnumActionResult.FAIL; } else { ItemStack itemstack = player.getHeldItem(hand); if (!worldIn.isRemote) { BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRailBase ? ((BlockRailBase) iblockstate.getBlock()).getRailDirection(worldIn, pos, iblockstate, null) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; double d0 = 0.0D; if (blockrailbase$enumraildirection.isAscending()) { d0 = 0.5D; } EntityMinecart entityminecart = summonMinecart(worldIn);//new EntityMinecartTurret(worldIn, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.0625D + d0, (double) pos.getZ() + 0.5D); entityminecart.setPosition((double) pos.getX() + 0.5D, (double) pos.getY() + 0.0625D + d0, (double) pos.getZ() + 0.5D); if (itemstack.hasDisplayName()) { entityminecart.setCustomNameTag(itemstack.getDisplayName()); } worldIn.spawnEntity(entityminecart); } itemstack.shrink(1); return EnumActionResult.SUCCESS; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isClient) { EntityMinecart var11 = EntityMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { var11.setMinecartName(par1ItemStack.getDisplayName()); } par3World.spawnEntityInWorld(var11); } --par1ItemStack.stackSize; return true; } else { return false; } }
@Override public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { world.spawnEntityInWorld(new EntityWoodenMinecartChest(world, x + 0.5F, y + 0.5F, z + 0.5F)); } --itemstack.stackSize; return true; } else { return false; } }
public boolean placeCart(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, EntityMinecart entityMinecart) { if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { if (!world.isRemote) { entityMinecart.posX = (float)x + 0.5F; entityMinecart.posY = (float)y + 0.5F; entityMinecart.posZ = (float)z + 0.5F; world.spawnEntityInWorld(entityMinecart); } --itemStack.stackSize; return true; } else { return false; } }
/** * Checks to see if a cart is being held by a ITrackLockdown. * * @param cart The cart to check * @return True if being held */ public static boolean isCartLockedDown(EntityMinecart cart) { int x = MathHelper.floor_double(cart.posX); int y = MathHelper.floor_double(cart.posY); int z = MathHelper.floor_double(cart.posZ); if (BlockRailBase.func_150049_b_(cart.worldObj, x, y - 1, z)) y--; TileEntity tile = cart.worldObj.getTileEntity(x, y, z); if (tile instanceof ITrackTile) { ITrackInstance track = ((ITrackTile) tile).getTrackInstance(); return track instanceof ITrackLockdown && ((ITrackLockdown) track).isCartLockedDown(cart); } else if (tile instanceof ITrackLockdown) return ((ITrackLockdown) tile).isCartLockedDown(cart); return false; }
@Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (BlockRailBase.isRailBlock(world.getBlockId(x, y, z))) { if (!world.isRemote) { EntityMinecart cart = getMinecart(stack, player, world); cart.setPosition(x + 0.5D, y + 0.5D, z + 0.5D); if (stack.hasDisplayName()) { cart.func_96094_a(stack.getDisplayName()); } world.spawnEntityInWorld(cart); stack.stackSize--; } return true; } return false; }
/** * Checks to see if a cart is being held by a ITrackLockdown. * * @param cart The cart to check * @return True if being held */ public static boolean isCartLockedDown(EntityMinecart cart) { int x = MathHelper.floor_double(cart.posX); int y = MathHelper.floor_double(cart.posY); int z = MathHelper.floor_double(cart.posZ); if (BlockRailBase.isRailBlockAt(cart.worldObj, x, y - 1, z)) { y--; } TileEntity tile = cart.worldObj.getBlockTileEntity(x, y, z); if (tile instanceof ITrackTile) { ITrackInstance track = ((ITrackTile) tile).getTrackInstance(); return track instanceof ITrackLockdown && ((ITrackLockdown) track).isCartLockedDown(cart); } else if (tile instanceof ITrackLockdown) { return ((ITrackLockdown) tile).isCartLockedDown(cart); } return false; }
/** * Used to generate chests with items in it. ex: Temple Chests, Village Blacksmith Chests, Mineshaft Chests. */ @Override protected boolean generateChest(World world, StructureBoundingBox structureboundingbox, Random rand, int x, int y, int z, ResourceLocation loot) { BlockPos blockpos = new BlockPos(getXWithOffset(x, z), getYWithOffset(y), getZWithOffset(x, z)); if (structureboundingbox.isVecInside(blockpos) && world.getBlockState(blockpos).getMaterial() == Material.AIR) { IBlockState iblockstate = Blocks.RAIL.getDefaultState().withProperty(BlockRail.SHAPE, rand.nextBoolean() ? BlockRailBase.EnumRailDirection.NORTH_SOUTH : BlockRailBase.EnumRailDirection.EAST_WEST); setBlockState(world, iblockstate, x, y, z, structureboundingbox); EntityMinecartChest entityminecartchest = new EntityMinecartChest(world, blockpos.getX() + 0.5F, blockpos.getY() + 0.5F, blockpos.getZ() + 0.5F); entityminecartchest.setLootTable(loot, rand.nextLong()); world.spawnEntity(entityminecartchest); return true; } else return false; }
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { EntityMinecart entityminecart = new ServerCart(par3World, par4 + 0.5F, par5 + 0.5F, par6 + 0.5F); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); } par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { if (BlockRailBase.func_150051_a(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_))) { if (!p_77648_3_.isRemote) { EntityMinecart entityminecart = EntityMinecart.createMinecart(p_77648_3_, (double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.minecartType); if (p_77648_1_.hasDisplayName()) { entityminecart.setMinecartName(p_77648_1_.getDisplayName()); } p_77648_3_.spawnEntityInWorld(entityminecart); } --p_77648_1_.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { EntitySpeedyChestcart entityminecart = (EntitySpeedyChestcart) EntitySpeedyChestcart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); } par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { /* EntitySpeedyMinecart entityminecart = (EntitySpeedyMinecart) EntitySpeedyMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); }*/ EntitySpeedyTankCart entityminecart = (EntitySpeedyTankCart) EntitySpeedyTankCart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { EntitySpeedyMinecart entityminecart = (EntitySpeedyMinecart) EntitySpeedyMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); } par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { /* EntitySpeedyMinecart entityminecart = (EntitySpeedyMinecart) EntitySpeedyMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); }*/ EntityChunkTankCart entityminecart = (EntityChunkTankCart) EntityChunkTankCart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { /* EntitySpeedyMinecart entityminecart = (EntitySpeedyMinecart) EntitySpeedyMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); }*/ EntitySpeedyChunkTankCart entityminecart = (EntitySpeedyChunkTankCart) EntitySpeedyChunkTankCart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { /* EntitySpeedyMinecart entityminecart = (EntitySpeedyMinecart) EntitySpeedyMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); }*/ EntityTankCart entityminecart = (EntityTankCart) EntityTankCart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { EntitySpeedyChunkChestCart entityminecart = (EntitySpeedyChunkChestCart) EntitySpeedyChunkChestCart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); } par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
/** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (BlockRailBase.func_150051_a(par3World.getBlock(par4, par5, par6))) { if (!par3World.isRemote) { EntityChunkChestCart entityminecart = (EntityChunkChestCart) EntityChunkChestCart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); if (par1ItemStack.hasDisplayName()) { entityminecart.setMinecartName(par1ItemStack.getDisplayName()); } par3World.spawnEntityInWorld(entityminecart); } --par1ItemStack.stackSize; return true; } else { return false; } }
public boolean func_77648_a(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { int var11 = p_77648_3_.func_72798_a(p_77648_4_, p_77648_5_, p_77648_6_); if(BlockRailBase.func_72184_d(var11)) { if(!p_77648_3_.field_72995_K) { EntityMinecart var12 = EntityMinecart.func_94090_a(p_77648_3_, (double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.field_77841_a); if(p_77648_1_.func_82837_s()) { var12.func_96094_a(p_77648_1_.func_82833_r()); } p_77648_3_.func_72838_d(var12); } --p_77648_1_.field_77994_a; return true; } else { return false; } }