summaryrefslogtreecommitdiff
path: root/YWD/src/main/java/fyresmodjam/tileentities/renderers
diff options
context:
space:
mode:
Diffstat (limited to 'YWD/src/main/java/fyresmodjam/tileentities/renderers')
-rwxr-xr-xYWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalRenderer.java38
-rwxr-xr-xYWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityCrystalStandRenderer.java20
-rwxr-xr-xYWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityPillarRenderer.java31
-rwxr-xr-xYWD/src/main/java/fyresmodjam/tileentities/renderers/TileEntityTrapRenderer.java48
4 files changed, 39 insertions, 98 deletions
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();
}