/** * Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data */ public boolean updateItemStackNBT(NBTTagCompound nbt) { super.updateItemStackNBT(nbt); if (nbt.hasKey("SkullOwner", 8) && nbt.getString("SkullOwner").length() > 0) { GameProfile gameprofile = new GameProfile((UUID)null, nbt.getString("SkullOwner")); gameprofile = TileEntitySkull.updateGameprofile(gameprofile); nbt.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); return true; } else { return false; } }
/** * 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()); } } }
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); } }
/** * 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()); } } }
private void registerBlockRenderers() { if (EtFuturum.enableSlimeBlock) RenderingRegistry.registerBlockHandler(new BlockSlimeBlockRender()); if (EtFuturum.enableDoors) RenderingRegistry.registerBlockHandler(new BlockDoorRenderer()); if (EtFuturum.enableBanners) ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBanner.class, new TileEntityBannerRenderer()); if (EtFuturum.enableFancySkulls) ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new TileEntityFancySkullRenderer()); if (EtFuturum.enableChorusFruit) { RenderingRegistry.registerBlockHandler(new BlockEndRodRender()); RenderingRegistry.registerBlockHandler(new BlockChorusFlowerRender()); RenderingRegistry.registerBlockHandler(new BlockChorusPlantRender()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEndRod.class, new TileEntityEndRodRenderer()); } if (EtFuturum.enableColourfulBeacons) ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNewBeacon.class, new TileEntityNewBeaconRenderer()); RenderingRegistry.registerBlockHandler(new BlockChestRenderer()); }
/** * 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(); } } }
/** * Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data */ public boolean updateItemStackNBT(NBTTagCompound nbt) { super.updateItemStackNBT(nbt); if (nbt.hasKey("SkullOwner", 8) && !StringUtils.isBlank(nbt.getString("SkullOwner"))) { GameProfile gameprofile = new GameProfile((UUID)null, nbt.getString("SkullOwner")); gameprofile = TileEntitySkull.updateGameprofile(gameprofile); nbt.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); return true; } else { return false; } }
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); } }
/** * Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data */ public boolean updateItemStackNBT(NBTTagCompound nbt) { super.updateItemStackNBT(nbt); if (nbt.hasKey("SkullOwner", 8) && !nbt.getString("SkullOwner").isEmpty()) { GameProfile gameprofile = new GameProfile((UUID)null, nbt.getString("SkullOwner")); gameprofile = TileEntitySkull.updateGameprofile(gameprofile); nbt.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); return true; } else { return false; } }
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); } }
@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(); } } } }
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { if (!p_149749_1_.isClient) { if ((p_149749_6_ & 8) == 0) { ItemStack var7 = new ItemStack(Items.skull, 1, this.getDamageValue(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); TileEntitySkull var8 = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); if (var8.func_145904_a() == 3 && var8.func_145907_c() != null && var8.func_145907_c().length() > 0) { var7.setTagCompound(new NBTTagCompound()); var7.getTagCompound().setString("SkullOwner", var8.func_145907_c()); } this.dropBlockAsItem_do(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, var7); } super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); } }
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); } }
@ScriptCallable(returnTypes = ReturnType.STRING) public String getType(TileEntitySkull skull) { int skullType = skull.func_145904_a(); switch (skullType) { case 0: return "skeleton"; case 1: return "wither_skeleton"; case 2: return "zombie"; case 3: return "player"; case 4: return "creeper"; } return "unknown"; }
public void doTheRenderThing(){ RenderingRegistry.registerEntityRenderingHandler(EntityFrankenstein.class, new RenderFrankenstein()); RenderingRegistry.registerEntityRenderingHandler(EntityWarhorse.class, new RenderWarhorse()); RenderingRegistry.registerEntityRenderingHandler(EntityPeep.class, new RenderPeep()); RenderingRegistry.registerEntityRenderingHandler(EntityUnicorn.class, new RenderUnicorn()); RenderingRegistry.registerEntityRenderingHandler(EntityCalavera.class, new RenderCalavera()); RenderingRegistry.registerEntityRenderingHandler(EntityGingerbread.class, new RenderGingerbread()); RenderingRegistry.registerEntityRenderingHandler(EntityShoggoth.class, new RenderShoggoth()); RenderingRegistry.registerEntityRenderingHandler(EntityDaySkeleton.class, new RenderSkeleton()); RenderingRegistry.registerEntityRenderingHandler(EntityDayZombie.class, new RenderZombie()); RenderingRegistry.registerEntityRenderingHandler(EntityShadowSlime.class, new RenderShadowSlime()); RenderingRegistry.registerEntityRenderingHandler(EntityCandySheep.class, new RenderCandySheep(new ModelSheep2(), new ModelSheep1(), 0.7F)); RenderingRegistry.registerEntityRenderingHandler(EntityOldEnderman.class, new RenderOldEnderman()); if(Config.heads && !Loader.isModLoaded("foxlib")){ TileEntityRendererDispatcher.instance.mapSpecialRenderers.remove(TileEntitySkull.class); BlockSkullRenderer blockSkullRenderer = new BlockSkullRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, blockSkullRenderer); } ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChestRidiculous.class, new RenderTileEntityChest()); BlockChestRidiculous.render = RenderingRegistry.getNextAvailableRenderId(); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RidiculousBlocks.chest), new RenderItemChest()); ShaderHelper.initShaders(); }
/** * 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(); } } }
@Override public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune) { ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); { if ((p_149749_6_ & 8) == 0) { ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); if (tileentityskull == null) return ret; if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null) { itemstack.setTagCompound(new NBTTagCompound()); NBTTagCompound nbttagcompound = new NBTTagCompound(); NBTUtil.func_152460_a(nbttagcompound, tileentityskull.func_152108_a()); itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound); } ret.add(itemstack); } } return ret; }
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); } }
public boolean CheckVisibleState(TileEntitySkull tileEntitySkull) { if (SkipSignCore.ModSetting.SkullVisible.Int() == 1) return true; if (SkipSignCore.ModSetting.SkullVisible.Int() == 2) return false; if (Keyboard.isKeyDown(SkipSignCore.ModSetting.Zoom_Key.Int())) return true; if (SkipSignHelper.IsInRangeToRenderDist( SkipSignHelper.GetDistancePlayerToTileEntity(tileEntitySkull), SkipSignCore.ModSetting.SkullRange.Int())) return true; return false; }
public void func_71852_a(World p_71852_1_, int p_71852_2_, int p_71852_3_, int p_71852_4_, int p_71852_5_, int p_71852_6_) { if(!p_71852_1_.field_72995_K) { if((p_71852_6_ & 8) == 0) { ItemStack var7 = new ItemStack(Item.field_82799_bQ.field_77779_bT, 1, this.func_71873_h(p_71852_1_, p_71852_2_, p_71852_3_, p_71852_4_)); TileEntitySkull var8 = (TileEntitySkull)p_71852_1_.func_72796_p(p_71852_2_, p_71852_3_, p_71852_4_); if(var8.func_82117_a() == 3 && var8.func_82120_c() != null && var8.func_82120_c().length() > 0) { var7.func_77982_d(new NBTTagCompound()); var7.func_77978_p().func_74778_a("SkullOwner", var8.func_82120_c()); } this.func_71929_a(p_71852_1_, p_71852_2_, p_71852_3_, p_71852_4_, var7); } super.func_71852_a(p_71852_1_, p_71852_2_, p_71852_3_, p_71852_4_, p_71852_5_, p_71852_6_); } }
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); } }
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); } } } }
@Override public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) { ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); if ((metadata & 8) == 0) { ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z)); TileEntitySkull tileentityskull = (TileEntitySkull)world.getBlockTileEntity(x, y, z); if (tileentityskull == null) { return drops; } if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) { itemstack.setTagCompound(new NBTTagCompound()); itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType()); } drops.add(itemstack); } return drops; }
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); } }
private static GameProfile readOwner(NBTTagCompound tag) { if (tag.hasKey("owner", Constants.NBT.TAG_STRING)) { String ownerName = tag.getString("owner"); return TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, ownerName)); } else if (tag.hasKey("OwnerUUID", Constants.NBT.TAG_STRING)) { final String uuidStr = tag.getString("OwnerUUID"); try { UUID uuid = UUID.fromString(uuidStr); return new GameProfile(uuid, null); } catch (IllegalArgumentException e) { Log.warn(e, "Failed to parse UUID: %s", uuidStr); } } else if (tag.hasKey("Owner", Constants.NBT.TAG_COMPOUND)) { return NBTUtil.readGameProfileFromNBT(tag.getCompoundTag("Owner")); } return null; }
@Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); if (nbt.hasKey("owner", Constants.NBT.TAG_STRING)) { String ownerName = nbt.getString("owner"); this.owner = TileEntitySkull.updateGameprofile(new GameProfile(null, ownerName)); } else if (nbt.hasKey("OwnerUUID", Constants.NBT.TAG_STRING)) { final String uuidStr = nbt.getString("OwnerUUID"); try { UUID uuid = UUID.fromString(uuidStr); this.owner = new GameProfile(uuid, null); } catch (IllegalArgumentException e) { Log.warn(e, "Failed to parse UUID: %s", uuidStr); } } else if (nbt.hasKey("Owner", Constants.NBT.TAG_COMPOUND)) { this.owner = NBTUtil.readGameProfileFromNBT(nbt.getCompoundTag("Owner")); } }