diff options
Diffstat (limited to 'eclipse/Jewelrycraft/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java')
| -rw-r--r-- | eclipse/Jewelrycraft/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/eclipse/Jewelrycraft/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java b/eclipse/Jewelrycraft/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java index 8957ce4..b7acffc 100644 --- a/eclipse/Jewelrycraft/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java +++ b/eclipse/Jewelrycraft/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java @@ -14,6 +14,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @@ -57,14 +58,14 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer renderLabel(Integer.toString(disp.quantity), 0F, (-0.171F)*ind, 0F, block, disp, Color.GRAY.getRGB()); GL11.glPopMatrix(); ind++; - if(!(disp.object.getItem() instanceof ItemMap) && disp.object != null && disp.object != new ItemStack(Item.getItemById(0), 0, 0) && disp.object.getTooltip(null, true) != null) + if(!(disp.object.getItem() instanceof ItemMap) && disp.object != null && disp.object != new ItemStack(Item.getItemById(0), 0, 0) && disp.object.getTooltip(te.getWorldObj().getClosestPlayer(x, y, z, 2D), true) != null) { - for(int i = 1; i < disp.object.getTooltip(new FakePlayer((WorldServer) te.getWorldObj(), new GameProfile("0", "Player")), true).size(); i++) + for(int i = 1; i < disp.object.getTooltip(te.getWorldObj().getClosestPlayer(x, y, z, 2D), true).size(); i++) { - if(disp.object.getTooltip(new FakePlayer((WorldServer) te.getWorldObj(), new GameProfile("0", "Player")), true).get(i).toString() != "") + if(disp.object.getTooltip(te.getWorldObj().getClosestPlayer(x, y, z, 2D), true).get(i).toString() != "") { GL11.glPushMatrix(); - renderLabel(disp.object.getTooltip(new FakePlayer((WorldServer) te.getWorldObj(), new GameProfile("0", "Player")), true).get(i).toString(), 0F, (-0.171F)*ind, 0F, block, disp, Color.GRAY.getRGB()); + renderLabel(disp.object.getTooltip(te.getWorldObj().getClosestPlayer(x, y, z, 2D), true).get(i).toString(), 0F, (-0.171F)*ind, 0F, block, disp, Color.GRAY.getRGB()); GL11.glPopMatrix(); ind++; } @@ -140,7 +141,7 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glScalef(var17*70F, 1F, 0F); - fontrenderer.drawString(par2Str.replaceFirst("§0", "§r").replaceFirst("§1", "§r").replaceFirst("§2", "§r").replaceFirst("§3", "§r").replaceFirst("§4", "§r").replaceFirst("§5", "§r").replaceFirst("§6", "§r").replaceFirst("§7", "§r").replaceFirst("§8", "§r").replaceFirst("§9", "§r").replaceFirst("§a", "§r").replaceFirst("§b", "§r").replaceFirst("§c", "§r").replaceFirst("§d", "§r").replaceFirst("§e", "§r").replaceFirst("§f", "§r"), -j, 0, 65536 * (red/2) + 256 * (green/2) + blue/2); + fontrenderer.drawString(par2Str.replaceFirst("§0", "§r").replaceFirst("§1", "§r").replaceFirst("§2", "§r").replaceFirst("§3", "§r").replaceFirst("§4", "§r").replaceFirst("§5", "§r").replaceFirst("§6", "§r").replaceFirst("§7", "§r").replaceFirst("§8", "§r").replaceFirst("§9", "§r").replaceFirst("§a", "§r").replaceFirst("§b", "§r").replaceFirst("§c", "§r").replaceFirst("§d", "§r").replaceFirst("§e", "§r").replaceFirst("§f", "§r"), -j, 0, 65536 * (red/2) + 256 * (green/2) + blue/2); GL11.glPopMatrix(); GL11.glTranslatef((float)x - 1f, (float)y - 1f, (float)z - 1F); GL11.glScalef(var17*70F, 1F, 0F); @@ -152,85 +153,85 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer public void replaceEnumEnchValues(String str, int color) { - if(str.contains("§0")) + if(str.contains("§0")) { color = Color.BLACK.getRGB(); - str.replace("§0", ""); + str.replace("§0", ""); } - if(str.contains("§1")) + if(str.contains("§1")) { color = 85; - str.replace("§1", ""); + str.replace("§1", ""); } - if(str.contains("§2")) + if(str.contains("§2")) { color = 17920; - str.replace("§2", ""); + str.replace("§2", ""); } - if(str.contains("§3")) + if(str.contains("§3")) { color = 1336183; - str.replace("§3", ""); + str.replace("§3", ""); } - if(str.contains("§4")) + if(str.contains("§4")) { color = 4587520; - str.replace("§4", ""); + str.replace("§4", ""); } - if(str.contains("§5")) + if(str.contains("§5")) { color = 5701759; - str.replace("§5", ""); + str.replace("§5", ""); } - if(str.contains("§6")) + if(str.contains("§6")) { color = 16762880; - str.replace("§6", ""); + str.replace("§6", ""); } - if(str.contains("§7")) + if(str.contains("§7")) { color = Color.GRAY.getRGB(); - str.replace("§7", ""); + str.replace("§7", ""); } - if(str.contains("§8")) + if(str.contains("§8")) { color = Color.DARK_GRAY.getRGB(); - str.replace("§8", ""); + str.replace("§8", ""); } - if(str.contains("§9")) + if(str.contains("§9")) { color = Color.BLUE.getRGB(); - str.replace("§9", ""); + str.replace("§9", ""); } - if(str.contains("§a")) + if(str.contains("§a")) { color = Color.GREEN.getRGB(); - str.replace("§a", ""); + str.replace("§a", ""); } - if(str.contains("§b")) + if(str.contains("§b")) { color = Color.CYAN.getRGB(); - str.replace("§b", ""); + str.replace("§b", ""); } - if(str.contains("§c")) + if(str.contains("§c")) { color = Color.RED.getRGB(); - str.replace("§c", ""); + str.replace("§c", ""); } - if(str.contains("§d")) + if(str.contains("§d")) { color = 11665663; - str.replace("§d", ""); + str.replace("§d", ""); } - if(str.contains("§e")) + if(str.contains("§e")) { color = Color.YELLOW.getRGB(); - str.replace("§e", ""); + str.replace("§e", ""); } - if(str.contains("§f")) + if(str.contains("§f")) { color = Color.WHITE.getRGB(); - str.replace("§f", ""); + str.replace("§f", ""); } } }
\ No newline at end of file |
