public void func_146102_a(TileEntityDispenser p_146102_1_) { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerDispenser(this.inventory, p_146102_1_)); if (container == null) { p_146102_1_.closeInventory(); // Cauldron - prevent chests from being stuck in open state on clients return; } // CraftBukkit end this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, p_146102_1_ instanceof TileEntityDropper ? 10 : 3, p_146102_1_.getInventoryName(), p_146102_1_.getSizeInventory(), p_146102_1_.hasCustomInventoryName())); this.openContainer = container; // CraftBukkit - Use container we passed to event this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { return true; } else { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityDispenser) { playerIn.displayGUIChest((TileEntityDispenser)tileentity); if (tileentity instanceof TileEntityDropper) { playerIn.triggerAchievement(StatList.field_181731_O); } else { playerIn.triggerAchievement(StatList.field_181733_Q); } } return true; } }
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY) { if (worldIn.isRemote) { return true; } else { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityDispenser) { playerIn.displayGUIChest((TileEntityDispenser)tileentity); if (tileentity instanceof TileEntityDropper) { playerIn.addStat(StatList.DROPPER_INSPECTED); } else { playerIn.addStat(StatList.DISPENSER_INSPECTED); } } return true; } }
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { return true; } else { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityDispenser) { playerIn.displayGUIChest((TileEntityDispenser)tileentity); if (tileentity instanceof TileEntityDropper) { playerIn.addStat(StatList.DROPPER_INSPECTED); } else { playerIn.addStat(StatList.DISPENSER_INSPECTED); } } return true; } }
public void func_146102_a(TileEntityDispenser p_146102_1_) { this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, p_146102_1_ instanceof TileEntityDropper ? 10 : 3, p_146102_1_.getInventoryName(), p_146102_1_.getSizeInventory(), p_146102_1_.isInventoryNameLocalized())); this.openContainer = new ContainerDispenser(this.inventory, p_146102_1_); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public void func_146102_a(TileEntityDispenser p_146102_1_) { this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, p_146102_1_ instanceof TileEntityDropper ? 10 : 3, p_146102_1_.getInventoryName(), p_146102_1_.getSizeInventory(), p_146102_1_.hasCustomInventoryName())); this.openContainer = new ContainerDispenser(this.inventory, p_146102_1_); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public void func_71006_a(TileEntityDispenser p_71006_1_) { this.func_71117_bO(); this.field_71135_a.func_72567_b(new Packet100OpenWindow(this.field_71139_cq, p_71006_1_ instanceof TileEntityDropper?10:3, p_71006_1_.func_70303_b(), p_71006_1_.func_70302_i_(), p_71006_1_.func_94042_c())); this.field_71070_bA = new ContainerDispenser(this.field_71071_by, p_71006_1_); this.field_71070_bA.field_75152_c = this.field_71139_cq; this.field_71070_bA.func_75132_a(this); }
/** * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser */ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) { this.incrementWindowID(); this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, par1TileEntityDispenser instanceof TileEntityDropper ? 10 : 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory(), par1TileEntityDispenser.isInvNameLocalized())); this.openContainer = new ContainerDispenser(this.inventory, par1TileEntityDispenser); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public void add(IWorldEditor editor, Coord pos, int slot, ItemStack item){ TileEntity te = editor.getTileEntity(pos); if(te == null) return; if(!(te instanceof TileEntityDropper)) return; TileEntityDropper dropper = (TileEntityDropper) te; dropper.setInventorySlotContents(slot, item); }
public CraftDropper(final Block block) { super(block); world = (CraftWorld) block.getWorld(); dropper = (TileEntityDropper) world.getTileEntityAt(getX(), getY(), getZ()); }
/** * Returns a new instance of a block's tile entity class. Called on placing the block. */ public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityDropper(); }
@Override public void onRender() { if(isEnabled()) { for (Object o : Wrapper.getWorld().loadedTileEntityList) { if (o instanceof TileEntityChest) { TileEntityChest chest = (TileEntityChest) o; this.drawChestESP(chest, chest.getPos().getX(), chest.getPos().getY(), chest.getPos().getZ()); } if (o instanceof TileEntityEnderChest) { TileEntityEnderChest enderChest = (TileEntityEnderChest) o; this.drawEnderChestESP(enderChest, enderChest.getPos().getX(), enderChest.getPos().getY(), enderChest.getPos().getZ()); } if (o instanceof TileEntityFurnace) { TileEntityFurnace furnace = (TileEntityFurnace) o; RenderUtils.blockESP(furnace.getPos(), Color.white, 1.0, 1.0); } if (o instanceof TileEntityDispenser) { TileEntityDispenser dispenser = (TileEntityDispenser) o; RenderUtils.blockESP(dispenser.getPos(), Color.white, 1.0, 1.0); } if (o instanceof TileEntityDropper) { TileEntityDropper dropper = (TileEntityDropper) o; RenderUtils.blockESP(dropper.getPos(), Color.white, 1.0, 1.0); } if (o instanceof TileEntityHopper) { TileEntityHopper hopper = (TileEntityHopper) o; RenderUtils.blockESP(hopper.getPos(), Color.white, 1.0, 1.0); } if (o instanceof TileEntityShulkerBox) { TileEntityShulkerBox shulker = (TileEntityShulkerBox) o; RenderUtils.blockESP(shulker.getPos(), Color.yellow, 1.0, 1.0); } } for (Entity e: Wrapper.getWorld().loadedEntityList) { if (e instanceof EntityMinecartChest) { RenderUtils.blockESP(e.getPosition(), Color.green, 1.0, 1.0); } if (e instanceof EntityMinecartFurnace || e instanceof EntityMinecartHopper) { RenderUtils.blockESP(e.getPosition(), Color.white, 1.0, 1.0); } } } }
public static DataFixer createFixer() { DataFixer datafixer = new DataFixer(512); WorldInfo.registerFixes(datafixer); EntityPlayer.registerFixesPlayer(datafixer); AnvilChunkLoader.registerFixes(datafixer); ItemStack.registerFixes(datafixer); EntityArmorStand.registerFixesArmorStand(datafixer); EntityArrow.registerFixesArrow(datafixer); EntityBat.registerFixesBat(datafixer); EntityBlaze.registerFixesBlaze(datafixer); EntityCaveSpider.registerFixesCaveSpider(datafixer); EntityChicken.registerFixesChicken(datafixer); EntityCow.registerFixesCow(datafixer); EntityCreeper.registerFixesCreeper(datafixer); EntityDragonFireball.registerFixesDragonFireball(datafixer); EntityDragon.registerFixesDragon(datafixer); EntityEnderman.registerFixesEnderman(datafixer); EntityEndermite.registerFixesEndermite(datafixer); EntityFallingBlock.registerFixesFallingBlock(datafixer); EntityLargeFireball.registerFixesLargeFireball(datafixer); EntityFireworkRocket.registerFixesFireworkRocket(datafixer); EntityGhast.registerFixesGhast(datafixer); EntityGiantZombie.registerFixesGiantZombie(datafixer); EntityGuardian.registerFixesGuardian(datafixer); EntityHorse.registerFixesHorse(datafixer); EntityItem.registerFixesItem(datafixer); EntityItemFrame.registerFixesItemFrame(datafixer); EntityMagmaCube.registerFixesMagmaCube(datafixer); EntityMinecartChest.registerFixesMinecartChest(datafixer); EntityMinecartCommandBlock.registerFixesMinecartCommand(datafixer); EntityMinecartFurnace.registerFixesMinecartFurnace(datafixer); EntityMinecartHopper.registerFixesMinecartHopper(datafixer); EntityMinecartEmpty.registerFixesMinecartEmpty(datafixer); EntityMinecartMobSpawner.registerFixesMinecartMobSpawner(datafixer); EntityMinecartTNT.registerFixesMinecartTNT(datafixer); EntityLiving.registerFixesMob(datafixer); EntityMob.registerFixesMonster(datafixer); EntityMooshroom.registerFixesMooshroom(datafixer); EntityOcelot.registerFixesOcelot(datafixer); EntityPig.registerFixesPig(datafixer); EntityPigZombie.registerFixesPigZombie(datafixer); EntityRabbit.registerFixesRabbit(datafixer); EntitySheep.registerFixesSheep(datafixer); EntityShulker.registerFixesShulker(datafixer); EntitySilverfish.registerFixesSilverfish(datafixer); EntitySkeleton.registerFixesSkeleton(datafixer); EntitySlime.registerFixesSlime(datafixer); EntitySmallFireball.registerFixesSmallFireball(datafixer); EntitySnowman.registerFixesSnowman(datafixer); EntitySnowball.registerFixesSnowball(datafixer); EntitySpectralArrow.registerFixesSpectralArrow(datafixer); EntitySpider.registerFixesSpider(datafixer); EntitySquid.registerFixesSquid(datafixer); EntityEgg.registerFixesEgg(datafixer); EntityEnderPearl.registerFixesEnderPearl(datafixer); EntityExpBottle.registerFixesExpBottle(datafixer); EntityPotion.registerFixesPotion(datafixer); EntityTippedArrow.registerFixesTippedArrow(datafixer); EntityVillager.registerFixesVillager(datafixer); EntityIronGolem.registerFixesIronGolem(datafixer); EntityWitch.registerFixesWitch(datafixer); EntityWither.registerFixesWither(datafixer); EntityWitherSkull.registerFixesWitherSkull(datafixer); EntityWolf.registerFixesWolf(datafixer); EntityZombie.registerFixesZombie(datafixer); TileEntityPiston.registerFixesPiston(datafixer); TileEntityFlowerPot.registerFixesFlowerPot(datafixer); TileEntityFurnace.registerFixesFurnace(datafixer); TileEntityChest.registerFixesChest(datafixer); TileEntityDispenser.registerFixes(datafixer); TileEntityDropper.registerFixesDropper(datafixer); TileEntityBrewingStand.registerFixesBrewingStand(datafixer); TileEntityHopper.registerFixesHopper(datafixer); BlockJukebox.registerFixesJukebox(datafixer); TileEntityMobSpawner.registerFixesMobSpawner(datafixer); registerFixes(datafixer); return datafixer; }
/** * Returns a new instance of a block's tile entity class. Called on placing the block. */ public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityDropper(); }
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityDropper(); }
public TileEntity func_72274_a(World p_72274_1_) { return new TileEntityDropper(); }
/** * Returns a new instance of a block's tile entity class. Called on placing the block. */ public TileEntity createNewTileEntity(World par1World) { return new TileEntityDropper(); }