From 33e231d26546d5cd275b314309d13e4ca223df9c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 20 Feb 2016 16:16:41 +0100 Subject: [PATCH] Fixed Canitz' mess. Cleanup~ --- .../mod/blocks/BlockCoalGenerator.java | 1 - .../mod/blocks/BlockCompost.java | 5 ++--- .../mod/blocks/BlockOilGenerator.java | 1 - .../mod/blocks/render/RenderCompost.java | 8 ++++---- .../mod/blocks/render/RenderSmileyCloud.java | 15 ++++++++------- .../mod/event/WorldDecorationEvent.java | 1 - .../mod/misc/cloud/SmileyCloudEasterEggs.java | 1 - .../mod/proxy/ClientProxy.java | 3 --- .../mod/tile/TileEntitySmileyCloud.java | 11 ++++++----- .../actuallyadditions/mod/util/AssetUtil.java | 18 +++++++++--------- 10 files changed, 29 insertions(+), 35 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java index 387b1bca3..ab1c5445d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java @@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java index 720821478..cb2ce873e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java @@ -68,8 +68,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ } @Override - public boolean isFullCube() - { + public boolean isFullCube(){ return false; } @@ -110,7 +109,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ @Override public void setBlockBoundsForItemRender(){ float f = 1.0F/16.0F; - this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11 * f, 1.0F-f); + this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11*f, 1.0F-f); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java index a61682b36..a196fcc49 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java @@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java index 2d2550ac8..3d31c24dd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java @@ -21,13 +21,13 @@ import net.minecraft.tileentity.TileEntity; public class RenderCompost extends TileEntitySpecialRenderer{ @Override - public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) { + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage){ if(te instanceof TileEntityCompost){ - TileEntityCompost compost = (TileEntityCompost) te; + TileEntityCompost compost = (TileEntityCompost)te; if(compost.getStackInSlot(0) != null){ - float i = compost.getAmount() / TileEntityCompost.AMOUNT; + float i = compost.getAmount()/TileEntityCompost.AMOUNT; GlStateManager.pushMatrix(); - GlStateManager.translate((float) x + 0.5F, (float) y + (i / 3F) + 0.01F, (float) z + 0.5F); + GlStateManager.translate((float)x+0.5F, (float)y+(i/3F)+0.01F, (float)z+0.5F); GlStateManager.scale(1.5F, i, 1.5F); int meta = compost.getStackInSlot(0).getItem() == InitItems.itemFertilizer ? 1 : 0; AssetUtil.renderBlockInWorld(Blocks.dirt, meta); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java index 5387cd9ca..0799a82c5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java @@ -54,7 +54,8 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{ if(ClientProxy.bulletForMyValentine || (theCloud.name != null && !theCloud.name.isEmpty() && theCloud.name.equals("Pink Fluffy Unicloud"))){ theCloud.setPinkAndFluffy(); - } else { + } + else{ theCloud.setNormalCloud(); } @@ -64,16 +65,16 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{ for(String triggerName : cloud.getTriggerNames()){ if(StringUtil.equalsToLowerCase(triggerName, theCloud.name)){ GlStateManager.pushMatrix(); - switch (PosUtil.getMetadata(theCloud.getPos(), theCloud.getWorld())){ - case 1: { + switch(PosUtil.getMetadata(theCloud.getPos(), theCloud.getWorld())){ + case 1:{ GlStateManager.rotate(180, 0, 1, 0); break; } - case 2: { + case 2:{ GlStateManager.rotate(270, 0, 1, 0); break; } - case 3: { + case 3:{ GlStateManager.rotate(90, 0, 1, 0); break; } @@ -91,8 +92,8 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{ } GlStateManager.popMatrix(); - if(theCloud.name != null && !theCloud.name.isEmpty() && !Minecraft.getMinecraft().gameSettings.hideGUI) { - AssetUtil.renderNameTag(theCloud.name, x + 0.5F, y + 1.3F, z + 0.66); + if(theCloud.name != null && !theCloud.name.isEmpty() && !Minecraft.getMinecraft().gameSettings.hideGUI){ + AssetUtil.renderNameTag(theCloud.name, x+0.5F, y+1.3F, z+0.66); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java index dfd3ad113..07d014a31 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java @@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; -import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.material.Material; import net.minecraft.util.BlockPos; import net.minecraft.world.biome.BiomeGenOcean; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java index 9dce6a3b0..4171e3a83 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.misc.cloud; -import de.ellpeck.actuallyadditions.mod.blocks.BlockSmileyCloud; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index c3f472f5a..856d74729 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -24,7 +24,6 @@ import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; import de.ellpeck.actuallyadditions.mod.util.ModUtil; @@ -32,7 +31,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.resources.IReloadableResourceManager; import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.IResourceManagerReloadListener; @@ -47,7 +45,6 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.registry.VillagerRegistry; import java.io.File; import java.util.Calendar; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java index 10a0b59d8..f47a40c1a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.blocks.BlockSmileyCloud; import de.ellpeck.actuallyadditions.mod.network.gui.IStringReactor; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.entity.player.EntityPlayer; @@ -60,13 +59,15 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IStringReac } public void setPinkAndFluffy(){ - if(PosUtil.getMetadata(this.pos, this.worldObj) <= 3) - PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj) + 4, 2); + if(PosUtil.getMetadata(this.pos, this.worldObj) <= 3){ + PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj)+4, 2); + } } public void setNormalCloud(){ - if(PosUtil.getMetadata(this.pos, this.worldObj) >= 4) - PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj) - 4, 2); + if(PosUtil.getMetadata(this.pos, this.worldObj) >= 4){ + PosUtil.setMetadata(this.pos, this.worldObj, PosUtil.getMetadata(this.pos, this.worldObj)-4, 2); + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java index fdcdda71f..7a314e3cb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java @@ -118,7 +118,7 @@ public class AssetUtil{ public static void renderNameTag(String tag, float x, float y, float z){ FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj; float f = 1.6F; - float f1 = 0.016666668F * f; + float f1 = 0.016666668F*f; GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); GL11.glNormal3f(0.0F, 1.0F, 0.0F); @@ -133,19 +133,19 @@ public class AssetUtil{ Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); int i = 0; - int j = fontrenderer.getStringWidth(tag) / 2; + int j = fontrenderer.getStringWidth(tag)/2; GlStateManager.disableTexture2D(); worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); - worldrenderer.pos((double) (-j - 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); - worldrenderer.pos((double) (-j - 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); - worldrenderer.pos((double) (j + 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); - worldrenderer.pos((double) (j + 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double)(-j-1), (double)(-1+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double)(-j-1), (double)(8+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double)(j+1), (double)(8+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double)(j+1), (double)(-1+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); tessellator.draw(); GlStateManager.enableTexture2D(); - fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag) / 2, i, 553648127); + fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag)/2, i, 553648127); GlStateManager.enableDepth(); GlStateManager.depthMask(true); - fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag) / 2, i, -1); + fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag)/2, i, -1); GlStateManager.enableLighting(); GlStateManager.disableBlend(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -153,6 +153,6 @@ public class AssetUtil{ } public static void renderNameTag(String tag, double x, double y, double z){ - renderNameTag(tag, (float) x, (float) y, (float) z); + renderNameTag(tag, (float)x, (float)y, (float)z); } }