Java 类net.minecraft.tileentity.TileEntityBeacon 实例源码

项目:DecompiledMinecraft    文件:BlockBeacon.java   
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 TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.triggerAchievement(StatList.field_181730_N);
        }

        return true;
    }
}
项目:DecompiledMinecraft    文件:BlockBeacon.java   
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 TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.triggerAchievement(StatList.field_181730_N);
        }

        return true;
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || i == 2 && tileentity instanceof TileEntityCommandBlock || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
    }
}
项目:DecompiledMinecraft    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
项目:BaseClient    文件:BlockBeacon.java   
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 TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.triggerAchievement(StatList.field_181730_N);
        }

        return true;
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || i == 2 && tileentity instanceof TileEntityCommandBlock || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
    }
}
项目:BaseClient    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
项目:BaseClient    文件:BlockBeacon.java   
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 TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.triggerAchievement(StatList.field_181730_N);
        }

        return true;
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following
 * entitytypes: Mob spawners, command blocks, beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();

        if (i == 1 && tileentity instanceof TileEntityMobSpawner
                || i == 2 && tileentity instanceof TileEntityCommandBlock
                || i == 3 && tileentity instanceof TileEntityBeacon
                || i == 4 && tileentity instanceof TileEntitySkull
                || i == 5 && tileentity instanceof TileEntityFlowerPot
                || i == 6 && tileentity instanceof TileEntityBanner) {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
    }
}
项目:BaseClient    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.world.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.world.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign || i == 10 && tileentity instanceof TileEntityShulkerBox)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
项目:Backmemed    文件:BlockBeacon.java   
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 TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.addStat(StatList.BEACON_INTERACTION);
        }

        return true;
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.world.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.world.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign || i == 10 && tileentity instanceof TileEntityShulkerBox)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
项目:Backmemed    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityEndGateway.class, new TileEntityEndGatewayRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());
    this.mapSpecialRenderers.put(TileEntityStructure.class, new TileEntityStructureRenderer());
    this.mapSpecialRenderers.put(TileEntityShulkerBox.class, new TileEntityShulkerBoxRenderer(new ModelShulker()));

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
项目:Backmemed    文件:TileEntityBeaconRenderer.java   
public void renderBeacon(double p_188206_1_, double p_188206_3_, double p_188206_5_, double p_188206_7_, double p_188206_9_, List<TileEntityBeacon.BeamSegment> p_188206_11_, double p_188206_12_)
{
    GlStateManager.alphaFunc(516, 0.1F);
    this.bindTexture(TEXTURE_BEACON_BEAM);

    if (p_188206_9_ > 0.0D)
    {
        GlStateManager.disableFog();
        int i = 0;

        for (int j = 0; j < p_188206_11_.size(); ++j)
        {
            TileEntityBeacon.BeamSegment tileentitybeacon$beamsegment = (TileEntityBeacon.BeamSegment)p_188206_11_.get(j);
            renderBeamSegment(p_188206_1_, p_188206_3_, p_188206_5_, p_188206_7_, p_188206_9_, p_188206_12_, i, tileentitybeacon$beamsegment.getHeight(), tileentitybeacon$beamsegment.getColors());
            i += tileentitybeacon$beamsegment.getHeight();
        }

        GlStateManager.enableFog();
    }
}
项目:CustomWorldGen    文件:BlockBeacon.java   
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 TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.addStat(StatList.BEACON_INTERACTION);
        }

        return true;
    }
}
项目:CustomWorldGen    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityEndGateway.class, new TileEntityEndGatewayRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());
    this.mapSpecialRenderers.put(TileEntityStructure.class, new TileEntityStructureRenderer());

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
项目:CustomWorldGen    文件:TileEntityBeaconRenderer.java   
public void renderBeacon(double p_188206_1_, double p_188206_3_, double p_188206_5_, double p_188206_7_, double p_188206_9_, List<TileEntityBeacon.BeamSegment> p_188206_11_, double p_188206_12_)
{
    GlStateManager.alphaFunc(516, 0.1F);
    this.bindTexture(TEXTURE_BEACON_BEAM);

    if (p_188206_9_ > 0.0D)
    {
        GlStateManager.disableFog();
        int i = 0;

        for (int j = 0; j < p_188206_11_.size(); ++j)
        {
            TileEntityBeacon.BeamSegment tileentitybeacon$beamsegment = (TileEntityBeacon.BeamSegment)p_188206_11_.get(j);
            renderBeamSegment(p_188206_1_, p_188206_3_, p_188206_5_, p_188206_7_, p_188206_9_, p_188206_12_, i, tileentitybeacon$beamsegment.getHeight(), tileentitybeacon$beamsegment.getColors());
            i += tileentitybeacon$beamsegment.getHeight();
        }

        GlStateManager.enableFog();
    }
}
项目:BlockSystems    文件:UpdateBlockEntityMessage.java   
@Override
public void onReceiveClient(Minecraft client, WorldClient world, EntityPlayerSP player, MessageContext context) {
    BlockSystem blockSystem = BlockSystems.PROXY.getBlockSystemHandler(world).getBlockSystem(this.blockSystem);
    if (blockSystem != null) {
        if (blockSystem.isBlockLoaded(this.pos)) {
            TileEntity blockEntity = blockSystem.getTileEntity(this.pos);
            boolean commandBlock = this.type == 2 && blockEntity instanceof TileEntityCommandBlock;
            if (this.type == 1 && blockEntity instanceof TileEntityMobSpawner || commandBlock || this.type == 3 && blockEntity instanceof TileEntityBeacon || this.type == 4 && blockEntity instanceof TileEntitySkull || this.type == 5 && blockEntity instanceof TileEntityFlowerPot || this.type == 6 && blockEntity instanceof TileEntityBanner || this.type == 7 && blockEntity instanceof TileEntityStructure || this.type == 8 && blockEntity instanceof TileEntityEndGateway || this.type == 9 && blockEntity instanceof TileEntitySign) {
                blockEntity.readFromNBT(this.data);
            } else {
                blockEntity.onDataPacket(client.getConnection().getNetworkManager(), new SPacketUpdateTileEntity(this.pos, this.type, this.data));
            }
            if (commandBlock && client.currentScreen instanceof GuiCommandBlock) {
                ((GuiCommandBlock) client.currentScreen).updateGui();
            }
        }
    }
}
项目:Resilience-Client-Source    文件:BlockBeacon.java   
/**
 * Called upon block activation (right click on the block.)
 */
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
    if (p_149727_1_.isClient)
    {
        return true;
    }
    else
    {
        TileEntityBeacon var10 = (TileEntityBeacon)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_);

        if (var10 != null)
        {
            p_149727_5_.func_146104_a(var10);
        }

        return true;
    }
}
项目:Resilience-Client-Source    文件:ContainerBeacon.java   
public ContainerBeacon(InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon)
{
    this.theBeacon = par2TileEntityBeacon;
    this.addSlotToContainer(this.beaconSlot = new ContainerBeacon.BeaconSlot(par2TileEntityBeacon, 0, 136, 110));
    byte var3 = 36;
    short var4 = 137;
    int var5;

    for (var5 = 0; var5 < 3; ++var5)
    {
        for (int var6 = 0; var6 < 9; ++var6)
        {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18));
        }
    }

    for (var5 = 0; var5 < 9; ++var5)
    {
        this.addSlotToContainer(new Slot(par1InventoryPlayer, var5, var3 + var5 * 18, 58 + var4));
    }

    this.field_82865_g = par2TileEntityBeacon.func_145998_l();
    this.field_82867_h = par2TileEntityBeacon.func_146007_j();
    this.field_82868_i = par2TileEntityBeacon.func_146006_k();
}
项目:Resilience-Client-Source    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityRendererPiston());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new RenderEndPortal());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    Iterator var1 = this.mapSpecialRenderers.values().iterator();

    while (var1.hasNext())
    {
        TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next();
        var2.func_147497_a(this);
    }
}
项目:ExpandedRailsMod    文件:BlockBeacon.java   
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 TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.addStat(StatList.BEACON_INTERACTION);
        }

        return true;
    }
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
        else
        {
            tileentity.onDataPacket(netManager, packetIn);
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
项目:ExpandedRailsMod    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityEndGateway.class, new TileEntityEndGatewayRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());
    this.mapSpecialRenderers.put(TileEntityStructure.class, new TileEntityStructureRenderer());

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
项目:ExpandedRailsMod    文件:TileEntityBeaconRenderer.java   
public void renderBeacon(double p_188206_1_, double p_188206_3_, double p_188206_5_, double p_188206_7_, double p_188206_9_, List<TileEntityBeacon.BeamSegment> p_188206_11_, double p_188206_12_)
{
    GlStateManager.alphaFunc(516, 0.1F);
    this.bindTexture(TEXTURE_BEACON_BEAM);

    if (p_188206_9_ > 0.0D)
    {
        GlStateManager.disableFog();
        int i = 0;

        for (int j = 0; j < p_188206_11_.size(); ++j)
        {
            TileEntityBeacon.BeamSegment tileentitybeacon$beamsegment = (TileEntityBeacon.BeamSegment)p_188206_11_.get(j);
            renderBeamSegment(p_188206_1_, p_188206_3_, p_188206_5_, p_188206_7_, p_188206_9_, p_188206_12_, i, tileentitybeacon$beamsegment.getHeight(), tileentitybeacon$beamsegment.getColors());
            i += tileentitybeacon$beamsegment.getHeight();
        }

        GlStateManager.enableFog();
    }
}
项目:Cauldron    文件:EntityPlayerMP.java   
public void func_146104_a(TileEntityBeacon p_146104_1_)
{
    // CraftBukkit start - Inventory open hook
    Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerBeacon(this.inventory, p_146104_1_));

    if (container == null)
    {
        p_146104_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, 7, p_146104_1_.getInventoryName(), p_146104_1_.getSizeInventory(), p_146104_1_.hasCustomInventoryName()));
    this.openContainer = container; // CraftBukkit - Use container we passed to event
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
项目:Cauldron    文件:BlockBeacon.java   
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
    if (p_149727_1_.isRemote)
    {
        return true;
    }
    else
    {
        TileEntityBeacon tileentitybeacon = (TileEntityBeacon)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_);

        if (tileentitybeacon != null)
        {
            p_149727_5_.func_146104_a(tileentitybeacon);
        }

        return true;
    }
}
项目:Cauldron    文件:ContainerBeacon.java   
public ContainerBeacon(InventoryPlayer p_i1802_1_, TileEntityBeacon p_i1802_2_)
{
    player = p_i1802_1_; // CraftBukkit
    this.tileBeacon = p_i1802_2_;
    this.addSlotToContainer(this.beaconSlot = new ContainerBeacon.BeaconSlot(p_i1802_2_, 0, 136, 110));
    byte b0 = 36;
    short short1 = 137;
    int i;

    for (i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(p_i1802_1_, j + i * 9 + 9, b0 + j * 18, short1 + i * 18));
        }
    }

    for (i = 0; i < 9; ++i)
    {
        this.addSlotToContainer(new Slot(p_i1802_1_, i, b0 + i * 18, 58 + short1));
    }

    this.field_82865_g = p_i1802_2_.getLevels();
    this.field_82867_h = p_i1802_2_.getPrimaryEffect();
    this.field_82868_i = p_i1802_2_.getSecondaryEffect();
}
项目:Cauldron    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityRendererPiston());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new RenderEndPortal());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    Iterator iterator = this.mapSpecialRenderers.values().iterator();

    while (iterator.hasNext())
    {
        TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)iterator.next();
        tileentityspecialrenderer.func_147497_a(this);
    }
}
项目:Cauldron    文件:BlockBeacon.java   
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
    if (p_149727_1_.isRemote)
    {
        return true;
    }
    else
    {
        TileEntityBeacon tileentitybeacon = (TileEntityBeacon)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_);

        if (tileentitybeacon != null)
        {
            p_149727_5_.func_146104_a(tileentitybeacon);
        }

        return true;
    }
}
项目:Cauldron    文件:ContainerBeacon.java   
public ContainerBeacon(InventoryPlayer p_i1802_1_, TileEntityBeacon p_i1802_2_)
{
    this.tileBeacon = p_i1802_2_;
    this.addSlotToContainer(this.beaconSlot = new ContainerBeacon.BeaconSlot(p_i1802_2_, 0, 136, 110));
    byte b0 = 36;
    short short1 = 137;
    int i;

    for (i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(p_i1802_1_, j + i * 9 + 9, b0 + j * 18, short1 + i * 18));
        }
    }

    for (i = 0; i < 9; ++i)
    {
        this.addSlotToContainer(new Slot(p_i1802_1_, i, b0 + i * 18, 58 + short1));
    }

    this.field_82865_g = p_i1802_2_.getLevels();
    this.field_82867_h = p_i1802_2_.getPrimaryEffect();
    this.field_82868_i = p_i1802_2_.getSecondaryEffect();
}
项目:Cauldron    文件:TileEntityRendererDispatcher.java   
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityRendererPiston());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new RenderEndPortal());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    Iterator iterator = this.mapSpecialRenderers.values().iterator();

    while (iterator.hasNext())
    {
        TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)iterator.next();
        tileentityspecialrenderer.func_147497_a(this);
    }
}
项目:RuneCraftery    文件:ContainerBeacon.java   
public ContainerBeacon(InventoryPlayer p_i1802_1_, TileEntityBeacon p_i1802_2_) {
   this.field_82866_e = p_i1802_2_;
   this.func_75146_a(this.field_82864_f = new SlotBeacon(this, p_i1802_2_, 0, 136, 110));
   byte var3 = 36;
   short var4 = 137;

   int var5;
   for(var5 = 0; var5 < 3; ++var5) {
      for(int var6 = 0; var6 < 9; ++var6) {
         this.func_75146_a(new Slot(p_i1802_1_, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18));
      }
   }

   for(var5 = 0; var5 < 9; ++var5) {
      this.func_75146_a(new Slot(p_i1802_1_, var5, var3 + var5 * 18, 58 + var4));
   }

   this.field_82865_g = p_i1802_2_.func_82130_k();
   this.field_82867_h = p_i1802_2_.func_82126_i();
   this.field_82868_i = p_i1802_2_.func_82132_j();
}
项目:RuneCraftery    文件:TileEntityRenderer.java   
private TileEntityRenderer() {
   this.field_76966_m.put(TileEntitySign.class, new TileEntitySignRenderer());
   this.field_76966_m.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
   this.field_76966_m.put(TileEntityPiston.class, new TileEntityRendererPiston());
   this.field_76966_m.put(TileEntityChest.class, new TileEntityChestRenderer());
   this.field_76966_m.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
   this.field_76966_m.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable());
   this.field_76966_m.put(TileEntityEndPortal.class, new RenderEndPortal());
   this.field_76966_m.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
   this.field_76966_m.put(TileEntitySkull.class, new TileEntitySkullRenderer());
   Iterator var1 = this.field_76966_m.values().iterator();

   while(var1.hasNext()) {
      TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next();
      var2.func_76893_a(this);
   }

}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72468_a(Packet132TileEntityData p_72468_1_) {
   if(this.field_72563_h.field_71441_e.func_72899_e(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c)) {
      TileEntity var2 = this.field_72563_h.field_71441_e.func_72796_p(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c);
      if(var2 != null) {
         if(p_72468_1_.field_73330_d == 1 && var2 instanceof TileEntityMobSpawner) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         } else if(p_72468_1_.field_73330_d == 2 && var2 instanceof TileEntityCommandBlock) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         } else if(p_72468_1_.field_73330_d == 3 && var2 instanceof TileEntityBeacon) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         } else if(p_72468_1_.field_73330_d == 4 && var2 instanceof TileEntitySkull) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         }
      }
   }

}
项目:RuneCraftery    文件:BlockBeacon.java   
/**
 * Called upon block activation (right click on the block.)
 */
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
    if (par1World.isRemote)
    {
        return true;
    }
    else
    {
        TileEntityBeacon tileentitybeacon = (TileEntityBeacon)par1World.getBlockTileEntity(par2, par3, par4);

        if (tileentitybeacon != null)
        {
            par5EntityPlayer.displayGUIBeacon(tileentitybeacon);
        }

        return true;
    }
}
项目:RuneCraftery    文件:ContainerBeacon.java   
public ContainerBeacon(InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon)
{
    this.theBeacon = par2TileEntityBeacon;
    this.addSlotToContainer(this.beaconSlot = new SlotBeacon(this, par2TileEntityBeacon, 0, 136, 110));
    byte b0 = 36;
    short short1 = 137;
    int i;

    for (i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, b0 + j * 18, short1 + i * 18));
        }
    }

    for (i = 0; i < 9; ++i)
    {
        this.addSlotToContainer(new Slot(par1InventoryPlayer, i, b0 + i * 18, 58 + short1));
    }

    this.field_82865_g = par2TileEntityBeacon.getLevels();
    this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect();
    this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect();
}
项目:RuneCraftery    文件:TileEntityRenderer.java   
private TileEntityRenderer()
{
    this.specialRendererMap.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.specialRendererMap.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.specialRendererMap.put(TileEntityPiston.class, new TileEntityRendererPiston());
    this.specialRendererMap.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.specialRendererMap.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.specialRendererMap.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable());
    this.specialRendererMap.put(TileEntityEndPortal.class, new RenderEndPortal());
    this.specialRendererMap.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.specialRendererMap.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    Iterator iterator = this.specialRendererMap.values().iterator();

    while (iterator.hasNext())
    {
        TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)iterator.next();
        tileentityspecialrenderer.setTileEntityRenderer(this);
    }
}
项目:BetterNutritionMod    文件:BlockBeacon.java   
/**
 * Called upon block activation (right click on the block.)
 */
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
    if (par1World.isRemote)
    {
        return true;
    }
    else
    {
        TileEntityBeacon tileentitybeacon = (TileEntityBeacon)par1World.getBlockTileEntity(par2, par3, par4);

        if (tileentitybeacon != null)
        {
            par5EntityPlayer.displayGUIBeacon(tileentitybeacon);
        }

        return true;
    }
}