public void initTesters() { entityWhitelist.addTester(new ClassTester<Entity>(EntityItem.class)); entityWhitelist.addTester(new ClassTester<Entity>(EntityBoat.class)); entityWhitelist.addTester(new ClassTester<Entity>(EntityMinecart.class)); MinecraftForge.EVENT_BUS.post(new EntityRegisterEvent(entityWhitelist)); blockWhitelist.addTester(o -> { float hardness = o.blockState.getBlockHardness(o.world, o); return (hardness < 0)? Result.REJECT : Result.CONTINUE; }); blockWhitelist.addTester(o -> o.blockState.getRenderType() == EnumBlockRenderType.MODEL? Result.ACCEPT : Result.CONTINUE); blockWhitelist.addTester(createBlockClassTester(BlockSand.class)); blockWhitelist.addTester(createBlockClassTester(BlockStairs.class)); blockWhitelist.addTester(createBlockClassTester(BlockFence.class)); blockWhitelist.addTester(createBlockClassTester(BlockFenceGate.class)); blockWhitelist.addTester(createBlockIdentityTester(Blocks.CACTUS)); MinecraftForge.EVENT_BUS.post(new BlockRegisterEvent(blockWhitelist)); tileEntityWhitelist .addTester(new ClassTester<TileEntity>(TileEntityBeacon.class)) .addTester(new ClassTester<TileEntity>(TileEntityBrewingStand.class)) .addTester(new ClassTester<TileEntity>(TileEntityChest.class)) .addTester(new ClassTester<TileEntity>(TileEntityCommandBlock.class)) .addTester(new ClassTester<TileEntity>(TileEntityDispenser.class)) .addTester(new ClassTester<TileEntity>(TileEntityEnchantmentTable.class)) .addTester(new ClassTester<TileEntity>(TileEntityEnderChest.class)) .addTester(new ClassTester<TileEntity>(TileEntityFurnace.class)) .addTester(new ClassTester<TileEntity>(TileEntityHopper.class)) .addTester(new ClassTester<TileEntity>(TileEntityNote.class)) .addTester(new ClassTester<TileEntity>(TileEntityJukebox.class)); }
public CraftJukebox(final Block block) { super(block); world = (CraftWorld) block.getWorld(); jukebox = (TileEntityJukebox) world.getTileEntityAt(getX(), getY(), getZ()); }
@Override public Class<?> getTargetClass() { return TileEntityJukebox.class; }
@ScriptCallable(returnTypes = ReturnType.TABLE, description = "Get the record currently being played") public ItemStack getRecord(TileEntityJukebox recordPlayer) { return recordPlayer.func_145856_a(); }