From c918a1b6d8008773e9beebb48ba1a770405aee20 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 22 Aug 2019 19:54:41 -0400 Subject: Bulk update back to sanity --- .../tileentities/TileEntityCrystal.java | 16 +-- .../tileentities/TileEntityCrystalStand.java | 6 +- .../fyresmodjam/tileentities/TileEntityPillar.java | 147 +++++++-------------- .../fyresmodjam/tileentities/TileEntityTrap.java | 97 ++++---------- .../renderers/TileEntityCrystalRenderer.java | 38 ++---- .../renderers/TileEntityCrystalStandRenderer.java | 20 +-- .../renderers/TileEntityPillarRenderer.java | 31 ++--- .../renderers/TileEntityTrapRenderer.java | 48 ++----- 8 files changed, 120 insertions(+), 283 deletions(-) (limited to 'YWD/src/main/java/fyresmodjam/tileentities') diff --git a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystal.java b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystal.java index 3960f45..e5d2cbd 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystal.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystal.java @@ -20,13 +20,9 @@ public class TileEntityCrystal extends TileEntity { super.updateEntity(); if (random.nextInt(4) == 0) { - worldObj.spawnParticle( - ItemCrystal.particleNames[getBlockMetadata() - % ItemCrystal.particleNames.length], - xCoord + random.nextFloat(), - yCoord + random.nextFloat(), - zCoord + random.nextFloat(), 0.0f, - 0.0f, 0.0f); + worldObj.spawnParticle(ItemCrystal.particleNames[getBlockMetadata() % ItemCrystal.particleNames.length], + xCoord + random.nextFloat(), yCoord + random.nextFloat(), zCoord + random.nextFloat(), 0.0f, 0.0f, + 0.0f); } } @@ -44,13 +40,11 @@ public class TileEntityCrystal extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, tag); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); } @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity pkt) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); } } diff --git a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystalStand.java b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystalStand.java index e0ce64e..d32d0f3 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystalStand.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityCrystalStand.java @@ -29,13 +29,11 @@ public class TileEntityCrystalStand extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, tag); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); } @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity pkt) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); } } diff --git a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityPillar.java b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityPillar.java index bf36e06..530731b 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityPillar.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityPillar.java @@ -18,79 +18,45 @@ import net.minecraft.world.EnumSkyBlock; public class TileEntityPillar extends TileEntity { /* * @formatter:off - - public static String[] validBlessings = { - "Miner", - "Lumberjack", - "Warrior", - "Hunter", - "Swamp", - "Thief", - "Ninja", - "Mechanic", - "Alchemist", - "Scout", - "Guardian", - "Vampire", - "Inferno", - "Diver", - "Berserker", - "Loner", - "Paratrooper", - "Porcupine", - "Looter", - "Scholar", - "Thick-Skinned" - }; - - public static String[] validMobBlessings = { - "Warrior", - "Hunter", - "Swamp", - "Guardian", - "Vampire", - "Inferno", - "Loner", - "Paratrooper", - "Porcupine", - "Thick-Skinned" - }; - - public static String[] blessingDescriptions = { - "+25% breaking speed on stone and iron blocks, and +20% damage with pickaxes", - "+25% breaking speed on wooden blocks, and +15% damage with axes", - "+20% melee damage", - "+20% projectile damage", - "Attacks will slow enemies", - "Enemies have a chance to drop gold nuggets", - "While sneaking, you are invisble, and attacks on enemies with full health" - + " do double damage", - "@@\u00A7ePASSIVE - \u00A7oYou disarm traps 3x as often and have" - + " 2x the chance to salvage disarmed traps" - + ".@@\u00A7eACTIVE - \u00A7oOnce per day, you may disarm and" - + " salvage target trap for free", - "All potions act like wildcard potions", - "You can see traps without sneaking, but take 25% more damage from traps", - "Take 20% less damage from all sources", - "Heal 7% of damage dealt to enemies and, in direct sunlight," - + " you take 20% more damage and deal 20% less damage", - "You don't take fire damage and do +35% damage while on fire," - + " but take damage when wet", - "You can breathe underwater", - "@@\u00A7ePASSIVE - \u00A7oKills are added as berserk charges. (10 max)" - + "@@\u00A7eACTIVE - \u00A7o" - + "Turn on/off berserk mode. While berserk mode is active," - + " you do 30% more damage," - + " and expend a counter every 2 seconds", - "The lower your health, the higher your damage, to a maximum of +35%", - "You don't take fall damage", - "Melee attackers take received damage", - "Enemies have a chance to drop dungeon loot", - "Do bonus damage with weapons you are familiar with, and" - + " against enemies you are familiar with", - "Reduce damage taken by 2 points (1 heart)" }; - - + * + * public static String[] validBlessings = { "Miner", "Lumberjack", "Warrior", + * "Hunter", "Swamp", "Thief", "Ninja", "Mechanic", "Alchemist", "Scout", + * "Guardian", "Vampire", "Inferno", "Diver", "Berserker", "Loner", + * "Paratrooper", "Porcupine", "Looter", "Scholar", "Thick-Skinned" }; + * + * public static String[] validMobBlessings = { "Warrior", "Hunter", "Swamp", + * "Guardian", "Vampire", "Inferno", "Loner", "Paratrooper", "Porcupine", + * "Thick-Skinned" }; + * + * public static String[] blessingDescriptions = { + * "+25% breaking speed on stone and iron blocks, and +20% damage with pickaxes" + * , "+25% breaking speed on wooden blocks, and +15% damage with axes", + * "+20% melee damage", "+20% projectile damage", "Attacks will slow enemies", + * "Enemies have a chance to drop gold nuggets", + * "While sneaking, you are invisble, and attacks on enemies with full health" + + * " do double damage", + * "@@\u00A7ePASSIVE - \u00A7oYou disarm traps 3x as often and have" + + * " 2x the chance to salvage disarmed traps" + + * ".@@\u00A7eACTIVE - \u00A7oOnce per day, you may disarm and" + + * " salvage target trap for free", "All potions act like wildcard potions", + * "You can see traps without sneaking, but take 25% more damage from traps", + * "Take 20% less damage from all sources", + * "Heal 7% of damage dealt to enemies and, in direct sunlight," + + * " you take 20% more damage and deal 20% less damage", + * "You don't take fire damage and do +35% damage while on fire," + + * " but take damage when wet", "You can breathe underwater", + * "@@\u00A7ePASSIVE - \u00A7oKills are added as berserk charges. (10 max)" + + * "@@\u00A7eACTIVE - \u00A7o" + + * "Turn on/off berserk mode. While berserk mode is active," + + * " you do 30% more damage," + " and expend a counter every 2 seconds", + * "The lower your health, the higher your damage, to a maximum of +35%", + * "You don't take fall damage", "Melee attackers take received damage", + * "Enemies have a chance to drop dungeon loot", + * "Do bonus damage with weapons you are familiar with, and" + + * " against enemies you are familiar with", + * "Reduce damage taken by 2 points (1 heart)" }; + * + * * @formatter:on */ @@ -107,9 +73,7 @@ public class TileEntityPillar extends TileEntity { spawnParticles(); if (ConfigData.pillarGlow) { - worldObj.updateLightByType( - EnumSkyBlock.Block, xCoord, - yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); } } } @@ -118,24 +82,12 @@ public class TileEntityPillar extends TileEntity { public void spawnParticles() { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - if (player != null && BlessingUtils.hasBlessing(player) - && BlessingUtils.hasBlessing(player, - blessing)) { + if (player != null && BlessingUtils.hasBlessing(player) && BlessingUtils.hasBlessing(player, blessing)) { for (int i = 0; i < 2; i++) { - worldObj.spawnParticle("portal", xCoord - + ModjamMod.r.nextDouble(), - yCoord + ModjamMod.r - .nextDouble() - * 2, - zCoord + ModjamMod.r - .nextDouble(), - (ModjamMod.r.nextDouble() - - 0.5D) - * 2.0D, - -ModjamMod.r.nextDouble(), - (ModjamMod.r.nextDouble() - - 0.5D) - * 2.0D); + worldObj.spawnParticle("portal", xCoord + ModjamMod.r.nextDouble(), + yCoord + ModjamMod.r.nextDouble() * 2, zCoord + ModjamMod.r.nextDouble(), + (ModjamMod.r.nextDouble() - 0.5D) * 2.0D, -ModjamMod.r.nextDouble(), + (ModjamMod.r.nextDouble() - 0.5D) * 2.0D); } } } @@ -152,8 +104,7 @@ public class TileEntityPillar extends TileEntity { @Override public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); - blessing = par1NBTTagCompound.hasKey("Blessing") - ? par1NBTTagCompound.getString("Blessing") + blessing = par1NBTTagCompound.hasKey("Blessing") ? par1NBTTagCompound.getString("Blessing") : BlessingUtils.getPlayerBlessing(); } @@ -161,13 +112,11 @@ public class TileEntityPillar extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, tag); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); } @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity pkt) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); } diff --git a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityTrap.java b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityTrap.java index 2353adb..9122f38 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/TileEntityTrap.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/TileEntityTrap.java @@ -17,15 +17,11 @@ import net.minecraft.util.AxisAlignedBB; public class TileEntityTrap extends TileEntity { - public static String[] settings = { - "invisible to and damages all but player", - "visible to all and damages all but player", - "visible to all and only damages mobs", - "decorative" - }; + public static String[] settings = { "invisible to and damages all but player", + "visible to all and damages all but player", "visible to all and only damages mobs", "decorative" }; - public String placedBy = null; - public int setting = 0; + public String placedBy = null; + public int setting = 0; public TileEntityTrap() { } @@ -46,8 +42,7 @@ public class TileEntityTrap extends TileEntity { if (placedBy != null) { par1NBTTagCompound.setString("PlacedBy", placedBy); } - par1NBTTagCompound.setInteger("Setting", - setting % settings.length); + par1NBTTagCompound.setInteger("Setting", setting % settings.length); } @Override @@ -55,15 +50,13 @@ public class TileEntityTrap extends TileEntity { super.readFromNBT(par1NBTTagCompound); if (par1NBTTagCompound.hasKey("PlacedBy")) { - placedBy = par1NBTTagCompound - .getString("PlacedBy"); + placedBy = par1NBTTagCompound.getString("PlacedBy"); } else { placedBy = null; } if (par1NBTTagCompound.hasKey("Setting")) { - setting = par1NBTTagCompound.getInteger("Setting") - % settings.length; + setting = par1NBTTagCompound.getInteger("Setting") % settings.length; } } @@ -71,13 +64,11 @@ public class TileEntityTrap extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); - return new S35PacketUpdateTileEntity(xCoord, yCoord, - zCoord, 1, tag); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); } @Override - public void onDataPacket(NetworkManager net, - S35PacketUpdateTileEntity pkt) { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); } @@ -91,70 +82,34 @@ public class TileEntityTrap extends TileEntity { @SideOnly(Side.CLIENT) public double getMaxRenderDistanceSquared() { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - return (player != null && (player.getCommandSenderName() - .equals(placedBy) || setting != 0)) - ? 4096.0F - : 36.0F; + return (player != null && (player.getCommandSenderName().equals(placedBy) || setting != 0)) ? 4096.0F : 36.0F; } @SideOnly(Side.CLIENT) public void spawnParticles() { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - int type = worldObj.getBlockMetadata(xCoord, yCoord, - zCoord); - - if (player != null - && (!NewPacketHandler.trapsDisabled - || placedBy != null) - && (player.getCommandSenderName() - .equals(placedBy) - || player.isSneaking() - || setting != 0 - || (BlessingUtils - .hasBlessing(player, - "MarkScouting"))) - && getDistanceFrom( - TileEntityRendererDispatcher.staticPlayerX, + int type = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + + if (player != null && (!NewPacketHandler.trapsDisabled || placedBy != null) + && (player.getCommandSenderName().equals(placedBy) || player.isSneaking() || setting != 0 + || (BlessingUtils.hasBlessing(player, "MarkScouting"))) + && getDistanceFrom(TileEntityRendererDispatcher.staticPlayerX, TileEntityRendererDispatcher.staticPlayerY, - TileEntityRendererDispatcher.staticPlayerZ) < (player - .getCommandSenderName() - .equals(placedBy) - ? 4096 - : 36.0F)) { + TileEntityRendererDispatcher.staticPlayerZ) < (player.getCommandSenderName().equals(placedBy) + ? 4096 + : 36.0F)) { if (type == 1) { if (ModjamMod.r.nextInt(5) == 0) { - worldObj.spawnParticle("smoke", - xCoord + 0.5F, - yCoord + 0.175F, - zCoord + 0.5F, - (ModjamMod.r.nextFloat() - - 0.5F) - / 16, - ModjamMod.r.nextFloat() - / 16, - (ModjamMod.r.nextFloat() - - 0.5F) - / 16); + worldObj.spawnParticle("smoke", xCoord + 0.5F, yCoord + 0.175F, zCoord + 0.5F, + (ModjamMod.r.nextFloat() - 0.5F) / 16, ModjamMod.r.nextFloat() / 16, + (ModjamMod.r.nextFloat() - 0.5F) / 16); } - worldObj.spawnParticle("flame", - xCoord + 0.5F, - yCoord + 0.175F, - zCoord + 0.5F, 0.0F, 0.0F, - 0.0F); + worldObj.spawnParticle("flame", xCoord + 0.5F, yCoord + 0.175F, zCoord + 0.5F, 0.0F, 0.0F, 0.0F); } else if (type == 2) { for (int i = 0; i < 3; i++) { - worldObj.spawnParticle("smoke", - xCoord + 0.5F, - yCoord + 0.175F, - zCoord + 0.5F, - (ModjamMod.r.nextFloat() - - 0.5F) - / 16, - ModjamMod.r.nextFloat() - / 16, - (ModjamMod.r.nextFloat() - - 0.5F) - / 16); + worldObj.spawnParticle("smoke", xCoord + 0.5F, yCoord + 0.175F, zCoord + 0.5F, + (ModjamMod.r.nextFloat() - 0.5F) / 16, ModjamMod.r.nextFloat() / 16, + (ModjamMod.r.nextFloat() - 0.5F) / 16); } } } diff --git a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalRenderer.java b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalRenderer.java index 7d64e51..91ecb23 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalRenderer.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalRenderer.java @@ -20,12 +20,10 @@ public class TileEntityCrystalRenderer extends TileEntitySpecialRenderer { private ModelCrystal modelCrystal = new ModelCrystal(); - public static ResourceLocation texture = new ResourceLocation( - "fyresmodjam", "textures/blocks/crystal.png"); + public static ResourceLocation texture = new ResourceLocation("fyresmodjam", "textures/blocks/crystal.png"); @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, - double d1, double d2, float f) { + public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) d0, (float) d1, (float) d2); @@ -34,37 +32,23 @@ public class TileEntityCrystalRenderer extends TileEntitySpecialRenderer { World world = crystal.getWorldObj(); Tessellator tessellator = Tessellator.instance; - float f2 = block.getMixedBrightnessForBlock(world, - crystal.xCoord, crystal.yCoord, - crystal.zCoord); - int l = world.getLightBrightnessForSkyBlocks( - crystal.xCoord, crystal.yCoord, - crystal.zCoord, 0); + float f2 = block.getMixedBrightnessForBlock(world, crystal.xCoord, crystal.yCoord, crystal.zCoord); + int l = world.getLightBrightnessForSkyBlocks(crystal.xCoord, crystal.yCoord, crystal.zCoord, 0); int l1 = l % 65536; int l2 = l / 65536; tessellator.setColorOpaque_F(f2, f2, f2); - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, l1, l2); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, l1, l2); - float f3 = world.getWorldInfo().getWorldTime() % 20 - / 20.0F; - GL11.glTranslatef(0.5F, - -0.4F + (f3 > 0.5F ? 0.25F - 0.25F * f3 - : 0.25F * f3), - 0.5F); + float f3 = world.getWorldInfo().getWorldTime() % 20 / 20.0F; + GL11.glTranslatef(0.5F, -0.4F + (f3 > 0.5F ? 0.25F - 0.25F * f3 : 0.25F * f3), 0.5F); - GL11.glRotatef((float) world.getWorldInfo().getWorldTime() - % 360, 0.0F, 1.0F, 0.0F); + GL11.glRotatef((float) world.getWorldInfo().getWorldTime() % 360, 0.0F, 1.0F, 0.0F); - Color color = ItemCrystal.colors[crystal.getBlockMetadata() - % ItemCrystal.colors.length]; - GL11.glColor3f(color.getRed() / 255.0F, - color.getGreen() / 255.0F, - color.getBlue() / 255.0F); + Color color = ItemCrystal.colors[crystal.getBlockMetadata() % ItemCrystal.colors.length]; + GL11.glColor3f(color.getRed() / 255.0F, color.getGreen() / 255.0F, color.getBlue() / 255.0F); bindTexture(texture); - modelCrystal.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, - 0.0625F); + modelCrystal.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } diff --git a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalStandRenderer.java b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalStandRenderer.java index 55873f9..cacafee 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalStandRenderer.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalStandRenderer.java @@ -13,18 +13,14 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -public class TileEntityCrystalStandRenderer - extends TileEntitySpecialRenderer { +public class TileEntityCrystalStandRenderer extends TileEntitySpecialRenderer { private ModelCrystalStand model = new ModelCrystalStand(); - public static ResourceLocation texture = new ResourceLocation( - "fyresmodjam", - "textures/blocks/crystal_stand.png"); + public static ResourceLocation texture = new ResourceLocation("fyresmodjam", "textures/blocks/crystal_stand.png"); @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, - double d1, double d2, float f) { + public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) d0, (float) d1, (float) d2); @@ -33,17 +29,13 @@ public class TileEntityCrystalStandRenderer World world = crystalStand.getWorldObj(); Tessellator tessellator = Tessellator.instance; - float f2 = block.getMixedBrightnessForBlock(world, - crystalStand.xCoord, crystalStand.yCoord, + float f2 = block.getMixedBrightnessForBlock(world, crystalStand.xCoord, crystalStand.yCoord, crystalStand.zCoord); - int l = world.getLightBrightnessForSkyBlocks( - crystalStand.xCoord, crystalStand.yCoord, - crystalStand.zCoord, 0); + int l = world.getLightBrightnessForSkyBlocks(crystalStand.xCoord, crystalStand.yCoord, crystalStand.zCoord, 0); int l1 = l % 65536; int l2 = l / 65536; tessellator.setColorOpaque_F(f2, f2, f2); - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, l1, l2); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, l1, l2); GL11.glTranslatef(0.5F, 1.5F, 0.5F); GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); diff --git a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityPillarRenderer.java b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityPillarRenderer.java index 7d38d20..38826df 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityPillarRenderer.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityPillarRenderer.java @@ -19,43 +19,31 @@ import net.minecraft.world.World; public class TileEntityPillarRenderer extends TileEntitySpecialRenderer { private ModelPillar modelPillar = new ModelPillar(); - public static ResourceLocation[] textures = { - new ResourceLocation("fyresmodjam", - "textures/blocks/pillar.png"), - new ResourceLocation("fyresmodjam", - "textures/blocks/pillarActive.png") - }; + public static ResourceLocation[] textures = { new ResourceLocation("fyresmodjam", "textures/blocks/pillar.png"), + new ResourceLocation("fyresmodjam", "textures/blocks/pillarActive.png") }; @Override - public void renderTileEntityAt(TileEntity tileEntity, double d, - double d1, double d2, float f) { + public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); TileEntityPillar tileEntityYour = (TileEntityPillar) tileEntity; - renderBlockYour(tileEntityYour, tileEntity.getWorldObj(), - tileEntity.xCoord, tileEntity.yCoord, + renderBlockYour(tileEntityYour, tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, ModjamMod.blockPillar); GL11.glPopMatrix(); } - public void renderBlockYour(TileEntityPillar tl, World world, - int i, int j, int k, Block block) { + public void renderBlockYour(TileEntityPillar tl, World world, int i, int j, int k, Block block) { Tessellator tessellator = Tessellator.instance; float f = block.getMixedBrightnessForBlock(world, i, j, k); int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int l1 = l % 65536; int l2 = l / 65536; tessellator.setColorOpaque_F(f, f, f); - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, l1, l2); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, l1, l2); EntityPlayer player = Minecraft.getMinecraft().thePlayer; - boolean active = player != null - && player.getEntityData() - .hasKey("Blessing") - && player.getEntityData() - .getString("Blessing") - .equals(tl.blessing); + boolean active = player != null && player.getEntityData().hasKey("Blessing") + && player.getEntityData().getString("Blessing").equals(tl.blessing); GL11.glPushMatrix(); @@ -63,8 +51,7 @@ public class TileEntityPillarRenderer extends TileEntitySpecialRenderer { GL11.glTranslatef(0.5F, -1.5F, -0.5F); bindTexture(!active ? textures[0] : textures[1]); - modelPillar.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, - 0.0F, 0.0625F); + modelPillar.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } } \ No newline at end of file diff --git a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityTrapRenderer.java b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityTrapRenderer.java index c66f06a..7ffe43d 100755 --- a/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityTrapRenderer.java +++ b/YWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityTrapRenderer.java @@ -22,56 +22,36 @@ import net.minecraft.world.World; public class TileEntityTrapRenderer extends TileEntitySpecialRenderer { - private ModelBase[] models = { - new ModelSpikes(), new ModelTrap2(), - new ModelTrap2() - }; + private ModelBase[] models = { new ModelSpikes(), new ModelTrap2(), new ModelTrap2() }; - public static ResourceLocation[] textures = { - new ResourceLocation("fyresmodjam", - "textures/blocks/spikes.png"), - new ResourceLocation("fyresmodjam", - "textures/blocks/trap2.png"), - new ResourceLocation("fyresmodjam", - "textures/blocks/trap3.png") - }; + public static ResourceLocation[] textures = { new ResourceLocation("fyresmodjam", "textures/blocks/spikes.png"), + new ResourceLocation("fyresmodjam", "textures/blocks/trap2.png"), + new ResourceLocation("fyresmodjam", "textures/blocks/trap3.png") }; @Override - public void renderTileEntityAt(TileEntity tileEntity, double d, - double d1, double d2, float f) { + public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); TileEntityTrap tileEntityYour = (TileEntityTrap) tileEntity; - renderBlockYour(tileEntityYour, tileEntity.getWorldObj(), - tileEntity.xCoord, tileEntity.yCoord, + renderBlockYour(tileEntityYour, tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, ModjamMod.blockTrap); GL11.glPopMatrix(); } - public void renderBlockYour(TileEntityTrap tl, World world, int i, - int j, int k, Block block) { + public void renderBlockYour(TileEntityTrap tl, World world, int i, int j, int k, Block block) { Tessellator tessellator = Tessellator.instance; float f = block.getMixedBrightnessForBlock(world, i, j, k); int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int l1 = l % 65536; int l2 = l / 65536; tessellator.setColorOpaque_F(f, f, f); - OpenGlHelper.setLightmapTextureCoords( - OpenGlHelper.lightmapTexUnit, l1, l2); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, l1, l2); EntityPlayer player = Minecraft.getMinecraft().thePlayer; - boolean active = player != null - && (!NewPacketHandler.trapsDisabled - || tl.placedBy != null) - && (player.getCommandSenderName() - .equals(tl.placedBy) - || tl.setting != 0 - || player.isSneaking() - || (player.getEntityData() - .hasKey("Blessing") - && player.getEntityData() - .getString("Blessing") - .equals("Scout"))); + boolean active = player != null && (!NewPacketHandler.trapsDisabled || tl.placedBy != null) + && (player.getCommandSenderName().equals(tl.placedBy) || tl.setting != 0 || player.isSneaking() + || (player.getEntityData().hasKey("Blessing") + && player.getEntityData().getString("Blessing").equals("Scout"))); int type = world.getBlockMetadata(i, j, k); @@ -82,9 +62,7 @@ public class TileEntityTrapRenderer extends TileEntitySpecialRenderer { GL11.glTranslatef(0.5F, -1.5F, -0.5F); bindTexture(textures[type % BlockTrap.trapTypes]); - models[type % BlockTrap.trapTypes].render( - (Entity) null, 0.0F, 0.0F, 0.0F, - 0.0F, 0.0F, 0.0625F); + models[type % BlockTrap.trapTypes].render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } -- cgit v1.2.3