diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-07-18 10:35:55 +0200 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-07-18 10:35:55 +0200 |
commit | 2b6a28710ab5216ba987c100ce367ffbbbf40fff (patch) | |
tree | 803c0d22052ba4921dbca9f6e7e5cd5eaf76fd88 /src | |
parent | bcdb9546eeff7791fede412e8ea910d3a23af7de (diff) | |
download | GT5-Unofficial-2b6a28710ab5216ba987c100ce367ffbbbf40fff.tar.gz GT5-Unofficial-2b6a28710ab5216ba987c100ce367ffbbbf40fff.tar.bz2 GT5-Unofficial-2b6a28710ab5216ba987c100ce367ffbbbf40fff.zip |
code maintenance
+cleaned up code (removed unused imports, resorted modifiers, added qualifiers)
+fixed BioVat bonus? maybe?
+fixed BioVat Forming issues with invisible TEs inside
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Former-commit-id: 2b19f3694c04f39845f0b55fb0e012cf1dc265e7
Diffstat (limited to 'src')
87 files changed, 1141 insertions, 1185 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index d3e3eb727b..f2631564c4 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -23,17 +23,12 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; -import net.minecraft.launchwrapper.Launch; -import net.minecraftforge.oredict.OreDictionary; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; -import java.io.File; -import java.io.IOException; import java.util.Arrays; import java.util.List; -import java.util.jar.JarFile; import static org.objectweb.asm.Opcodes.*; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index 5702c32252..f3590b4e90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -26,7 +26,10 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; class TooltipCache { private static final HashMap<Pair<Integer, Short>, char[]> cache = new HashMap<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 72c0db2735..2532357218 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -84,14 +84,14 @@ public class TooltipEventHandler { } } - final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); if (BLOCK != null && BLOCK != Blocks.air) { if (BLOCK instanceof BW_Blocks) { TooltipCache.put(event.itemStack, tooAdd); return; } - final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); - final HashMap<BioVatLogicAdder.BlockMetaPair, Byte> GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); + BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + HashMap<BioVatLogicAdder.BlockMetaPair, Byte> GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); tooAdd.add( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 540f597051..8686cee0be 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -43,7 +43,7 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/LESU.png"); protected GT_Container_LESU mContainer; - private GT_TileEntity_LESU c; + private final GT_TileEntity_LESU c; public GT_GUIContainer_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), GT_GUIContainer_LESU.texture.getResourceDomain()); @@ -52,16 +52,16 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { } @Override - protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { + protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); - this.drawString(this.fontRendererObj, "EU: " + String.valueOf(this.mContainer.mEnergy), 11, 16, 16448255); - this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255); - this.drawString(this.fontRendererObj, "MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); - this.drawString(this.fontRendererObj, "EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255); - this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); - if (c.maxEUStore() >= Long.MAX_VALUE - 1) { + this.drawString(this.fontRendererObj, "EU: " + this.mContainer.mEnergy, 11, 16, 16448255); + this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? this.mContainer.mOutput + percell : Integer.toString(0)), 11, 24, 16448255); + this.drawString(this.fontRendererObj, "MAX EU/t IN: " + this.mContainer.mInput, 11, 32, 16448255); + this.drawString(this.fontRendererObj, "EU/t OUT: " + this.mContainer.mOutput, 11, 40, 16448255); + this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + this.c.getBaseMetaTileEntity().getInputAmperage(), 11, 48, 16448255); + if (this.c.maxEUStore() >= Long.MAX_VALUE - 1) { this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB()); } if (!this.c.getBaseMetaTileEntity().isActive()) { @@ -71,14 +71,14 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { } @Override - protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; + Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_LESU.texture); + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); if (this.mContainer != null) { - final long tScale = this.mContainer.mEnergy / Math.max(1, c.maxEUStore() / 116); + long tScale = this.mContainer.mEnergy / Math.max(1, this.c.maxEUStore() / 116); this.drawTexturedModalRect(x + 8, y + 73, 0, 251, (int) tScale, 5); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index d214b4b09e..86779b71d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -26,8 +26,6 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java index bb93e0e506..879274d114 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -49,7 +49,7 @@ public class BW_GT_Vanilla_Texture implements IIconContainer { @Override public IIcon getIcon() { - return packed; + return this.packed; } @Override @@ -59,6 +59,6 @@ public class BW_GT_Vanilla_Texture implements IIconContainer { @Override public ResourceLocation getTextureFile() { - return new ResourceLocation(packed.getIconName()); + return new ResourceLocation(this.packed.getIconName()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 7f537b5054..397f0d3bc8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -48,27 +48,27 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { GL11.glTranslatef(-0.5F, -0.5F, -0.5F); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); - renderNegativeYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); + renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); - renderPositiveYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); + renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); - renderNegativeZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); + renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); - renderPositiveZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); + renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); - renderNegativeXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); + renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); - renderPositiveXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); + renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); Tessellator.instance.draw(); aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); @@ -77,7 +77,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return GT_Renderer_Block.renderStandardBlock(world, x, y, z, block, renderer); + return renderStandardBlock(world, x, y, z, block, renderer); } @Override @@ -87,6 +87,6 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public int getRenderId() { - return mRenderID; + return this.mRenderID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 423fb20468..82150c7913 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -90,6 +90,6 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { @Override public int getRenderId() { - return RID; + return RendererGlasBlock.RID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 9860ec1c41..cf81a296f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -42,7 +42,7 @@ public class BW_Blocks extends Block { @SideOnly(Side.CLIENT) protected IIcon[] texture; - protected String[] textureNames; + String[] textureNames; protected String name; public BW_Blocks(String name, String[] texture) { @@ -73,14 +73,14 @@ public class BW_Blocks extends Block { } @Override - public int damageDropped(final int meta) { + public int damageDropped(int meta) { return meta; } @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { - for (int i = 0; i < textureNames.length; i++) { + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); } } @@ -88,21 +88,21 @@ public class BW_Blocks extends Block { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - return meta < texture.length ? texture[meta] : texture[0]; + return meta < this.texture.length ? this.texture[meta] : this.texture[0]; } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { - texture = new IIcon[textureNames.length]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + this.texture = new IIcon[this.textureNames.length]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); } } @Override public String getUnlocalizedName() { - return name; + return this.name; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 893afa625f..3d6d3e41b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -36,14 +36,15 @@ import net.minecraftforge.common.util.ForgeDirection; public class BW_GlasBlocks extends BW_Blocks { @SideOnly(Side.CLIENT) - IIcon[] connectedTexture; + private IIcon[] connectedTexture; - boolean connectedTex, fake; - short[][] color = new short[textureNames.length][3]; + private final boolean connectedTex; + private boolean fake; + private short[][] color = new short[this.textureNames.length][3]; public BW_GlasBlocks(String name, String[] texture, CreativeTabs tabs) { super(name, texture, tabs, Material.glass); - connectedTex = false; + this.connectedTex = false; } @@ -55,7 +56,7 @@ public class BW_GlasBlocks extends BW_Blocks { } public short[] getColor(int meta) { - return meta < texture.length ? color[meta] : color[0]; + return meta < this.texture.length ? this.color[meta] : this.color[0]; } @Override @@ -75,25 +76,25 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - return meta < texture.length ? texture[meta] : texture[0]; + return meta < this.texture.length ? this.texture[meta] : this.texture[0]; } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { - if (!connectedTex) { - texture = new IIcon[textureNames.length]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + if (!this.connectedTex) { + this.texture = new IIcon[this.textureNames.length]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); } return; } - texture = new IIcon[textureNames.length]; - connectedTexture = new IIcon[16]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + this.texture = new IIcon[this.textureNames.length]; + this.connectedTexture = new IIcon[16]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); for (int j = 0; j < 16; j++) { - connectedTexture[j] = par1IconRegister.registerIcon(textureNames[0] + "_" + j); + this.connectedTexture[j] = par1IconRegister.registerIcon(this.textureNames[0] + "_" + j); } } } @@ -102,7 +103,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { - if (!connectedTex) + if (!this.connectedTex) return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); ForgeDirection dir = ForgeDirection.getOrientation(aSide); @@ -170,7 +171,7 @@ public class BW_GlasBlocks extends BW_Blocks { break; } } - return connectedTexture[sides]; + return this.connectedTexture[sides]; } @Override @@ -181,7 +182,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { - if (!fake && FMLCommonHandler.instance().getSide().isClient()) + if (!this.fake && FMLCommonHandler.instance().getSide().isClient()) return RendererGlasBlock.RID; else return 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 4cc851df67..b6a1ee611d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -43,7 +43,6 @@ import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; @@ -54,7 +53,7 @@ import net.minecraftforge.fluids.IFluidContainerItem; public class BW_TileEntityContainer extends BlockContainer implements ITileAddsInformation { - Class<? extends TileEntity> tileEntity = null; + Class<? extends TileEntity> tileEntity; public BW_TileEntityContainer(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_); @@ -71,7 +70,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI if (worldObj.isRemote) { return false; } - final TileEntity tile = worldObj.getTileEntity(x, y, z); + TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof BW_TileEntity_HeatedWaterPump) { if (player.getHeldItem() != null && (player.getHeldItem().getItem().equals(Items.bucket) || player.getHeldItem().getItem() instanceof IFluidContainerItem) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) if (player.getHeldItem().getItem().equals(Items.bucket) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { @@ -93,14 +92,14 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI return false; } - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { - final TileEntity tile = world.getTileEntity(x, y, z); + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IWrenchable && itemStack != null) { - final IWrenchable tile2 = (IWrenchable) tile; + IWrenchable tile2 = (IWrenchable) tile; int meta = itemStack.getItemDamage(); world.setBlockMetadataWithNotify(x, y, z, meta, 2); if (entity != null) { - final int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; + int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; switch (face) { case 0: tile2.setFacing((short) 2); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 112d57de9b..eac3b5fd28 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -49,9 +49,9 @@ import java.util.List; public class BW_TileEntityContainer_Multiple extends BlockContainer { - final protected String[] textureNames; - final protected String name; - final Class<? extends TileEntity>[] tileEntityArray; + protected final String[] textureNames; + protected final String name; + protected final Class<? extends TileEntity>[] tileEntityArray; @SideOnly(Side.CLIENT) protected IIcon[] texture; @@ -59,8 +59,8 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { super(p_i45386_1_); this.setHardness(15.0F); this.setResistance(30.0F); - tileEntityArray = tileEntity; - name = blockName; + this.tileEntityArray = tileEntity; + this.name = blockName; this.textureNames = textureNames; this.setCreativeTab(tabs); this.setBlockName(blockName); @@ -73,7 +73,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { return true; } if (!player.isSneaking()) { - final TileEntity tile = worldObj.getTileEntity(x, y, z); + TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof IHasGui) { return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); } else if (tile instanceof ITileWithGUI) { @@ -84,14 +84,14 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { return false; } - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { - final TileEntity tile = world.getTileEntity(x, y, z); + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IWrenchable && itemStack != null) { - final IWrenchable tile2 = (IWrenchable) tile; + IWrenchable tile2 = (IWrenchable) tile; int meta = itemStack.getItemDamage(); world.setBlockMetadataWithNotify(x, y, z, meta, 2); if (entity != null) { - final int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; + int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; switch (face) { case 0: tile2.setFacing((short) 2); @@ -111,14 +111,14 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { } @Override - public int damageDropped(final int meta) { + public int damageDropped(int meta) { return meta; } @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { - for (int i = 0; i < textureNames.length; i++) { + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); } } @@ -126,15 +126,15 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - return meta < texture.length ? texture[meta] : texture[0]; + return meta < this.texture.length ? this.texture[meta] : this.texture[0]; } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { - texture = new IIcon[textureNames.length]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + this.texture = new IIcon[this.textureNames.length]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 3ecfd658b3..95cde7ddcc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; -import com.github.bartimaeusnek.ASM.BWCoreTransformer;; +import com.github.bartimaeusnek.ASM.BWCoreTransformer; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -42,7 +42,7 @@ public class ConfigHandler { public static int ross128batier = 3; public static int landerType = 3; public static int ross128bRuinChance = 512; - public static int creativeScannerID = 0; + public static int creativeScannerID; public static long energyPerCell = 1000000L; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 86ea3198eb..db5a66173f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -44,10 +44,10 @@ import java.util.List; public class BW_ItemBlocks extends ItemBlock { - protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + private final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + private final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); - public BW_ItemBlocks(final Block par1) { + public BW_ItemBlocks(Block par1) { super(par1); this.setMaxDamage(0); this.setHasSubtypes(true); @@ -55,18 +55,18 @@ public class BW_ItemBlocks extends ItemBlock { } @Override - public int getMetadata(final int aMeta) { + public int getMetadata(int aMeta) { return aMeta; } @Override - public String getUnlocalizedName(final ItemStack aStack) { + public String getUnlocalizedName(ItemStack aStack) { return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); } @Override @SideOnly(Side.CLIENT) - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { @@ -90,7 +90,7 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - return getIcon(stack, renderPass); + return this.getIcon(stack, renderPass); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index f67a912aee..6c11a9be64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -44,13 +44,13 @@ import static ic2.api.item.IKineticRotor.GearboxType.WIND; public class BW_Stonage_Rotors extends Item implements IKineticRotor { - private int[] DiaMinMax = new int[3]; - private float eff; - private GearboxType type; - private ResourceLocation tex; - private String itemTex; + private final int[] DiaMinMax = new int[3]; + private final float eff; + private final IKineticRotor.GearboxType type; + private final ResourceLocation tex; + private final String itemTex; - public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durability, GearboxType type, ResourceLocation tex, String Name, String itemTex) { + public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durability, IKineticRotor.GearboxType type, ResourceLocation tex, String Name, String itemTex) { this.DiaMinMax[0] = diameter; this.DiaMinMax[1] = min; this.DiaMinMax[2] = max; @@ -65,12 +65,12 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + itemTex); + this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.itemTex); } public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); - GearboxType type = null; + IKineticRotor.GearboxType type = null; if (Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { type = WATER; } else if (Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { @@ -111,7 +111,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } @Override - public boolean isAcceptedType(ItemStack itemStack, GearboxType gearboxType) { + public boolean isAcceptedType(ItemStack itemStack, IKineticRotor.GearboxType gearboxType) { return gearboxType.equals(this.type); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index c3491ca6f3..136ccb27b5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -69,13 +69,13 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @SideOnly(Side.CLIENT) public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { + if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); itemList.add(charged); } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); + if (this.getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, this.getMaxDamage())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index f744be70b7..5d5f8b790c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -51,36 +51,36 @@ import java.util.List; import java.util.Set; public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - public static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); - public int mCharge; - public int mTransfer; + private static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private final int mCharge; + private final int mTransfer; public int mTier; @SideOnly(Side.CLIENT) private IIcon icon; - private int multi; + private final int multi; public GT_Rockcutter_Item(int aTier) { - super(2 * aTier, ToolMaterial.EMERALD, mineableBlocks); + super(2 * aTier, Item.ToolMaterial.EMERALD, GT_Rockcutter_Item.mineableBlocks); this.mTier = aTier; - multi = (int) Math.pow(10, (mTier - 1)); - this.mineableBlocks = new HashSet(); + this.multi = (int) Math.pow(10, (this.mTier - 1)); + GT_Rockcutter_Item.mineableBlocks = new HashSet(); this.maxStackSize = 1; - this.mCharge = 10000 * multi; - this.mTransfer = (int) GT_Values.V[mTier]; - this.efficiencyOnProperMaterial = 2.0f * mTier; + this.mCharge = 10000 * this.multi; + this.mTransfer = (int) GT_Values.V[this.mTier]; + this.efficiencyOnProperMaterial = 2.0f * this.mTier; this.setCreativeTab(MainMod.GT2); - this.setMaxDamage(27 + 10 * multi); + this.setMaxDamage(27 + 10 * this.multi); this.setNoRepair(); - this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[mTier]); + this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { - if (!ElectricItem.manager.canUse(aStack, 500 * multi)) { + if (!ElectricItem.manager.canUse(aStack, 500 * this.multi)) { if (aStack.isItemEnchanted()) { aStack.getTagCompound().removeTag("ench"); } @@ -94,10 +94,10 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { return false; } - public boolean onBlockDestroyed(final ItemStack var1, final World var2, final Block var3, final int var4, final int var5, final int var6, final EntityLivingBase var7) { + public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); - if (ElectricItem.manager.canUse(var1, 500 * multi)) { - ElectricItem.manager.use(var1, 500 * multi, var7); + if (ElectricItem.manager.canUse(var1, 500 * this.multi)) { + ElectricItem.manager.use(var1, 500 * this.multi, var7); } else { ElectricItem.manager.discharge(var1, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, false); } @@ -106,19 +106,19 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || this.mineableBlocks.contains(par1Block); + return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || mineableBlocks.contains(par1Block); } @SideOnly(Side.CLIENT) public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { + if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); itemList.add(charged); } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); + if (this.getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, this.getMaxDamage())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 4a25b7e951..b45b831bae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -45,15 +45,15 @@ import java.util.List; import java.util.Set; public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { - private static Set effective = Sets.newHashSet(Blocks.web); - public double mCharge; - public double mTransfer; + private static final Set effective = Sets.newHashSet(Blocks.web); + private final double mCharge; + private final double mTransfer; public int mTier; @SideOnly(Side.CLIENT) private IIcon icon; public GT_Teslastaff_Item() { - super(0, ToolMaterial.GOLD, effective); + super(0, Item.ToolMaterial.GOLD, GT_Teslastaff_Item.effective); this.setCreativeTab(MainMod.GT2); this.setNoRepair(); this.mCharge = 10000000D; @@ -65,15 +65,15 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @Override - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { - final EntityLiving tTarget = (EntityLiving) aTarget; - final EntityLivingBase tPlayer = (EntityLivingBase) aPlayer; + EntityLiving tTarget = (EntityLiving) aTarget; + EntityLivingBase tPlayer = aPlayer; ElectricItem.manager.use(aStack, 9000000, tPlayer); for (int i = 1; i < 5; ++i) { if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { @@ -87,13 +87,13 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { @SideOnly(Side.CLIENT) public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { + if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); itemList.add(charged); } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); + if (this.getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, this.getMaxDamage())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index c38be6c6c0..1ca3c8fe2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -29,15 +29,14 @@ import net.minecraft.item.Item; public class SimpleIconItem extends Item { - String tex; + private final String tex; public SimpleIconItem(String tex) { - super(); this.tex = tex; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - itemIcon = iconRegister.registerIcon("bartworks:" + tex); + this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 8c6d810869..3d312d6e37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -49,9 +49,9 @@ public class SimpleSubItemClass extends Item { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - itemIcon = new IIcon[tex.length]; - for (int i = 0; i < tex.length; i++) { - itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + tex[i]); + this.itemIcon = new IIcon[this.tex.length]; + for (int i = 0; i < this.tex.length; i++) { + this.itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.tex[i]); } } @@ -64,21 +64,21 @@ public class SimpleSubItemClass extends Item { @Override public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { - for (int i = 0; i < tex.length; i++) { + for (int i = 0; i < this.tex.length; i++) { p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); } } @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int p_77617_1_) { - if (p_77617_1_ < tex.length) + if (p_77617_1_ < this.tex.length) return this.itemIcon[p_77617_1_]; else return this.itemIcon[0]; } public String getUnlocalizedName(ItemStack p_77667_1_) { - if (p_77667_1_.getItemDamage() < tex.length) + if (p_77667_1_.getItemDamage() < this.tex.length) return "item." + this.tex[p_77667_1_.getItemDamage()].replaceAll("/", "."); else return "WrongDamageItemDestroyIt"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 53b59830eb..57a9ee9aac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -48,12 +48,12 @@ public class BioCultureLoader implements Runnable { public static BioCulture anaerobicOil; @Override public void run() { - CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BioDNA.convertDataToDNA(BIO_DATA_YEAST), true); - WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BIO_DNA_WHINE_YEAST, true); - BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BIO_DNA_BEER_YEAST, true); - rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BIO_DATA_BETA_LACMATASE), false); - eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(eColiData), BioDNA.convertDataToDNA(eColiData), true); - anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BIO_DATA_ANAEROBIC_OIL), true); + BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); + BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST, true); + BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, true); + BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); + BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); + BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 590cc6048d..7968e2996c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -40,18 +40,18 @@ public class BioItemList { private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); - public static final ItemStack[] mBioLabParts = {new ItemStack(mItemBioLabParts), new ItemStack(mItemBioLabParts, 1, 1), new ItemStack(mItemBioLabParts, 1, 2), new ItemStack(mItemBioLabParts, 1, 3), new ItemStack(mItemBioLabParts, 1, 4)}; + public static final ItemStack[] mBioLabParts = {new ItemStack(BioItemList.mItemBioLabParts), new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4)}; private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); public BioItemList() { - GameRegistry.registerItem(mItemBioLabParts, "BioLabModules"); - GameRegistry.registerItem(vanillaBioLabParts, "BioLabParts"); + GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); + GameRegistry.registerItem(BioItemList.vanillaBioLabParts, "BioLabParts"); } public static Collection<ItemStack> getAllPetriDishes() { HashSet<ItemStack> ret = new HashSet<>(); for (BioCulture Culture : BioCulture.BIO_CULTURE_ARRAY_LIST) { - ret.add(getPetriDish(Culture)); + ret.add(BioItemList.getPetriDish(Culture)); } return ret; } @@ -59,7 +59,7 @@ public class BioItemList { public static Collection<ItemStack> getAllDNASampleFlasks() { HashSet<ItemStack> ret = new HashSet<>(); for (BioData dna : BioData.BIO_DATA_ARRAY_LIST) { - ret.add(getDNASampleFlask(BioDNA.convertDataToDNA(dna))); + ret.add(BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(dna))); } return ret; } @@ -67,32 +67,32 @@ public class BioItemList { public static Collection<ItemStack> getAllPlasmidCells() { HashSet<ItemStack> ret = new HashSet<>(); for (BioData dna : BioData.BIO_DATA_ARRAY_LIST) { - ret.add(getPlasmidCell(BioPlasmid.convertDataToPlasmid(dna))); + ret.add(BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(dna))); } return ret; } public static ItemStack getPetriDish(BioCulture Culture) { if (Culture == null) - return new ItemStack(vanillaBioLabParts); - ItemStack ret = new ItemStack(vanillaBioLabParts); + return new ItemStack(BioItemList.vanillaBioLabParts); + ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts); ret.setTagCompound(BioCulture.getNBTTagFromCulture(Culture)); return ret; } public static ItemStack getDNASampleFlask(BioDNA dna) { if (dna == null) - return new ItemStack(vanillaBioLabParts, 1, 1); + return new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); - ItemStack ret = new ItemStack(vanillaBioLabParts, 1, 1); + ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); ret.setTagCompound(BioData.getNBTTagFromBioData(dna)); return ret; } public static ItemStack getPlasmidCell(BioPlasmid plasmid) { if (plasmid == null) - return new ItemStack(vanillaBioLabParts, 1, 2); - ItemStack ret = new ItemStack(vanillaBioLabParts, 1, 2); + return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); + ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); ret.setTagCompound(BioData.getNBTTagFromBioData(plasmid)); return ret; } @@ -111,6 +111,6 @@ public class BioItemList { if (selection < 1 || selection > 4) return null; - return new ItemStack(vanillaBioLabParts, 1, 2 + selection); + return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2 + selection); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index 4f862ba6a9..dbb060700a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -25,16 +25,16 @@ package com.github.bartimaeusnek.bartworks.common.loaders; public class BioLabLoader implements Runnable { - FluidLoader fluidLoader; - BioItemList bioItemList; - BioRecipeLoader bioRecipeLoader; + private FluidLoader fluidLoader; + private BioItemList bioItemList; + private BioRecipeLoader bioRecipeLoader; @Override public void run() { - fluidLoader = new FluidLoader(); - fluidLoader.run(); - bioItemList = new BioItemList(); - bioRecipeLoader = new BioRecipeLoader(); - bioRecipeLoader.run(); + this.fluidLoader = new FluidLoader(); + this.fluidLoader.run(); + this.bioItemList = new BioItemList(); + this.bioRecipeLoader = new BioRecipeLoader(); + this.bioRecipeLoader.run(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java index 97cc8e3c85..1027e8b344 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java @@ -30,7 +30,7 @@ import java.util.HashSet; public class CircuitImprintLoader implements Runnable { - private static HashSet<NBTTagCompound> circuitTypes = new HashSet<>(); + private static final HashSet<NBTTagCompound> circuitTypes = new HashSet<>(); @Override public void run() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index af33363990..6503dcef86 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -27,7 +27,6 @@ import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColor import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BioCulture; -import com.github.bartimaeusnek.bartworks.util.Pair; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -44,8 +43,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.Arrays; import java.awt.*; +import java.util.Arrays; public class FluidLoader implements Runnable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 7174c2176b..ffe29352ba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -222,7 +222,7 @@ public class RecipeLoader implements Runnable { if (!ConfigHandler.GTNH) GT_ModHandler.addCraftingRecipe( ItemRegistry.dehp, - BITSD, + RecipeLoader.BITSD, new Object[]{ "GPG", "NCN", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 277823b5f4..e7708253e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -54,11 +54,11 @@ import java.util.List; @ChannelHandler.Sharable public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> implements IGT_NetworkHandler { - private EnumMap<Side, FMLEmbeddedChannel> mChannel; - private GT_Packet[] mSubChannels; + private final EnumMap<Side, FMLEmbeddedChannel> mChannel; + private final GT_Packet[] mSubChannels; public BW_Network() { - this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", new ChannelHandler[]{this, new HandlerShared()}); + this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket()}; } @@ -98,10 +98,8 @@ public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> public void sendPacketToAllPlayersInRange(World aWorld, @Nonnull GT_Packet aPacket, int aX, int aZ) { if (!aWorld.isRemote) { - Iterator var5 = aWorld.playerEntities.iterator(); - while (var5.hasNext()) { - Object tObject = var5.next(); + for (Object tObject : aWorld.playerEntities) { if (!(tObject instanceof EntityPlayerMP)) { break; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 23cf7a263f..0da061e352 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -60,7 +60,7 @@ public class CircuitProgrammerPacket extends GT_Packet { @Override public byte[] encode() { - return ByteBuffer.allocate(9).putInt(0, dimID).putInt(4, playerID).put(8, (hasChip ? chipCfg : -1)).array(); + return ByteBuffer.allocate(9).putInt(0, this.dimID).putInt(4, this.playerID).put(8, (this.hasChip ? this.chipCfg : -1)).array(); } @Override @@ -72,18 +72,18 @@ public class CircuitProgrammerPacket extends GT_Packet { @Override public void process(IBlockAccess iBlockAccess) { - World w = DimensionManager.getWorld(dimID); - if (w != null && w.getEntityByID(playerID) instanceof EntityPlayer) { - ItemStack stack = ((EntityPlayer) w.getEntityByID(playerID)).getHeldItem(); + World w = DimensionManager.getWorld(this.dimID); + if (w != null && w.getEntityByID(this.playerID) instanceof EntityPlayer) { + ItemStack stack = ((EntityPlayer) w.getEntityByID(this.playerID)).getHeldItem(); if ((stack != null) && (stack.stackSize > 0)) { Item item = stack.getItem(); if (item instanceof Circuit_Programmer) { NBTTagCompound nbt = stack.getTagCompound(); - nbt.setBoolean("HasChip", hasChip); - if (hasChip) - nbt.setByte("ChipConfig", chipCfg); + nbt.setBoolean("HasChip", this.hasChip); + if (this.hasChip) + nbt.setByte("ChipConfig", this.chipCfg); stack.setTagCompound(nbt); - ((EntityPlayer) w.getEntityByID(playerID)).inventory.setInventorySlotContents(((EntityPlayer) w.getEntityByID(playerID)).inventory.currentItem, stack); + ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.setInventorySlotContents(((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, stack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index d44fc42cce..793f59c899 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -42,7 +42,7 @@ public class OreDictCachePacket extends GT_Packet { public OreDictCachePacket(HashSet<Pair<Integer,Short>> set) { super(false); - hashSet = set; + this.hashSet = set; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java index 36fd4dfa36..4147087a51 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java @@ -59,8 +59,8 @@ public class OrePacket extends GT_Packet { @Override public byte[] encode() { - int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(), 0, 12, 31); - return ByteBuffer.allocate(16).putInt(x).putInt(z).putShort(y).putShort(meta).putInt(hash).array(); + int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); + return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash).array(); } @Override @@ -68,12 +68,12 @@ public class OrePacket extends GT_Packet { byte[] tmp = new byte[16]; byteArrayDataInput.readFully(tmp); ByteBuffer buff = ByteBuffer.wrap(tmp); - x = buff.getInt(); - z = buff.getInt(); - y = buff.getShort(); - meta = buff.getShort(); - OrePacket todecode = new OrePacket(x, y, z, meta); - if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(), 0, 12, 31)) { + this.x = buff.getInt(); + this.z = buff.getInt(); + this.y = buff.getShort(); + this.meta = buff.getShort(); + OrePacket todecode = new OrePacket(this.x, this.y, this.z, this.meta); + if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index a5f5f4089f..90a3adc69a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -59,11 +59,11 @@ public class RendererPacket extends GT_Packet { @Override public byte[] encode() { - byte r = (byte) (((integer >> 16) & 0xFF) + Byte.MIN_VALUE); - byte g = (byte) (((integer >> 8) & 0xFF) + Byte.MIN_VALUE); - byte b = (byte) (((integer >> 0) & 0xFF) + Byte.MIN_VALUE); - byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); - return ByteBuffer.allocate(19).putInt(0, coords.x).putShort(4, (short) coords.y).putInt(6, coords.z).putInt(10, coords.wID).put(14, r).put(15, g).put(16, b).put(17, removal).put(18, checksum).array(); + byte r = (byte) (((this.integer >> 16) & 0xFF) + Byte.MIN_VALUE); + byte g = (byte) (((this.integer >> 8) & 0xFF) + Byte.MIN_VALUE); + byte b = (byte) (((this.integer) & 0xFF) + Byte.MIN_VALUE); + byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); + return ByteBuffer.allocate(19).putInt(0, this.coords.x).putShort(4, this.coords.y).putInt(6, this.coords.z).putInt(10, this.coords.wID).put(14, r).put(15, g).put(16, b).put(17, this.removal).put(18, checksum).array(); } // /** @@ -90,23 +90,23 @@ public class RendererPacket extends GT_Packet { this.integer = BW_ColorUtil.getColorFromRGBArray(rgb); this.removal = ByteBuffer.wrap(buffer).get(17); - byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); + byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); if (checksum != ByteBuffer.wrap(buffer).get(18)) { MainMod.LOGGER.error("BW Packet was corrupted or modified!"); return null; } - return new RendererPacket(coords, integer, removal == 1); + return new RendererPacket(this.coords, this.integer, this.removal == 1); } @Override public void process(IBlockAccess iBlockAccess) { if (FMLCommonHandler.instance().getSide().isClient()) { - if (removal == 0) - GT_TileEntity_BioVat.staticColorMap.put(coords, integer); + if (this.removal == 0) + GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer); else - GT_TileEntity_BioVat.staticColorMap.remove(coords); + GT_TileEntity_BioVat.staticColorMap.remove(this.coords); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index d71969e12b..0e54e9264d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -35,9 +35,9 @@ import java.util.List; public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - recursiveBelowCheck check = new recursiveBelowCheck(); - private long ticks = 0; - private long noOfIts = 0; + BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); + private long ticks; + private long noOfIts; private Coords paused; public BW_TileEntity_ExperimentalFloodGate() { @@ -46,31 +46,31 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public void updateEntity() { - if (paused == null) { + if (this.paused == null) { this.paused = new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId); } - ticks++; - if (check.called != -1) { - if (ticks % 20 == 0) { + this.ticks++; + if (this.check.called != -1) { + if (this.ticks % 20 == 0) { HashSet<Coords> toRem = new HashSet<>(); - for (Coords c : check.hashset) { + for (Coords c : this.check.hashset) { this.worldObj.setBlock(c.x, c.y, c.z, Blocks.water, 0, 4); toRem.add(c); } - check.hashset.removeAll(toRem); + this.check.hashset.removeAll(toRem); } } else { - noOfIts = 0; - setUpHashSet(); - this.paused = check.hashset.get(check.hashset.size() - 1); + this.noOfIts = 0; + this.setUpHashSet(); + this.paused = this.check.hashset.get(this.check.hashset.size() - 1); } - if (ticks % 50 == 0) - ticks = 0; + if (this.ticks % 50 == 0) + this.ticks = 0; } private synchronized void setUpHashSet() { - check = new recursiveBelowCheck(); - Thread t = new Thread(check); + this.check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); + Thread t = new Thread(this.check); t.run(); while (t.isAlive()) { try { @@ -79,7 +79,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem e.printStackTrace(); } } - check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)); + this.check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)); } @Override @@ -108,10 +108,10 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem byte ret = 0; int wID = w.provider.dimensionId; - if (hashset.contains(new Coords(x, y, z, wID))) + if (this.hashset.contains(new Coords(x, y, z, wID))) return ret; - hashset.add(new Coords(x, y, z, wID)); + this.hashset.add(new Coords(x, y, z, wID)); if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); @@ -142,53 +142,53 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem int ret = 0; iterations++; int wID = w.provider.dimensionId; - byte sides = check_sourroundings(w, x, y, z, b); + byte sides = this.check_sourroundings(w, x, y, z, b); - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID)) && y + 1 <= yCoord) { - tail = get_connected(w, x, y + 1, z, b, iterations); + if (((sides | 0b111110) == 0b111111) && !this.hashset.contains(new Coords(x, y + 1, z, wID)) && y + 1 <= BW_TileEntity_ExperimentalFloodGate.this.yCoord) { + tail = this.get_connected(w, x, y + 1, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { - tail = get_connected(w, x, y - 1, z, b, iterations); + if (((sides | 0b111101) == 0b111111) && !this.hashset.contains(new Coords(x, y - 1, z, wID))) { + tail = this.get_connected(w, x, y - 1, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) { - tail = get_connected(w, x + 1, y, z, b, iterations); + if (((sides | 0b111011) == 0b111111) && !this.hashset.contains(new Coords(x + 1, y, z, wID))) { + tail = this.get_connected(w, x + 1, y, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x - 1, y, z, wID))) { - tail = get_connected(w, x - 1, y, z, b, iterations); + if (((sides | 0b110111) == 0b111111) && !this.hashset.contains(new Coords(x - 1, y, z, wID))) { + tail = this.get_connected(w, x - 1, y, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x, y, z + 1, wID))) { - tail = get_connected(w, x, y, z + 1, b, iterations); + if (((sides | 0b101111) == 0b111111) && !this.hashset.contains(new Coords(x, y, z + 1, wID))) { + tail = this.get_connected(w, x, y, z + 1, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x, y, z - 1, wID))) { - tail = get_connected(w, x, y, z - 1, b, iterations); + if (((sides | 0b011111) == 0b111111) && !this.hashset.contains(new Coords(x, y, z - 1, wID))) { + tail = this.get_connected(w, x, y, z - 1, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } @@ -198,8 +198,8 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public synchronized void run() { - called = check.get_connected(worldObj, paused.x, paused.y, paused.z, Blocks.air, 0); - notifyAll(); + this.called = BW_TileEntity_ExperimentalFloodGate.this.check.get_connected(BW_TileEntity_ExperimentalFloodGate.this.worldObj, BW_TileEntity_ExperimentalFloodGate.this.paused.x, BW_TileEntity_ExperimentalFloodGate.this.paused.y, BW_TileEntity_ExperimentalFloodGate.this.paused.z, Blocks.air, 0); + this.notifyAll(); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 416e4fb56e..ea9bfe6395 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -31,7 +31,6 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -46,63 +45,63 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr public static final Fluid WATER = FluidRegistry.WATER; public ItemStack fuelstack; public FluidStack outputstack = new FluidStack(FluidRegistry.WATER, 0); - public int fuel = 0; - public byte tick = 0; - public int maxfuel = 0; + public int fuel; + public byte tick; + public int maxfuel; public ItemStack fakestack = new ItemStack(Blocks.water); @Override public void writeToNBT(NBTTagCompound p_145841_1_) { NBTTagCompound subItemStack = new NBTTagCompound(); - if (fuelstack == null) + if (this.fuelstack == null) p_145841_1_.setTag("ItemStack", subItemStack); else { - fuelstack.writeToNBT(subItemStack); + this.fuelstack.writeToNBT(subItemStack); p_145841_1_.setTag("ItemStack", subItemStack); } NBTTagCompound subFluidStack = new NBTTagCompound(); - outputstack.writeToNBT(subFluidStack); + this.outputstack.writeToNBT(subFluidStack); p_145841_1_.setTag("FluidStack", subFluidStack); - p_145841_1_.setInteger("fuel", fuel); - p_145841_1_.setInteger("maxfuel", maxfuel); - p_145841_1_.setByte("tick", tick); + p_145841_1_.setInteger("fuel", this.fuel); + p_145841_1_.setInteger("maxfuel", this.maxfuel); + p_145841_1_.setByte("tick", this.tick); super.writeToNBT(p_145841_1_); } @Override public void readFromNBT(NBTTagCompound p_145839_1_) { - tick = p_145839_1_.getByte("tick"); - fuel = p_145839_1_.getInteger("fuel"); - maxfuel = p_145839_1_.getInteger("maxfuel"); - outputstack = FluidStack.loadFluidStackFromNBT(p_145839_1_.getCompoundTag("FluidStack")); + this.tick = p_145839_1_.getByte("tick"); + this.fuel = p_145839_1_.getInteger("fuel"); + this.maxfuel = p_145839_1_.getInteger("maxfuel"); + this.outputstack = FluidStack.loadFluidStackFromNBT(p_145839_1_.getCompoundTag("FluidStack")); if (!p_145839_1_.getCompoundTag("ItemStack").equals(new NBTTagCompound())) - fuelstack = ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("ItemStack")); + this.fuelstack = ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("ItemStack")); super.readFromNBT(p_145839_1_); } @Override public void updateEntity() { - if (worldObj.isRemote || ((fuelstack == null || fuelstack.stackSize <= 0) && fuel <= 0) || (tick == 0 && worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air)) { + if (this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0) || (this.tick == 0 && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air)) { return; } - if (fuel < 0) - fuel = 0; + if (this.fuel < 0) + this.fuel = 0; - if (fuelstack != null && fuel == 0) { - fuel = maxfuel = TileEntityFurnace.getItemBurnTime(fuelstack); - --fuelstack.stackSize; + if (this.fuelstack != null && this.fuel == 0) { + this.fuel = this.maxfuel = TileEntityFurnace.getItemBurnTime(this.fuelstack); + --this.fuelstack.stackSize; if (this.fuelstack.stackSize <= 0) this.fuelstack = null; } - if (fuel > 0) { - ++tick; - --fuel; - if (tick % 20 == 0) { - if (outputstack.amount <= (8000 - ConfigHandler.mbWaterperSec)) - outputstack.amount += ConfigHandler.mbWaterperSec; - tick = 0; + if (this.fuel > 0) { + ++this.tick; + --this.fuel; + if (this.tick % 20 == 0) { + if (this.outputstack.amount <= (8000 - ConfigHandler.mbWaterperSec)) + this.outputstack.amount += ConfigHandler.mbWaterperSec; + this.tick = 0; } } } @@ -130,17 +129,17 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public ItemStack getStackInSlot(int p_70301_1_) { if (p_70301_1_ == 0) - return fuelstack; + return this.fuelstack; else - return fakestack; + return this.fakestack; } @Override public ItemStack decrStackSize(int slot, int ammount) { - if (slot != FUELSLOT || fuelstack == null || ammount > fuelstack.stackSize) + if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT || this.fuelstack == null || ammount > this.fuelstack.stackSize) return null; - return fuelstack.splitStack(ammount); + return this.fuelstack.splitStack(ammount); } @Override @@ -150,10 +149,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void setInventorySlotContents(int slot, ItemStack p_70299_2_) { - if (slot == FUELSLOT) - fuelstack = p_70299_2_; + if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) + this.fuelstack = p_70299_2_; else - fakestack = p_70299_2_; + this.fakestack = p_70299_2_; } @Override @@ -187,17 +186,17 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 && p_94041_1_ == FUELSLOT; + return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT; } @Override public FluidStack getFluid() { - return outputstack.amount > 0 ? outputstack : null; + return this.outputstack.amount > 0 ? this.outputstack : null; } @Override public int getFluidAmount() { - return outputstack.amount; + return this.outputstack.amount; } @Override @@ -218,14 +217,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(int maxDrain, boolean doDrain) { int actualdrain = maxDrain; - if (actualdrain > outputstack.amount) - actualdrain = outputstack.amount; - FluidStack ret = new FluidStack(WATER, actualdrain); + if (actualdrain > this.outputstack.amount) + actualdrain = this.outputstack.amount; + FluidStack ret = new FluidStack(BW_TileEntity_HeatedWaterPump.WATER, actualdrain); if (ret.amount == 0) ret = null; if (doDrain) { - outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + this.outputstack.amount -= actualdrain; + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(this.outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); } return ret; } @@ -242,14 +241,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - if (resource != null && resource.getFluid() == WATER && drain(resource.amount, false) != null) - return drain(resource.amount, doDrain); + if (resource != null && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER && this.drain(resource.amount, false) != null) + return this.drain(resource.amount, doDrain); return null; } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - return drain(maxDrain, doDrain); + return this.drain(maxDrain, doDrain); } @Override @@ -259,12 +258,12 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - return fluid == null || fluid == WATER; + return fluid == null || fluid == BW_TileEntity_HeatedWaterPump.WATER; } @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - return new FluidTankInfo[]{getInfo()}; + return new FluidTankInfo[]{this.getInfo()}; } @Override @@ -274,10 +273,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void registerBlockIcons(IIconRegister par1IconRegister) { - texture[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); - texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); + ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); + ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); for (int i = 2; i < 7; i++) { - texture[i] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); + ITileHasDifferentTextureSides.texture[i] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 989e1618b9..f9e7553760 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -41,17 +41,17 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - return fill(resource, doFill); + return this.fill(resource, doFill); } @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - return drain(from, resource != null ? resource.amount : 0, doDrain); + return this.drain(from, resource != null ? resource.amount : 0, doDrain); } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - return drain(maxDrain, doDrain); + return this.drain(maxDrain, doDrain); } @Override @@ -62,10 +62,10 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { HashSet<Boolean> ret = new HashSet<Boolean>(); - for (FluidStack stack : INTERNALTANKS) { + for (FluidStack stack : this.INTERNALTANKS) { ret.add(GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0))); if (ret.contains(Boolean.TRUE)) - selectedTank = this.INTERNALTANKS.indexOf(stack); + this.selectedTank = this.INTERNALTANKS.indexOf(stack); } return ret.contains(Boolean.TRUE); } @@ -77,15 +77,15 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack getFluid() { - if (INTERNALTANKS.get(selectedTank) == null || INTERNALTANKS.get(selectedTank).amount == 0) - if (selectedTank > 0) - selectedTank = this.INTERNALTANKS.size() - 1; - return INTERNALTANKS.get(selectedTank); + if (this.INTERNALTANKS.get(this.selectedTank) == null || this.INTERNALTANKS.get(this.selectedTank).amount == 0) + if (this.selectedTank > 0) + this.selectedTank = this.INTERNALTANKS.size() - 1; + return this.INTERNALTANKS.get(this.selectedTank); } @Override public int getFluidAmount() { - return INTERNALTANKS.get(selectedTank) != null ? INTERNALTANKS.get(selectedTank).amount : 0; + return this.INTERNALTANKS.get(this.selectedTank) != null ? this.INTERNALTANKS.get(this.selectedTank).amount : 0; } @Override @@ -94,12 +94,12 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank NBTTagList lInternalTank = new NBTTagList(); - for (int i = 0; i < INTERNALTANKS.size(); i++) { - if (INTERNALTANKS.get(i) != null) { + for (int i = 0; i < this.INTERNALTANKS.size(); i++) { + if (this.INTERNALTANKS.get(i) != null) { NBTTagCompound entry = new NBTTagCompound(); - entry.setString("FluidName", INTERNALTANKS.get(i).getFluid().getName()); - entry.setInteger("Ammount", INTERNALTANKS.get(i).amount); - entry.setTag("FluidTag", INTERNALTANKS.get(i).tag); + entry.setString("FluidName", this.INTERNALTANKS.get(i).getFluid().getName()); + entry.setInteger("Ammount", this.INTERNALTANKS.get(i).amount); + entry.setTag("FluidTag", this.INTERNALTANKS.get(i).tag); lInternalTank.appendTag(entry); } } @@ -119,7 +119,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public int fill(FluidStack resource, boolean doFill) { - if (worldObj.isRemote || resource == null || resource.amount == 0) + if (this.worldObj.isRemote || resource == null || resource.amount == 0) return 0; if (!doFill) @@ -127,16 +127,16 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank int id = 0; - if (canDrain(null, resource.getFluid())) { - for (FluidStack stack : INTERNALTANKS) + if (this.canDrain(null, resource.getFluid())) { + for (FluidStack stack : this.INTERNALTANKS) if (GT_Utility.areFluidsEqual(stack, resource)) { this.INTERNALTANKS.get(id = this.INTERNALTANKS.indexOf(stack)).amount += resource.amount; - selectedTank = id; + this.selectedTank = id; } } else { this.INTERNALTANKS.add(resource); id = this.INTERNALTANKS.size() - 1; - selectedTank = id; + this.selectedTank = id; } return this.INTERNALTANKS.get(id).amount; } @@ -144,8 +144,8 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack drain(int maxDrain, boolean doDrain) { - FluidStack outputstack = INTERNALTANKS.get(selectedTank); - if (worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) + FluidStack outputstack = this.INTERNALTANKS.get(this.selectedTank); + if (this.worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) return null; int actualdrain = maxDrain; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index d9a4c77efc..db58b69cc4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -73,14 +73,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private final HashSet<EntityPlayerMP> playerMPHashSet = new HashSet<EntityPlayerMP>(); private final ArrayList<GT_MetaTileEntity_RadioHatch> mRadHatches = new ArrayList<>(); private int height = 1; - private GT_Recipe mLastRecipe = null; + private GT_Recipe mLastRecipe; private Fluid mFluid = FluidRegistry.LAVA; private BioCulture mCulture; - private ItemStack mStack = null; + private ItemStack mStack; private boolean needsVisualUpdate = true; - private byte mGlassTier = 0; - private int mSievert = 0; - private int mNeededSievert = 0; + private byte mGlassTier; + private int mSievert; + private int mNeededSievert; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -90,12 +90,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { super(aName); } - public static int[] specialValueUnpack(int aSpecialValure) { + public static int[] specialValueUnpack(int aSpecialValue) { int[] ret = new int[4]; - ret[0] = aSpecialValure & 0xF; // = glas tier - ret[1] = aSpecialValure >>> 4 & 0b11; // = special valure - ret[2] = aSpecialValure >>> 6 & 0b1; //exact svt - ret[3] = aSpecialValure >>> 7 & Integer.MAX_VALUE; // = sievert + ret[0] = aSpecialValue & 0xF; // = glas tier + ret[1] = aSpecialValue >>> 4 & 0b11; // = special valure + ret[2] = aSpecialValue >>> 6 & 0b1; //boolean exact svt | 1 = true | 0 = false + ret[3] = aSpecialValue >>> 7 & Integer.MAX_VALUE; // = sievert return ret; } @@ -128,7 +128,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public int getCapacity() { int ret = 0; - ret += getInputCapacity(); + ret += this.getInputCapacity(); //ret += getOutputCapacity(); return ret; } @@ -149,18 +149,18 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int calcMod(double x) { - int ret = (int) Math.ceil(100D*(-(2*this.getOutputCapacity()-x)*(2*this.getOutputCapacity()-x)+1D)); + int ret = (int) Math.ceil(100D*(-(2*(this.getOutputCapacity()-x))*(2*(this.getOutputCapacity()-x))+1D)); return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } @Override public boolean checkRecipe(ItemStack itemStack) { - GT_Recipe.GT_Recipe_Map gtRecipeMap = getRecipeMap(); + GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap(); if (gtRecipeMap == null) return false; - ArrayList<ItemStack> tInputList = getStoredInputs(); + ArrayList<ItemStack> tInputList = this.getStoredInputs(); int tInputList_sS = tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { for (int j = i + 1; j < tInputList_sS; j++) { @@ -178,7 +178,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); - ArrayList<FluidStack> tFluidList = getStoredFluids(); + ArrayList<FluidStack> tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { for (int j = i + 1; j < tFluidList_sS; j++) { @@ -199,7 +199,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (tFluidList.size() > 0) { - GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); + GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); if (gtRecipe == null) return false; @@ -207,7 +207,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (!BW_Util.areStacksEqualOrNull((ItemStack) gtRecipe.mSpecialItems, itemStack)) return false; - int[] conditions = specialValueUnpack(gtRecipe.mSpecialValue); + int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(gtRecipe.mSpecialValue); this.mNeededSievert = conditions[3]; @@ -217,22 +217,22 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { int times = 1; - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (getStoredFluidOutputs().size() > 0) { + if (this.getStoredFluidOutputs().size() > 0) { this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length]; - for (FluidStack storedOutputFluid : getStoredFluidOutputs()) { + for (FluidStack storedOutputFluid : this.getStoredFluidOutputs()) { if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0))) for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) { - int j = calcMod(storedOutputFluid.amount); + int j = this.calcMod(storedOutputFluid.amount); for (int i = 0; i < j; i++) - if (depleteInput(inputFluidStack)) + if (this.depleteInput(inputFluidStack)) times++; } } - for (FluidStack storedfluidStack : getStoredFluidOutputs()) { + for (FluidStack storedfluidStack : this.getStoredFluidOutputs()) { for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) { if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i))) this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount)); @@ -247,14 +247,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage(), this); - if (mEUt > 0) - mEUt = -mEUt; + if (this.mEUt > 0) + this.mEUt = -this.mEUt; this.mProgresstime = 0; if (gtRecipe.mCanBeBuffered) - mLastRecipe = gtRecipe; + this.mLastRecipe = gtRecipe; - updateSlots(); + this.updateSlots(); return true; } return false; @@ -303,7 +303,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { //controller if (y == 0 && xDir + x == 0 && zDir + z == 0) continue; - if (!(this.addOutputToMachineList(tileEntity, MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, MCASING_INDEX) || this.addInputToMachineList(tileEntity, MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, MCASING_INDEX))) { + if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { ++blockcounter; continue; @@ -317,8 +317,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } else { if (x == -2 && z == -2 && y == 1) - mGlassTier = calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (0 == mGlassTier || mGlassTier != calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { + this.mGlassTier = this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (0 == this.mGlassTier || this.mGlassTier != this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { return false; } } @@ -330,8 +330,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (this.mOutputHatches.size() == 1) if (this.mMaintenanceHatches.size() == 1) if (this.mInputHatches.size() > 0) - if (this.mEnergyHatches.size() > 0) - return true; + return this.mEnergyHatches.size() > 0; return false; } @@ -373,12 +372,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private void sendAllRequiredRendererPackets() { - int height = reCalculateHeight(); + int height = this.reCalculateHeight(); if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < height; y++) for (int z = -1; z < 2; z++) - sendPackagesOrRenewRenderer(x, y, z, this.mCulture); + this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); } } @@ -386,8 +385,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); - staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); + GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + GT_TileEntity_BioVat.staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); if (FMLCommonHandler.instance().getSide().isServer()) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( @@ -421,7 +420,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { this.getBaseMetaTileEntity().getZCoord() ); } - needsVisualUpdate = true; + this.needsVisualUpdate = true; } private void check_Chunk() { @@ -437,12 +436,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { - if (!playerMPHashSet.contains(tPlayer)) { - playerMPHashSet.add(tPlayer); - sendAllRequiredRendererPackets(); + if (!this.playerMPHashSet.contains(tPlayer)) { + this.playerMPHashSet.add(tPlayer); + this.sendAllRequiredRendererPackets(); } } else { - playerMPHashSet.remove(tPlayer); + this.playerMPHashSet.remove(tPlayer); } } @@ -452,10 +451,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private void placeFluid() { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - height = reCalculateHeight(); - if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) + this.height = this.reCalculateHeight(); + if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) for (int x = -1; x < 2; x++) { - for (int y = 0; y < height; y++) { + for (int y = 0; y < this.height; y++) { for (int z = -1; z < 2; z++) { if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(Blocks.air)) this.getBaseMetaTileEntity().getWorld().setBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), FluidLoader.bioFluidBlock); @@ -478,50 +477,50 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { public void doAllVisualThings() { if (this.getBaseMetaTileEntity().isServerSide()) { - if (mMachine) { + if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { - check_Chunk(); + this.check_Chunk(); } - if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 0) { + if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < 3; y++) for (int z = -1; z < 2; z++) this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); } - height = reCalculateHeight(); - if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqualOrNull(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) { + this.height = this.reCalculateHeight(); + if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) { + if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) || (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1)) { for (int x = -1; x < 2; x++) { - for (int y = 1; y < height; y++) { + for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { - if (mCulture == null || aStack == null || aStack.getTagCompound() == null || mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { + if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); - sendPackagesOrRenewRenderer(x, y, z, lCulture); + this.sendPackagesOrRenewRenderer(x, y, z, lCulture); } } } } } - mStack = aStack; - mCulture = lCulture; + this.mStack = aStack; + this.mCulture = lCulture; } - if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1) { + if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { if (this.getBaseMetaTileEntity().isClientSide()) new Throwable().printStackTrace(); - placeFluid(); - needsVisualUpdate = false; + this.placeFluid(); + this.needsVisualUpdate = false; } } } else { - onRemoval(); + this.onRemoval(); } } } @@ -529,9 +528,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (height != reCalculateHeight()) - needsVisualUpdate = true; - doAllVisualThings(); + if (this.height != this.reCalculateHeight()) + this.needsVisualUpdate = true; + this.doAllVisualThings(); if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) { this.mSievert = this.mRadHatches.get(0).getSievert(); if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert) @@ -541,14 +540,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mFluidHeight", height); - if (mCulture != null && !mCulture.getName().isEmpty()) - aNBT.setString("mCulture", mCulture.getName()); - else if ((mCulture == null || mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { + aNBT.setInteger("mFluidHeight", this.height); + if (this.mCulture != null && !this.mCulture.getName().isEmpty()) + aNBT.setString("mCulture", this.mCulture.getName()); + else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { aNBT.removeTag("mCulture"); } if (this.mFluid != null) - aNBT.setString("mFluid", mFluid.getName()); + aNBT.setString("mFluid", this.mFluid.getName()); aNBT.setInteger("mSievert",this.mSievert); aNBT.setInteger("mNeededSievert",this.mNeededSievert); super.saveNBTData(aNBT); @@ -563,7 +562,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { for (int z = -1; z < 2; z++) { if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); - staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); if (FMLCommonHandler.instance().getSide().isServer()) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), @@ -574,7 +573,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId ), - mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : mCulture.getColorRGB(), + this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : this.mCulture.getColorRGB(), true ), this.getBaseMetaTileEntity().getXCoord(), @@ -620,6 +619,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX]}; } }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 9b145f0123..14e8954f69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -37,7 +37,7 @@ import java.util.Collection; public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBlockBase { private NBTTagCompound type; - private GT_Recipe bufferedRecipe = null; + private GT_Recipe bufferedRecipe; public GT_TileEntity_CircuitAssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -56,24 +56,24 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - type = aNBT.getCompoundTag("Type"); + this.type = aNBT.getCompoundTag("Type"); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setTag("Type",type); + aNBT.setTag("Type", this.type); } @Override public boolean checkRecipe(ItemStack itemStack) { - if (type == null) + if (this.type == null) return false; - if (bufferedRecipe != null && bufferedRecipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) + if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) return true; - ItemStack stack = ItemStack.loadItemStackFromNBT(type); + ItemStack stack = ItemStack.loadItemStackFromNBT(this.type); if (stack == null) return false; @@ -92,7 +92,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl for (GT_Recipe recipe : recipes){ if (recipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) - bufferedRecipe = recipe; + this.bufferedRecipe = recipe; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index f7ac05a7f9..50e2c7e632 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -72,10 +72,10 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil } BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (int) (Math.floor(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((int) (Math.floor(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); if (combined.isRecipeInputEqual(true, array)) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; BW_Util.calculateOverclockedNessMulti(combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index cb582e8e5d..9b826dc9f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -52,12 +52,12 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { public GT_TileEntity_DEHP(int aID, int tier, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mTier = (byte) tier; + this.mTier = (byte) tier; } public GT_TileEntity_DEHP(String aName, byte mTier) { super(aName); - this.mTier = (byte) mTier; + this.mTier = mTier; } @Override @@ -66,7 +66,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Class c = TileEntityNuclearReactorElectric.class; Field f = c.getDeclaredField("huOutputModifier"); f.setAccessible(true); - nulearHeatMod = f.getFloat(f); + GT_TileEntity_DEHP.nulearHeatMod = f.getFloat(f); } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e) { e.printStackTrace(); } @@ -75,21 +75,21 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mTier", mTier); - aNBT.setByte("mMode", mMode); + aNBT.setByte("mTier", this.mTier); + aNBT.setByte("mMode", this.mMode); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - mTier = aNBT.getByte("mTier"); - mMode = aNBT.getByte("mMode"); + this.mTier = aNBT.getByte("mTier"); + this.mMode = aNBT.getByte("mMode"); super.loadNBTData(aNBT); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_DEHP(this.mName, mTier); + return new GT_TileEntity_DEHP(this.mName, this.mTier); } @Override @@ -99,8 +99,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public String[] getDescription() { - String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract", "Explodes when it runs out of Water/Distilled Water", "Converts " + (long) (mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam", "Converts " + (long) (mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; - String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract", "Explodes when it runs out of Coolant", "Heats up " + (long) (mTier * 24 * ((double) nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"}; + String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (this.mTier > 1 ? this.mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + this.getCasingBlockItem().name(), "1x3x1 " + this.getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[this.mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract", "Explodes when it runs out of Water/Distilled Water", "Converts " + (long) (this.mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam", "Converts " + (long) (this.mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; + String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (this.mTier > 1 ? this.mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + this.getCasingBlockItem().name(), "1x3x1 " + this.getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[this.mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract", "Explodes when it runs out of Coolant", "Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"}; return ConfigHandler.DEHPDirectSteam ? dscSteam : dscCooleant; } @@ -121,7 +121,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected int getMinTier() { - return 2 + mTier; + return 2 + this.mTier; } @Override @@ -153,7 +153,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode != 3) { + if (this.mMode != 3) { this.isPickingPipes = false; try { Field workState = this.getClass().getField("workState"); @@ -169,15 +169,15 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; - ++mMode; - if (mMode >= 4) - mMode = 0; - GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + mMode); + ++this.mMode; + if (this.mMode >= 4) + this.mMode = 0; + GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode == 3) { + if (this.mMode == 3) { this.isPickingPipes = true; try { Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); @@ -191,40 +191,40 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (this.waitForPipes()) { return false; } else { - if (mMode == 0) - mMode = 1; + if (this.mMode == 0) + this.mMode = 1; if (ConfigHandler.DEHPDirectSteam) { - if (mMode == 1) { - long steamProduced = (mTier * 600 * 2L * this.mEfficiency / 10000L); + if (this.mMode == 1) { + long steamProduced = (this.mTier * 600 * 2L * this.mEfficiency / 10000L); long waterConsume = ((steamProduced + 160) / 160); - if (getWaterFromHatches(false) - waterConsume > 0) { - consumeFluid(FluidRegistry.WATER, waterConsume); - addOutput(GT_ModHandler.getSteam(steamProduced)); + if (this.getWaterFromHatches(false) - waterConsume > 0) { + this.consumeFluid(FluidRegistry.WATER, waterConsume); + this.addOutput(GT_ModHandler.getSteam(steamProduced)); } else { - explodeMultiblock(); + this.explodeMultiblock(); return false; } - } else if (mMode == 2) { - long steamProduced = (mTier * 300 * 2L * this.mEfficiency / 10000L); + } else if (this.mMode == 2) { + long steamProduced = (this.mTier * 300 * 2L * this.mEfficiency / 10000L); long waterConsume = ((steamProduced + 160) / 160); - if (getWaterFromHatches(true) - waterConsume > 0) { - consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); - addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); + if (this.getWaterFromHatches(true) - waterConsume > 0) { + this.consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); + this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); } else { - explodeMultiblock(); + this.explodeMultiblock(); return false; } } } else { - if (mMode == 1 || mMode == 2) { - long coolantConverted = (long) (mTier * 24 * ((double) nulearHeatMod) * this.mEfficiency / 10000L); - if (getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { - consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); + if (this.mMode == 1 || this.mMode == 2) { + long coolantConverted = (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod) * this.mEfficiency / 10000L); + if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { + this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); + this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); } else { - explodeMultiblock(); + this.explodeMultiblock(); return false; } } @@ -249,11 +249,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } } - if (tmp[tmp.length - 1] <= 0) { - return true; - } + return tmp[tmp.length - 1] <= 0; - return false; } long tmp = ammount; @@ -269,14 +266,14 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected void setElectricityStats() { try { - this.mEUt = isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[getMinTier()]); + this.mEUt = this.isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[this.getMinTier()]); } catch (ArithmeticException e) { e.printStackTrace(); this.mEUt = Integer.MAX_VALUE - 7; } this.mProgresstime = 0; this.mMaxProgresstime = 1; - this.mEfficiency = this.getCurrentEfficiency((ItemStack) null); + this.mEfficiency = this.getCurrentEfficiency(null); this.mEfficiencyIncrease = 10000; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index cd45301d4f..4a6b30b757 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -65,8 +65,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity for (int i = 0; i < tInputList_sS - 1; ++i) { for (int j = i + 1; j < tInputList_sS; ++j) { - if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { - if (((ItemStack) tInputList.get(i)).stackSize < ((ItemStack) tInputList.get(j)).stackSize) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize < tInputList.get(j).stackSize) { tInputList.remove(i--); tInputList_sS = tInputList.size(); break; @@ -78,10 +78,10 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } - ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); if (tInputList.size() > 0) { - GT_Recipe tRecipe = eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, (FluidStack[]) null, tInputs); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, (FluidStack[]) null, tInputs)) { + GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; this.mEUt = -tRecipe.mEUt; @@ -99,24 +99,24 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public boolean onRunningTick(ItemStack aStack) { if (this.mRuntime % 10 == 0) - togglePiston(); + this.togglePiston(); return super.onRunningTick(aStack); } public void stopMachine() { - resetPiston(); + this.resetPiston(); super.stopMachine(); } @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - piston = true; + this.piston = true; } private void resetPiston() { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; - if (!piston) { + if (!this.piston) { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); @@ -126,8 +126,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); } } - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - piston = !piston; + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; } } @@ -138,7 +138,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); boolean hax = false; - if (piston) { + if (this.piston) { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { @@ -149,8 +149,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } } - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - piston = !piston; + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; } else { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { @@ -158,8 +158,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); } } - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - piston = !piston; + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; } if (hax) this.explodeMultiblock(); @@ -167,13 +167,13 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("piston", piston); + aNBT.setBoolean("piston", this.piston); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - piston = aNBT.getBoolean("piston"); + this.piston = aNBT.getBoolean("piston"); super.loadNBTData(aNBT); } @@ -217,18 +217,18 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } else if (y == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 1, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } else if (y == 2) { - if (!piston) { + if (!this.piston) { if (Math.abs(x) == 1 && Math.abs(z) == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 2, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } } else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } else if (y == 3) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 3, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 471373e3dd..06ecfecd26 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -61,9 +61,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { private static final byte TEXID_CHARGING = 1; private static final byte TEXID_IDLE = 2; private static final byte TEXID_EMPTY = 3; - private static IIcon[] iIcons = new IIcon[4]; - private static IIconContainer[] iIconContainers = new IIconContainer[4]; - private static ITexture[][] iTextures = new ITexture[4][1]; + private static final IIcon[] iIcons = new IIcon[4]; + private static final IIconContainer[] iIconContainers = new IIconContainer[4]; + private static final ITexture[][] iTextures = new ITexture[4][1]; public ConnectedBlocksChecker connectedcells; public ItemStack[] circuits = new ItemStack[5]; private long mStorage; @@ -104,14 +104,14 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxAmperesOut() { - return maxAmperesIn(); + return this.maxAmperesIn(); } @Override public long maxEUInput() { for (int i = 1; i < GT_Values.V.length; i++) { - if (maxEUOutput() <= GT_Values.V[i] && maxEUOutput() > GT_Values.V[i - 1]) + if (this.maxEUOutput() <= GT_Values.V[i] && this.maxEUOutput() > GT_Values.V[i - 1]) return Math.min(GT_Values.V[i], 32768L); } @@ -150,7 +150,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_LESU(mName); + return new GT_TileEntity_LESU(this.mName); } @Override @@ -173,18 +173,18 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { - for (int i = 0; i < iTextures.length; i++) { - iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); - final int finalI = i; - iIconContainers[i] = new IIconContainer() { + for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { + GT_TileEntity_LESU.iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); + int finalI = i; + GT_TileEntity_LESU.iIconContainers[i] = new IIconContainer() { @Override public IIcon getIcon() { - return iIcons[finalI]; + return GT_TileEntity_LESU.iIcons[finalI]; } @Override public IIcon getOverlayIcon() { - return iIcons[finalI]; + return GT_TileEntity_LESU.iIcons[finalI]; } @Override @@ -207,8 +207,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } public boolean isClientSide() { - if (getWorld() != null) - return getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + if (this.getWorld() != null) + return this.getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } @@ -220,18 +220,18 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (this.isClientSide()) { - for (int i = 0; i < iTextures.length; i++) { - iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { + GT_TileEntity_LESU.iTextures[i][0] = new GT_RenderedTexture(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) - ret = iTextures[TEXID_EMPTY]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_EMPTY]; else if (aSide == aFacing && !aActive) - ret = iTextures[TEXID_IDLE]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; else if (aSide == aFacing && aActive) - ret = iTextures[TEXID_CHARGING]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; else - ret = iTextures[TEXID_SIDE]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; } return ret; @@ -321,7 +321,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - checkMachine(aBaseMetaTileEntity, null); + this.checkMachine(aBaseMetaTileEntity, null); super.onFirstTick(aBaseMetaTileEntity); } @@ -330,7 +330,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (aBaseMetaTileEntity.isServerSide()) { this.mMaxProgresstime = 1; if (aTick % 20 == 0) - checkMachine(aBaseMetaTileEntity, null); + this.checkMachine(aBaseMetaTileEntity, null); this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; @@ -369,10 +369,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { long startingTime = System.nanoTime(); - connectedcells = new ConnectedBlocksChecker(); - connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); + this.connectedcells = new ConnectedBlocksChecker(); + this.connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); - if (connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { + if (this.connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { this.getBaseMetaTileEntity().disableWorking(); this.getBaseMetaTileEntity().setActive(false); this.mStorage = 0; @@ -382,7 +382,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } this.mEfficiency = this.getMaxEfficiency(null); - this.mStorage = (ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * connectedcells.hashset.size(); + this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); this.mMaxProgresstime = 1; this.mProgresstime = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index c403d990d6..9543643c3c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -48,9 +48,9 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase private static final byte SINGLE_DOWNSTEP = 1; private static final byte MULTI_UPSTEP = 2; private static final byte MULTI_DOWNSTEP = 3; - private byte mode = 0; - private byte texid = 2; - private long mCoilWicks = 0; + private byte mode; + private final byte texid = 2; + private long mCoilWicks; private boolean upstep = true; public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { @@ -89,7 +89,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase else this.mEfficiency = this.getMaxEfficiency(null); - if (this.mode > SINGLE_DOWNSTEP) { + if (this.mode > GT_TileEntity_ManualTrafo.SINGLE_DOWNSTEP) { return this.onRunningTickTabbedMode(); } @@ -100,8 +100,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public boolean onRunningTickTabbedMode() { boolean ret = false; - for (GT_MetaTileEntity_Hatch_Dynamo E : mDynamoHatches) { - for (GT_MetaTileEntity_Hatch_Energy I : mEnergyHatches) { + for (GT_MetaTileEntity_Hatch_Dynamo E : this.mDynamoHatches) { + for (GT_MetaTileEntity_Hatch_Energy I : this.mEnergyHatches) { long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; @@ -143,7 +143,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100; - return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; + return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mCoilWicks : this.getInputTier() - this.getOutputTier() == this.mCoilWicks; } @Override @@ -166,7 +166,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; if (stillcoil) { ++this.mCoilWicks; - if (mCoilWicks % 8 == 0) { + if (this.mCoilWicks % 8 == 0) { ++y; continue; } @@ -179,7 +179,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } - if (mCoilWicks % 8 != 0) + if (this.mCoilWicks % 8 != 0) return false; this.mCoilWicks = this.mCoilWicks / 8; @@ -196,7 +196,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int z = -1; z <= 1; ++z) if (xDir + x != 0 || zDir + z != 0) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -212,7 +212,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int x = -1; x <= 1; ++x) for (int z = -1; z <= 1; ++z) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -251,7 +251,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; if (stillcoil) { ++this.mCoilWicks; - if (mCoilWicks % 8 == 0) { + if (this.mCoilWicks % 8 == 0) { ++y; continue; } @@ -264,7 +264,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } - if (mCoilWicks % 8 != 0) + if (this.mCoilWicks % 8 != 0) return false; this.mCoilWicks = this.mCoilWicks / 8; @@ -281,7 +281,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int z = -2; z <= 2; ++z) if (xDir + x != 0 || zDir + z != 0) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -297,7 +297,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int x = -2; x <= 2; ++x) for (int z = -2; z <= 2; ++z) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -340,7 +340,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int z = -2; z <= 2; ++z) if (x == -2 || z == -2 || x == 2 || z == 2) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, this.texid, leveltier)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -348,10 +348,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } } - if (this.mDynamoHatches.isEmpty() || this.mEnergyHatches.isEmpty()) - return false; - - return true; + return !this.mDynamoHatches.isEmpty() && !this.mEnergyHatches.isEmpty(); } @Override @@ -376,7 +373,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_ManualTrafo(mName); + return new GT_TileEntity_ManualTrafo(this.mName); } @Override @@ -392,19 +389,19 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public void saveNBTData(NBTTagCompound ntag) { - ntag.setLong("mCoilWicks", mCoilWicks); + ntag.setLong("mCoilWicks", this.mCoilWicks); super.saveNBTData(ntag); } @Override public void loadNBTData(NBTTagCompound ntag) { super.loadNBTData(ntag); - mCoilWicks = ntag.getLong("mCoilWicks"); + this.mCoilWicks = ntag.getLong("mCoilWicks"); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid]}; } public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 193a1ffacb..edbe884c1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -76,30 +76,30 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - HeliumSupply=aNBT.getInteger("HeliumSupply"); - BISOPeletSupply=aNBT.getInteger("BISOPeletSupply"); - TRISOPeletSupply=aNBT.getInteger("TRISOPeletSupply"); - empty=aNBT.getBoolean("EmptyMode"); + this.HeliumSupply =aNBT.getInteger("HeliumSupply"); + this.BISOPeletSupply =aNBT.getInteger("BISOPeletSupply"); + this.TRISOPeletSupply =aNBT.getInteger("TRISOPeletSupply"); + this.empty =aNBT.getBoolean("EmptyMode"); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setInteger("HeliumSupply",HeliumSupply); - aNBT.setInteger("BISOPeletSupply",BISOPeletSupply); - aNBT.setInteger("TRISOPeletSupply",TRISOPeletSupply); - aNBT.setBoolean("EmptyMode",empty); + aNBT.setInteger("HeliumSupply", this.HeliumSupply); + aNBT.setInteger("BISOPeletSupply", this.BISOPeletSupply); + aNBT.setInteger("TRISOPeletSupply", this.TRISOPeletSupply); + aNBT.setBoolean("EmptyMode", this.empty); } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()){ - if (HeliumSupply < HELIUM_NEEDED){ + if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED){ for (FluidStack fluidStack : this.getStoredFluids()){ if (fluidStack.isFluidEqual(Materials.Helium.getGas(1000))) { - while (HeliumSupply < HELIUM_NEEDED && fluidStack.amount > 0) { - HeliumSupply++; + while (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED && fluidStack.amount > 0) { + this.HeliumSupply++; fluidStack.amount--; } } @@ -107,18 +107,18 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } for (ItemStack itemStack : this.getStoredInputs()) { if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3))) { - if (BISOPeletSupply + TRISOPeletSupply < 675000) { - while (BISOPeletSupply + TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { + if (this.BISOPeletSupply + this.TRISOPeletSupply < 675000) { + while (this.BISOPeletSupply + this.TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { itemStack.stackSize--; - TRISOPeletSupply++; + this.TRISOPeletSupply++; } this.updateSlots(); } } else if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1))) { - if (BISOPeletSupply + TRISOPeletSupply < 675000) { - while (BISOPeletSupply + TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { + if (this.BISOPeletSupply + this.TRISOPeletSupply < 675000) { + while (this.BISOPeletSupply + this.TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { itemStack.stackSize--; - BISOPeletSupply++; + this.BISOPeletSupply++; } this.updateSlots(); @@ -131,7 +131,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkRecipe(ItemStack controllerStack) { - if (!(HeliumSupply >= HELIUM_NEEDED && BISOPeletSupply + TRISOPeletSupply >= 100000)) + if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000)) return false; if (new XSTR().nextBoolean()) { @@ -160,10 +160,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean onRunningTick(ItemStack aStack) { - if (empty){ - this.addOutput(Materials.Helium.getGas(HeliumSupply)); - this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, TRISOPeletSupply, 3)); - this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, BISOPeletSupply, 1)); + if (this.empty){ + this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); + this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.TRISOPeletSupply, 3)); + this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.BISOPeletSupply, 1)); this.HeliumSupply = 0; this.TRISOPeletSupply = 0; this.BISOPeletSupply = 0; @@ -213,7 +213,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - final byte xz = 5; + byte xz = 5; int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xz; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * xz; for (int x = -xz; x <= xz; x++) { @@ -230,9 +230,9 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { if ( ( - !(this.addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) && y == 11) && - !(this.addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) && y == 0)) && - !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) + !(this.addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) && y == 11) && + !(this.addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) && y == 0)) && + !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) ) { return false; } @@ -250,7 +250,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { { if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { if ( - !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX)) + !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX)) { return false; } @@ -296,7 +296,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { "Progress:", this.mProgresstime / 20 + "secs", this.mMaxProgresstime / 20 + "secs", "BISO-Pebbles:", this.BISOPeletSupply + "pcs.", "TRISO-Pebbles:", this.TRISOPeletSupply + "pcs.", - "Helium-Level:", this.HeliumSupply+"L / "+HELIUM_NEEDED+"L", + "Helium-Level:", this.HeliumSupply+"L / "+ GT_TileEntity_THTR.HELIUM_NEEDED +"L", "Coolant/t:", this.BISOPeletSupply+this.TRISOPeletSupply >= 100000 ? (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply))+"L/t" : "0L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; @@ -315,13 +315,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX]}; } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - empty = !empty; - GT_Utility.sendChatToPlayer(aPlayer,empty ? "THTR will now empty itself." : "THTR is back in normal Operation"); + this.empty = !this.empty; + GT_Utility.sendChatToPlayer(aPlayer, this.empty ? "THTR will now empty itself." : "THTR is back in normal Operation"); } public static class THTRMaterials{ @@ -340,16 +340,16 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { 40, BW_Util.getMachineVoltageFromTier(5) ); - GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(aTHTR_Materials),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(aTHTR_Materials,1,4),40,30); + GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(THTRMaterials.aTHTR_Materials),400,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,4),40,30); ItemStack[] pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(aTHTR_Materials,64,1)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); - GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(aTHTR_Materials,1,2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(aTHTR_Materials,1,5),40,30); + Arrays.fill(pellets,new ItemStack(THTRMaterials.aTHTR_Materials,64,1)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); + GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,2),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,5),40,30); pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(aTHTR_Materials,64,3)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); + Arrays.fill(pellets,new ItemStack(THTRMaterials.aTHTR_Materials,64,3)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index a1b10d27a8..625e857401 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -63,9 +63,9 @@ import static gregtech.api.enums.GT_Values.V; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { - private static IIcon[] iIcons = new IIcon[2]; - private static IIconContainer[] iIconContainers = new IIconContainer[2]; - private static ITexture[] iTextures = new ITexture[3]; + private static final IIcon[] iIcons = new IIcon[2]; + private static final IIconContainer[] iIconContainers = new IIconContainer[2]; + private static final ITexture[] iTextures = new ITexture[3]; private final ArrayList<TileEntityDispenser> tedList = new ArrayList<TileEntityDispenser>(); private BW_RotorBlock rotorBlock; @@ -104,35 +104,35 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; if (tMap == null) return false; - GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), false, false, V[1], null, aStack); + GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); if (tRecipe == null) return false; if (tRecipe.getOutput(0) != null) { aStack.stackSize--; - mOutputItems[0] = tRecipe.getOutput(0); + this.mOutputItems[0] = tRecipe.getOutput(0); if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) - mOutputItems[1] = tRecipe.getOutput(1); - else if (!BW_Util.checkStackAndPrefix(mOutputItems[0]) || + this.mOutputItems[1] = tRecipe.getOutput(1); + else if (!BW_Util.checkStackAndPrefix(this.mOutputItems[0]) || !( - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL) || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL) || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) ) || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked ) - mOutputItems[1] = tRecipe.getOutput(0); + this.mOutputItems[1] = tRecipe.getOutput(0); } } this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); @@ -273,7 +273,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null ) - return recipe_fallback(itemStack); //fallback for all non-unificated Items + return this.recipe_fallback(itemStack); //fallback for all non-unificated Items //Ore Unificator shit for balance if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { @@ -330,7 +330,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); return true; } - return recipe_fallback(itemStack); //2nd fallback + return this.recipe_fallback(itemStack); //2nd fallback } @Override @@ -573,16 +573,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getInfoData() { - return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t"}; + return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", this.rotorBlock.getGrindPower() + "KU/t"}; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { - iIcons[0] = Blocks.brick_block.getIcon(0, 0); - iIconContainers[0] = new IIconContainer() { + GT_TileEntity_Windmill.iIcons[0] = Blocks.brick_block.getIcon(0, 0); + GT_TileEntity_Windmill.iIconContainers[0] = new IIconContainer() { @Override public IIcon getIcon() { - return iIcons[0]; + return GT_TileEntity_Windmill.iIcons[0]; } @Override @@ -596,11 +596,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } }; - iIcons[1] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":windmill_top"); - iIconContainers[1] = new IIconContainer() { + GT_TileEntity_Windmill.iIcons[1] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":windmill_top"); + GT_TileEntity_Windmill.iIconContainers[1] = new IIconContainer() { @Override public IIcon getIcon() { - return iIcons[1]; + return GT_TileEntity_Windmill.iIcons[1]; } @Override @@ -622,22 +622,22 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { ITexture[] ret = new ITexture[6]; - if (isClientSide()) { + if (this.isClientSide()) { if (aFacing == aSide || aSide == 0) { - iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); + GT_TileEntity_Windmill.iTextures[0] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[0]); for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[0]; + ret[i] = GT_TileEntity_Windmill.iTextures[0]; } } else if (aSide == 1) { - iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); + GT_TileEntity_Windmill.iTextures[1] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[1]); for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[1]; + ret[i] = GT_TileEntity_Windmill.iTextures[1]; } } else { - iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); + GT_TileEntity_Windmill.iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[2]; + ret[i] = GT_TileEntity_Windmill.iTextures[2]; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 13a94b30f0..e19d43a10b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; @@ -43,15 +42,14 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import static gregtech.api.enums.GT_Values.V; public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace { - private int mHeatingCapacity = 0; - private byte glasTier = 0; + private int mHeatingCapacity; + private byte glasTier; private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax; public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { @@ -65,7 +63,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.mbf.0.name").split(";"); String tmp = dsc[dsc.length - 1]; - dsc[dsc.length - 1] = tmp + " " + Integer.toString(20 * this.getPollutionPerTick((ItemStack) null)) + " " + StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); + dsc[dsc.length - 1] = tmp + " " + 20 * this.getPollutionPerTick(null) + " " + StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { fdsc[i] = dsc[i]; @@ -79,8 +77,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return true; long allTheEu = 0; int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) { + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { allTheEu += tHatch.getEUVar(); hatches++; } @@ -88,7 +86,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; long euperhatch = aEU / hatches; HashSet<Boolean> returnset = new HashSet<>(); - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) returnset.add(true); else @@ -113,8 +111,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); - FluidStack[] tFluids = (FluidStack[]) this.getStoredFluids().toArray(new FluidStack[0]); + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -129,7 +127,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl int processed = 0; long nominalV = BW_Util.getnominalVoltage(this); - int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900; long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { @@ -147,7 +145,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } if (found_Recipe) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; byte overclockCount = 0; @@ -158,11 +156,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl actualEUT = actualEUT / 2; divider++; } - overclockCount = calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); + overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); } else - overclockCount = calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); + overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); @@ -200,11 +198,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { //make impossible if too long - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; + this.mEUt = Integer.MAX_VALUE - 1; + this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - mEUt = (int) (aEUt >> 2); - mMaxProgresstime = (int) xMaxProgresstime; + this.mEUt = (int) (aEUt >> 2); + this.mMaxProgresstime = (int) xMaxProgresstime; } //return 0; } else { @@ -213,24 +211,24 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl //Isnt too low EUt check? long tempEUt = xEUt < V[1] ? V[1] : xEUt; - mMaxProgresstime = aDuration; + this.mMaxProgresstime = aDuration; while (tempEUt <= V[mTier - 1]) { tempEUt <<= 2;//this actually controls overclocking //xEUt *= 4;//this is effect of everclocking - mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + this.mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = this.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power timesOverclocked++; } if (xEUt > Integer.MAX_VALUE - 1) { - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; + this.mEUt = Integer.MAX_VALUE - 1; + this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - mEUt = (int) xEUt; - if (mEUt == 0) - mEUt = 1; - if (mMaxProgresstime == 0) - mMaxProgresstime = 1;//set time to 1 tick + this.mEUt = (int) xEUt; + if (this.mEUt == 0) + this.mEUt = 1; + if (this.mMaxProgresstime == 0) + this.mMaxProgresstime = 1;//set time to 1 tick } } return timesOverclocked; @@ -238,41 +236,41 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - mHeatingCapacity = 0; + this.mHeatingCapacity = 0; HashSet<Boolean> ret = new HashSet<Boolean>(); ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11)); ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); for (int y = -1; y < 17; y++) { ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, true, 11)); - if (!getCoilHeat(iGregTechTileEntity, 7, y, 6)) + if (!this.getCoilHeat(iGregTechTileEntity, 7, y, 6)) return false; List<Byte> metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); for (Byte meta : metasFromLayer) { byte inttier = BW_Util.getTierFromGlasMeta(meta); - if (glasTier > 0 && inttier != glasTier) + if (this.glasTier > 0 && inttier != this.glasTier) return false; - else if (glasTier == 0) - glasTier = inttier; + else if (this.glasTier == 0) + this.glasTier = inttier; } } int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; for (int z = -6; z <= 6; z++) for (int x = -6; x <= 6; x++) { - if (!addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) { + if (!this.addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) { return false; } } if (!this.mOutputHatches.isEmpty()) { - for (GT_MetaTileEntity_Hatch_Output hatchOutput : mOutputHatches) + for (GT_MetaTileEntity_Hatch_Output hatchOutput : this.mOutputHatches) if (hatchOutput.getBaseMetaTileEntity().getYCoord() < iGregTechTileEntity.getYCoord()) return false; } - if (glasTier != 8 && !mEnergyHatches.isEmpty()) - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : mEnergyHatches) { - if (glasTier < hatchEnergy.mTier) + if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { + if (this.glasTier < hatchEnergy.mTier) return false; } @@ -319,10 +317,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl default: break; } - if (mHeatingCapacity > 0 && internalH != mHeatingCapacity) + if (this.mHeatingCapacity > 0 && internalH != this.mHeatingCapacity) return false; - else if (mHeatingCapacity == 0) - mHeatingCapacity = internalH; + else if (this.mHeatingCapacity == 0) + this.mHeatingCapacity = internalH; } } return true; @@ -330,7 +328,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public int getPollutionPerTick(ItemStack aStack) { - return polPtick; + return this.polPtick; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java index 56b9197a2d..3c7c1db53d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -40,8 +40,8 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Basi public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { private GT_Recipe mLastRecipe; - private int tTier = 0; - private int mMult = 0; + private int tTier; + private int mMult; private String mMachine = ""; private GT_MetaTileEntity_Hatch_InputBus machineBus; public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { @@ -53,77 +53,77 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process } public boolean checkRecipe(ItemStack aStack) { - if (!isCorrectMachinePart(machineBus.mInventory[0])) { + if (!this.isCorrectMachinePart(this.machineBus.mInventory[0])) { return false; } - GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + GT_Recipe.GT_Recipe_Map map = this.getRecipeMap(); if (map == null) return false; - ArrayList<ItemStack> tInputList = getStoredInputs(); + ArrayList<ItemStack> tInputList = this.getStoredInputs(); - if (mInventory[1].getUnlocalizedName().endsWith("10")) { - tTier = 9; - mMult = 2;//u need 4x less machines and they will use 4x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("11")) { - tTier = 9; - mMult = 4;//u need 16x less machines and they will use 16x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("12") || - mInventory[1].getUnlocalizedName().endsWith("13") || - mInventory[1].getUnlocalizedName().endsWith("14") || - mInventory[1].getUnlocalizedName().endsWith("15")) { - tTier = 9; - mMult = 6;//u need 64x less machines and they will use 64x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("1")) { - tTier = 1; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("2")) { - tTier = 2; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("3")) { - tTier = 3; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("4")) { - tTier = 4; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("5")) { - tTier = 5; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("6")) { - tTier = 6; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("7")) { - tTier = 7; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("8")) { - tTier = 8; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("9")) { - tTier = 9; - mMult = 0;//*1 + if (this.mInventory[1].getUnlocalizedName().endsWith("10")) { + this.tTier = 9; + this.mMult = 2;//u need 4x less machines and they will use 4x less power + } else if (this.mInventory[1].getUnlocalizedName().endsWith("11")) { + this.tTier = 9; + this.mMult = 4;//u need 16x less machines and they will use 16x less power + } else if (this.mInventory[1].getUnlocalizedName().endsWith("12") || + this.mInventory[1].getUnlocalizedName().endsWith("13") || + this.mInventory[1].getUnlocalizedName().endsWith("14") || + this.mInventory[1].getUnlocalizedName().endsWith("15")) { + this.tTier = 9; + this.mMult = 6;//u need 64x less machines and they will use 64x less power + } else if (this.mInventory[1].getUnlocalizedName().endsWith("1")) { + this.tTier = 1; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("2")) { + this.tTier = 2; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("3")) { + this.tTier = 3; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("4")) { + this.tTier = 4; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("5")) { + this.tTier = 5; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("6")) { + this.tTier = 6; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("7")) { + this.tTier = 7; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("8")) { + this.tTier = 8; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("9")) { + this.tTier = 9; + this.mMult = 0;//*1 } else { - tTier = 0; - mMult = 0;//*1 + this.tTier = 0; + this.mMult = 0;//*1 } - if (!mMachine.equals(mInventory[1].getUnlocalizedName())) mLastRecipe = null; - mMachine = mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; + this.mMachine = this.mInventory[1].getUnlocalizedName(); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); - ArrayList<FluidStack> tFluidList = getStoredFluids(); + ArrayList<FluidStack> tFluidList = this.getStoredFluids(); - FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); if (tInputList.size() > 0 || tFluids.length > 0) { - GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); if (tRecipe != null) { if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) + !isValidForLowGravity(tRecipe, this.getBaseMetaTileEntity().getWorld().provider.dimensionId)) return false; - mLastRecipe = tRecipe; + this.mLastRecipe = tRecipe; this.mEUt = 0; this.mOutputItems = null; this.mOutputFluids = null; - int machines = Math.min(64, mInventory[1].stackSize << mMult); //Upped max Cap to 64 + int machines = Math.min(64, this.mInventory[1].stackSize << this.mMult); //Upped max Cap to 64 int i = 0; for (; i < machines; i++) { if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { @@ -134,14 +134,14 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process } } this.mMaxProgresstime = tRecipe.mDuration; - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier], this); + BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[this.tTier], this); //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; - this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> mMult, 1); - if (mEUt == Integer.MAX_VALUE - 1) + this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> this.mMult, 1); + if (this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { @@ -159,7 +159,7 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process for (int f = 0; f < tOut.length; f++) { if (tRecipe.mOutputs[f] != null && tOut[f] != null) { for (int g = 0; g < i; g++) { - if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; } } @@ -168,7 +168,7 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process int tSize = tFOut.amount; tFOut.amount = tSize * i; } - tOut = clean(tOut); + tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); List<ItemStack> overStacks = new ArrayList<ItemStack>(); for (int f = 0; f < tOut.length; f++) { @@ -193,7 +193,7 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process tOut = tSList.toArray(new ItemStack[tSList.size()]); this.mOutputItems = tOut; this.mOutputFluids = new FluidStack[]{tFOut}; - updateSlots(); + this.updateSlots(); return true; }/* else{ ...remoteRecipeCheck() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index a2227eb7a4..3c53ae1b49 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -71,8 +71,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return true; long allTheEu = 0; int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) { + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { allTheEu += tHatch.getEUVar(); hatches++; } @@ -80,7 +80,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return false; long euperhatch = aEU / hatches; HashSet<Boolean> returnset = new HashSet<>(); - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) returnset.add(true); else @@ -90,7 +90,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>(); long tVoltage = this.getMaxInputVoltage(); @@ -112,7 +112,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre } if (found_Recipe) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; if (actualEUT > Integer.MAX_VALUE) { @@ -125,7 +125,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre } else BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index e138445f01..2453610894 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -56,7 +56,7 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene @Override public int getEfficiency() { - return 100 - 3 * mTier; + return 100 - 3 * this.mTier; } @Override @@ -110,6 +110,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index e26b50cdd1..5ca5d59a19 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -54,11 +54,11 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final String MGUINAME = "BW.GUI.BioLab.png"; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + super(aID, aName, aNameRegional, aTier, 1, null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { - super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); + super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, aNEIName); } @Override @@ -83,7 +83,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { - int damage = getSpecialSlot().getItemDamage(); + int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { case 0: if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture @@ -101,7 +101,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); if (this.mTier < rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 8; i++) { if (this.mInventory[i] != null) @@ -116,7 +116,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; case 1: { @@ -133,7 +133,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 8; i++) { if (this.mInventory[i] != null) @@ -154,7 +154,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } @@ -174,7 +174,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 6; i++) { if (this.mInventory[i] != null) this.mInventory[i].stackSize--; @@ -185,7 +185,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } @@ -202,7 +202,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 7; i++) { if (this.mInventory[i] != null) this.mInventory[i].stackSize--; @@ -210,11 +210,11 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 1000; bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(checkForExisting(bioCulture)); + this.mOutputItems[0] = BioItemList.getPetriDish(this.checkForExisting(bioCulture)); } this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } break; @@ -234,7 +234,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 7; i++) { if (this.mInventory[i] != null) this.mInventory[i].stackSize--; @@ -246,7 +246,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = BioItemList.getPetriDish(out); } this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 909d84bb31..8d3d6d1777 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -36,13 +36,13 @@ import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { - private long maxAmps = 0L; - private long aAmps = 0L; + private long maxAmps; + private long aAmps; public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, StatCollector.translateToLocal("tooltip.tile.diode.0.name")); - maxAmps = getAmpsfromMeta(aID); - aAmps = maxAmps; + this.maxAmps = this.getAmpsfromMeta(aID); + this.aAmps = this.maxAmps; } public GT_MetaTileEntity_Diode(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -52,9 +52,9 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { super.onFirstTick(aBaseMetaTileEntity); - if (maxAmps == 0 && !this.getBaseMetaTileEntity().getWorld().isRemote) { - maxAmps = getAmpsfromMeta(this.getBaseMetaTileEntity().getMetaTileID()); - aAmps = maxAmps; + if (this.maxAmps == 0 && !this.getBaseMetaTileEntity().getWorld().isRemote) { + this.maxAmps = this.getAmpsfromMeta(this.getBaseMetaTileEntity().getMetaTileID()); + this.aAmps = this.maxAmps; } } @@ -65,40 +65,40 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; if (!aPlayer.isSneaking()) { - --aAmps; - if (aAmps < 0) - aAmps = maxAmps; - GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + --this.aAmps; + if (this.aAmps < 0) + this.aAmps = this.maxAmps; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); }else{ - ++aAmps; - if (aAmps > maxAmps) - aAmps = 0; - GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + ++this.aAmps; + if (this.aAmps > this.maxAmps) + this.aAmps = 0; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setLong("maxAmp", maxAmps); - aNBT.setLong("Amps", aAmps); + aNBT.setLong("maxAmp", this.maxAmps); + aNBT.setLong("Amps", this.aAmps); } @Override public void loadNBTData(NBTTagCompound aNBT) { - maxAmps = aNBT.getLong("maxAmp"); - aAmps = aNBT.getLong("Amps"); + this.maxAmps = aNBT.getLong("maxAmp"); + this.aAmps = aNBT.getLong("Amps"); super.loadNBTData(aNBT); } @Override public long maxAmperesOut() { - return aAmps; + return this.aAmps; } @Override public long maxAmperesIn() { - return aAmps; + return this.aAmps; } @Override @@ -123,6 +123,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{this.mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index b88c6209a0..c84fbdfd13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -58,21 +58,21 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private short[] colorForGUI; private byte mass; private String material; - private byte coverage = 0; + private byte coverage; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}); - cap = aTier - 2; + this.cap = aTier - 2; } public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); - cap = aTier - 2; + this.cap = aTier - 2; } public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); - cap = aTier - 2; + this.cap = aTier - 2; } public static long calcDecayTicks(int x) { @@ -89,7 +89,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public int getSievert() { - return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) coverage); + return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) this.coverage); } public short[] getColorForGUI() { @@ -127,7 +127,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_RadioHatch(mName, mTier, mDescriptionArray, mTextures); + return new GT_MetaTileEntity_RadioHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -154,16 +154,16 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (this.getBaseMetaTileEntity().isServerSide()) { if (this.mass > 0) - ++timer; + ++this.timer; - if (this.mass > 0 && this.sievert > 0 && calcDecayTicks(this.sievert) > 0) { - if (timer % (calcDecayTicks(this.sievert)) == 0) { + if (this.mass > 0 && this.sievert > 0 && GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) > 0) { + if (this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) == 0) { this.mass--; - if (mass == 0) { - material = StatCollector.translateToLocal("tooltip.bw.empty.name"); - sievert = 0; + if (this.mass == 0) { + this.material = StatCollector.translateToLocal("tooltip.bw.empty.name"); + this.sievert = 0; } - timer = 1; + this.timer = 1; } } @@ -217,13 +217,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if (this.mass + kg <= cap) { + if (this.mass + kg <= this.cap) { this.sievert = calculateSv(materials); this.mass += kg; this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = materials.mColor.mRGBa; - material = materials.mName; + this.updateSlots(); + this.colorForGUI = materials.mColor.mRGBa; + this.material = materials.mName; } } } @@ -235,9 +235,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { this.mass++; this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = null; - material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); + this.updateSlots(); + this.colorForGUI = null; + this.material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); return; } } @@ -255,13 +255,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { //check material for specialised validity if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= cap) { + if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= this.cap) { this.sievert = calculateSv(materials); this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = materials.mColor.mRGBa; - material = materials.mName; + this.updateSlots(); + this.colorForGUI = materials.mColor.mRGBa; + this.material = materials.mName; } } } @@ -280,8 +280,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - if (calcDecayTicks(this.sievert) != 0) - return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + +((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; + if (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) != 0) + return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + +((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; else return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0"}; } @@ -320,13 +320,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mMass", mass); - aNBT.setByte("mSv", (byte) (sievert - 100)); - aNBT.setByte("mCoverage", coverage); - aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(getColorForGUI())); - if (material != null && !material.isEmpty()) - aNBT.setString("mMaterial", material); - aNBT.setLong("timer", timer); + aNBT.setByte("mMass", this.mass); + aNBT.setByte("mSv", (byte) (this.sievert - 100)); + aNBT.setByte("mCoverage", this.coverage); + aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(this.getColorForGUI())); + if (this.material != null && !this.material.isEmpty()) + aNBT.setString("mMaterial", this.material); + aNBT.setLong("timer", this.timer); super.saveNBTData(aNBT); } @@ -336,12 +336,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public void loadNBTData(NBTTagCompound aNBT) { - timer = aNBT.getLong("timer"); - mass = aNBT.getByte("mMass"); - sievert = aNBT.getByte("mSv") + 100; - coverage = aNBT.getByte("mCoverage"); - colorForGUI = BW_ColorUtil.splitColorToRBGArray(aNBT.getInteger("mTextColor")); - material = aNBT.getString("mMaterial"); + this.timer = aNBT.getLong("timer"); + this.mass = aNBT.getByte("mMass"); + this.sievert = aNBT.getByte("mSv") + 100; + this.coverage = aNBT.getByte("mCoverage"); + this.colorForGUI = BW_ColorUtil.splitColorToRBGArray(aNBT.getInteger("mTextColor")); + this.material = aNBT.getString("mMaterial"); super.loadNBTData(aNBT); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 95625ea9f3..5fd9b5b5d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -35,7 +35,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachineBlock { - boolean powered = false; + boolean powered; public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); @@ -91,25 +91,25 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin if (aBaseMetaTileEntity.inputEnergyFrom(side)) { TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side); if (!(tTileEntity instanceof IBasicEnergyContainer)) { - powered = false; + this.powered = false; return; } IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) || !tileAtSide.isUniversalEnergyStored(4L)) { - powered = false; + this.powered = false; return; } if (!tileAtSide.decreaseStoredEnergyUnits(4, false)) { - powered = false; + this.powered = false; return; } if (aBaseMetaTileEntity.injectEnergyUnits(side, 4L, 1L) == 4L) { - powered = true; + this.powered = true; } } if (aBaseMetaTileEntity.isAllowedToWork()) - powered = !powered; + this.powered = !this.powered; } } @@ -124,11 +124,11 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin @Override public long maxAmperesOut() { - return powered ? 1L : 0; + return this.powered ? 1L : 0; } public long maxEUOutput() { - return powered ? GT_Values.V[this.mTier] : 0; + return this.powered ? GT_Values.V[this.mTier] : 0; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 8590f1f713..0dd86aa030 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -37,9 +37,9 @@ import java.awt.*; public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -51,7 +51,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { public void loadCraftingRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { - for (GT_Recipe recipe : getSortedRecipes()) { + for (GT_Recipe recipe : this.getSortedRecipes()) { if (aResult.getTagCompound() != null && recipe != null) for (int i = 0; i < recipe.mOutputs.length; i++) { if (recipe.mOutputs[i] != null) @@ -69,7 +69,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { - for (GT_Recipe recipe : getSortedRecipes()) { + for (GT_Recipe recipe : this.getSortedRecipes()) { if (aResult.getTagCompound() != null && recipe != null) for (int i = 0; i < recipe.mInputs.length; i++) { if (recipe.mInputs[i] != null) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 4cf03fb000..ddf1da1e15 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -42,9 +42,9 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -63,38 +63,38 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { int tSpecial; if (recipeDesc == null) { if (tEUt != 0) { - drawText(10, lines[0], this.trans("152", "Total: ") + (long) tDuration * (long) tEUt + " EU", -16777216); - drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[0], this.trans("152", "Total: ") + (long) tDuration * (long) tEUt + " EU", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); - drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216); } else { - drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); - drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); } } if (tDuration > 0) { - drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float) tDuration), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float) tDuration), -16777216); } tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); - drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { - drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); } else if (tSpecialA[1] == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); } else if (tSpecialA[1] == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); } else if (tSpecialA[1] == -400) { - drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); } } else { tSpecial = 0; @@ -103,7 +103,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { for (int var8 = 0; var8 < var7; ++var8) { String descLine = var6[var8]; - drawText(10, 73 + 10 * tSpecial, descLine, -16777216); + GT_NEI_DefaultHandler.drawText(10, 73 + 10 * tSpecial, descLine, -16777216); ++tSpecial; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 1012cffc01..4f5f1a8cd2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -29,9 +29,9 @@ import codechicken.nei.recipe.TemplateRecipeHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; @@ -47,7 +47,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public BW_NEI_OreHandler() { if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); // GuiUsageRecipe.usagehandlers.add(this); } @@ -60,7 +60,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); } @Override @@ -77,13 +77,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { continue; if (w.getGenerationFeatures().hasOres()) { ItemStack result = w.get(OrePrefixes.ore); - CachedRecipe tmp = new CachedRecipe() { + TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { PositionedStack stack = new PositionedStack(result, 0, 0); @Override public PositionedStack getResult() { - return stack; + return this.stack; } @Override @@ -96,7 +96,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - stack = new PositionedStack(other, 83, 0); + this.stack = new PositionedStack(other, 83, 0); if (((worldGen.bwOres & 0b1000) != 0)) { other = result.copy(); other.setItemDamage(worldGen.mPrimaryMeta); @@ -141,7 +141,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { } }; boolean add = true; - for (TemplateRecipeHandler.CachedRecipe recipe: arecipes) { + for (TemplateRecipeHandler.CachedRecipe recipe: this.arecipes) { if (recipe == null || recipe.getOtherStacks() == null || recipe.getOtherStacks().get(0) == null || recipe.getOtherStacks().get(0).item == null) continue; if (GT_Utility.areStacksEqual(recipe.getOtherStacks().get(0).item,tmp.getOtherStacks().get(0).item)) @@ -173,13 +173,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(ItemStack result) { if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { - CachedRecipe tmp = new CachedRecipe() { + TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { PositionedStack stack = new PositionedStack(result, 0, 0); @Override public PositionedStack getResult() { - return stack; + return this.stack; } @Override @@ -192,7 +192,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - stack = new PositionedStack(other, 83, 0); + this.stack = new PositionedStack(other, 83, 0); if (((worldGen.bwOres & 0b1000) != 0)) { other = result.copy(); other.setItemDamage(worldGen.mPrimaryMeta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index d760f09cea..284fdc973c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -40,11 +40,11 @@ public class NEI_BW_Config implements IConfigureNEI { API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); - sIsAdded = false; + NEI_BW_Config.sIsAdded = false; new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); - sIsAdded = true; + NEI_BW_Config.sIsAdded = true; } @Optional.Method(modid = "NotEnoughItems") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index 121f628df8..f18b34c734 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -42,7 +42,7 @@ public class BW_Container_HeatedWaterPump extends Container { final BW_TileEntity_HeatedWaterPump TILE; final IInventory INVENTORY; public int fuel, water, awater, maxfuel; - long timer = 0; + long timer; byte[] anetfuel, netfuel, anetmaxfuel, netmaxfuel; public BW_Container_HeatedWaterPump(BW_TileEntity_HeatedWaterPump TILE, EntityPlayer INVENTORY) { @@ -77,108 +77,108 @@ public class BW_Container_HeatedWaterPump extends Container { @Override public void detectAndSendChanges() { super.detectAndSendChanges(); - if (TILE.getWorldObj().isRemote) + if (this.TILE.getWorldObj().isRemote) return; - fuel = this.TILE.fuel; - maxfuel = this.TILE.maxfuel; - water = this.TILE.outputstack.amount; - netfuel = ByteBuffer.allocate(8).putInt(fuel).array(); - netmaxfuel = ByteBuffer.allocate(8).putInt(maxfuel).array(); - ++timer; + this.fuel = this.TILE.fuel; + this.maxfuel = this.TILE.maxfuel; + this.water = this.TILE.outputstack.amount; + this.netfuel = ByteBuffer.allocate(8).putInt(this.fuel).array(); + this.netmaxfuel = ByteBuffer.allocate(8).putInt(this.maxfuel).array(); + ++this.timer; Iterator var2 = this.crafters.iterator(); - if (timer >= Long.MAX_VALUE - 1) - timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) + this.timer = 0; while (true) { do { if (!var2.hasNext()) { - netfuel = anetfuel; - netmaxfuel = anetmaxfuel; - water = awater; + this.netfuel = this.anetfuel; + this.netmaxfuel = this.anetmaxfuel; + this.water = this.awater; return; } ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.water != awater) - var1.sendProgressBarUpdate(this, 0, water); - if (this.timer % 500 == 10 || netfuel != anetfuel) - for (int i = 0; i < netfuel.length; i++) { - var1.sendProgressBarUpdate(this, i + 1, netfuel[i]); + if (this.timer % 500 == 10 || this.water != this.awater) + var1.sendProgressBarUpdate(this, 0, this.water); + if (this.timer % 500 == 10 || this.netfuel != this.anetfuel) + for (int i = 0; i < this.netfuel.length; i++) { + var1.sendProgressBarUpdate(this, i + 1, this.netfuel[i]); } - if (this.timer % 500 == 10 || netmaxfuel != anetmaxfuel) - for (int i = 0; i < netmaxfuel.length; i++) { - var1.sendProgressBarUpdate(this, i + 9, netmaxfuel[i]); + if (this.timer % 500 == 10 || this.netmaxfuel != this.anetmaxfuel) + for (int i = 0; i < this.netmaxfuel.length; i++) { + var1.sendProgressBarUpdate(this, i + 9, this.netmaxfuel[i]); } - } while (this.timer % 500 != 10 && this.water != awater); + } while (this.timer % 500 != 10 && this.water != this.awater); } } @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int packetID, int valure) { - if (netfuel == null) - netfuel = new byte[8]; - if (netmaxfuel == null) - netmaxfuel = new byte[8]; + if (this.netfuel == null) + this.netfuel = new byte[8]; + if (this.netmaxfuel == null) + this.netmaxfuel = new byte[8]; switch (packetID) { case 0: { - water = valure; + this.water = valure; this.getSlot(1).putStack(this.getSlot(1).getStack().setStackDisplayName(this.water + "L Water")); break; } case 1: - netfuel[0] = (byte) valure; + this.netfuel[0] = (byte) valure; break; case 2: - netfuel[1] = (byte) valure; + this.netfuel[1] = (byte) valure; break; case 3: - netfuel[2] = (byte) valure; + this.netfuel[2] = (byte) valure; break; case 4: - netfuel[3] = (byte) valure; + this.netfuel[3] = (byte) valure; break; case 5: - netfuel[4] = (byte) valure; + this.netfuel[4] = (byte) valure; break; case 6: - netfuel[5] = (byte) valure; + this.netfuel[5] = (byte) valure; break; case 7: - netfuel[6] = (byte) valure; + this.netfuel[6] = (byte) valure; break; case 8: - netfuel[7] = (byte) valure; + this.netfuel[7] = (byte) valure; break; case 9: - netmaxfuel[0] = (byte) valure; + this.netmaxfuel[0] = (byte) valure; break; case 10: - netmaxfuel[1] = (byte) valure; + this.netmaxfuel[1] = (byte) valure; break; case 11: - netmaxfuel[2] = (byte) valure; + this.netmaxfuel[2] = (byte) valure; break; case 12: - netmaxfuel[3] = (byte) valure; + this.netmaxfuel[3] = (byte) valure; break; case 13: - netmaxfuel[4] = (byte) valure; + this.netmaxfuel[4] = (byte) valure; break; case 14: - netmaxfuel[5] = (byte) valure; + this.netmaxfuel[5] = (byte) valure; break; case 15: - netmaxfuel[6] = (byte) valure; + this.netmaxfuel[6] = (byte) valure; break; case 16: - netmaxfuel[7] = (byte) valure; + this.netmaxfuel[7] = (byte) valure; break; default: break; } if (packetID > 0 && packetID < 9) - this.fuel = ByteBuffer.wrap(netfuel).getInt(); + this.fuel = ByteBuffer.wrap(this.netfuel).getInt(); if (packetID > 8 && packetID < 17) - this.maxfuel = ByteBuffer.wrap(netmaxfuel).getInt(); + this.maxfuel = ByteBuffer.wrap(this.netmaxfuel).getInt(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index b30c3fbbd4..42bdc56e3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -39,7 +39,7 @@ public class BW_Container_RadioHatch extends Container { public byte coverage, dcoverage; long timer; - private GT_MetaTileEntity_RadioHatch iGregTechTileEntity; + private final GT_MetaTileEntity_RadioHatch iGregTechTileEntity; public BW_Container_RadioHatch(InventoryPlayer inventory, IMetaTileEntity iGregTechTileEntity) { this.iGregTechTileEntity = (GT_MetaTileEntity_RadioHatch) iGregTechTileEntity; @@ -112,37 +112,37 @@ public class BW_Container_RadioHatch extends Container { }; for (int i = 0; i < 12; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); + this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); } for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @Override public void detectAndSendChanges() { if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { - coverage = iGregTechTileEntity.getCoverage(); - ++timer; + this.coverage = this.iGregTechTileEntity.getCoverage(); + ++this.timer; Iterator var2 = this.crafters.iterator(); - if (timer >= Long.MAX_VALUE - 1) - timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) + this.timer = 0; while (true) { do { if (!var2.hasNext()) { - dcoverage = coverage; + this.dcoverage = this.coverage; return; } ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.dcoverage != coverage) - var1.sendProgressBarUpdate(this, 0, coverage); - } while (this.timer % 500 != 10 && this.dcoverage != coverage); + if (this.timer % 500 == 10 || this.dcoverage != this.coverage) + var1.sendProgressBarUpdate(this, 0, this.coverage); + } while (this.timer % 500 != 10 && this.dcoverage != this.coverage); } } } @@ -150,7 +150,7 @@ public class BW_Container_RadioHatch extends Container { @Override public void updateProgressBar(int p_75137_1_, int p_75137_2_) { if (p_75137_1_ == 0) - coverage = (byte) p_75137_2_; + this.coverage = (byte) p_75137_2_; } @Override @@ -198,7 +198,7 @@ public class BW_Container_RadioHatch extends Container { setto = 0; } this.iGregTechTileEntity.setCoverage((short) (this.iGregTechTileEntity.getCoverage() + setto)); - detectAndSendChanges(); + this.detectAndSendChanges(); return null; } return super.slotClick(slot, button, aShifthold, entityPlayer); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 65fb30e847..7545d5225a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -47,30 +47,30 @@ public class GT_Container_CircuitProgrammer extends Container { public GT_Container_CircuitProgrammer(InventoryPlayer inventory) { - player = inventory.player; + this.player = inventory.player; - IInventory inv = new pinv(player); + IInventory inv = new pinv(this.player); - addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); + this.addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); for (int i = 1; i < 13; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); + this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); } for (int i = 0; i < 12; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i + 12, -46 + i * 18, 40, false, false, 1)); + this.addSlotToContainer(new GT_Slot_Holo(inv, i + 12, -46 + i * 18, 40, false, false, 1)); } for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 9; i++) { if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) - addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); else - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @@ -80,10 +80,10 @@ public class GT_Container_CircuitProgrammer extends Container { ItemStack iCircuit = GT_Utility.getIntegratedCircuit(slot); iCircuit.stackSize = 1; ((Slot) this.inventorySlots.get(0)).putStack(iCircuit); - detectAndSendChanges(); + this.detectAndSendChanges(); return ((Slot) this.inventorySlots.get(0)).getStack(); } - detectAndSendChanges(); + this.detectAndSendChanges(); return super.slotClick(slot, button, aShifthold, entityPlayer); } @@ -113,7 +113,7 @@ public class GT_Container_CircuitProgrammer extends Container { } } } - detectAndSendChanges(); + this.detectAndSendChanges(); return null; } @@ -125,13 +125,12 @@ public class GT_Container_CircuitProgrammer extends Container { NBTTagCompound tag; public pinv(EntityPlayer Player) { - super(); this.Player = Player; this.toBind = Player.inventory.getCurrentItem(); - tag = this.toBind.getTagCompound(); - if (tag.getBoolean("HasChip")) { - Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); - Slot.stackSize = 1; + this.tag = this.toBind.getTagCompound(); + if (this.tag.getBoolean("HasChip")) { + this.Slot = GT_Utility.getIntegratedCircuit(this.tag.getByte("ChipConfig")); + this.Slot.stackSize = 1; } } @@ -142,60 +141,60 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public ItemStack getStackInSlot(int slot) { - return slot == 0 ? Slot : null; + return slot == 0 ? this.Slot : null; } @Override public ItemStack decrStackSize(int slotNR, int count) { - ItemStack ret = Slot.copy(); - Slot = null; - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", false); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); + ItemStack ret = this.Slot.copy(); + this.Slot = null; + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", false); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); return ret; } @Override public ItemStack getStackInSlotOnClosing(int p_70304_1_) { - return Slot; + return this.Slot; } @Override public void setInventorySlotContents(int slotNR, ItemStack itemStack) { if (itemStack != null && itemStack.getItem() != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { - Slot = itemStack.copy().splitStack(1); + this.Slot = itemStack.copy().splitStack(1); itemStack.stackSize--; - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", true); - tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); - if (!Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) itemStack.getItemDamage())); + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", true); + this.tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); + if (!this.Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) itemStack.getItemDamage())); } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { - Slot = GT_Utility.getIntegratedCircuit(0); - Slot.stackSize = 1; + this.Slot = GT_Utility.getIntegratedCircuit(0); + this.Slot.stackSize = 1; itemStack.stackSize--; - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", true); - tag.setByte("ChipConfig", (byte) 0); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); - if (!Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) 0)); + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", true); + this.tag.setByte("ChipConfig", (byte) 0); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); + if (!this.Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) 0)); }/* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { ForgeHooks.onPlayerTossEvent(Player, itemStack, false); this.closeInventory(); Player.closeScreen(); }*/ else { - ForgeHooks.onPlayerTossEvent(Player, itemStack, false); - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", false); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); - if (!Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), false, (byte) 0)); + ForgeHooks.onPlayerTossEvent(this.Player, itemStack, false); + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", false); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); + if (!this.Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), false, (byte) 0)); } } @@ -236,9 +235,7 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { - if (itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) - return true; - return false; + return itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index b983ea27d7..6d3b86da1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -34,21 +34,21 @@ public class GT_Container_Item_Destructopack extends Container { public GT_Container_Item_Destructopack(InventoryPlayer inventory) { - addSlotToContainer(new BW_DelSlot()); + this.addSlotToContainer(new BW_DelSlot()); for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int aSlotIndex) { - final Slot slotObject = (Slot) this.inventorySlots.get(aSlotIndex); + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int aSlotIndex) { + Slot slotObject = (Slot) this.inventorySlots.get(aSlotIndex); slotObject.putStack(null); return null; } @@ -60,7 +60,7 @@ public class GT_Container_Item_Destructopack extends Container { @Override public void onCraftMatrixChanged(IInventory p_75130_1_) { - final Slot slotObject = (Slot) this.inventorySlots.get(0); + Slot slotObject = (Slot) this.inventorySlots.get(0); slotObject.decrStackSize(0); } }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index 22a3e8ea17..a1cd7505fe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -40,7 +40,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { public short sv, dsv, sievert, r, g, b, dsievert, dr, dg, db; public byte[] teTimer = new byte[8], dteTimer = new byte[8]; GT_MetaTileEntity_RadioHatch TE; - private long timer = 0; + private long timer; public GT_Container_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -49,49 +49,49 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { public void detectAndSendChanges() { super.detectAndSendChanges(); if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { - TE = (GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity(); - mass = TE.getMass(); - sievert = (short) TE.sievert; - short[] rgb = TE.getColorForGUI(); - r = rgb[0]; - g = rgb[1]; - b = rgb[2]; - sv = (short) TE.getSievert(); - teTimer = ByteBuffer.allocate(8).putLong(TE.getTimer()).array(); - ++timer; + this.TE = (GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity(); + this.mass = this.TE.getMass(); + this.sievert = (short) this.TE.sievert; + short[] rgb = this.TE.getColorForGUI(); + this.r = rgb[0]; + this.g = rgb[1]; + this.b = rgb[2]; + this.sv = (short) this.TE.getSievert(); + this.teTimer = ByteBuffer.allocate(8).putLong(this.TE.getTimer()).array(); + ++this.timer; Iterator var2 = this.crafters.iterator(); - if (timer >= Long.MAX_VALUE - 1) - timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) + this.timer = 0; while (true) { do { if (!var2.hasNext()) { - dmass = mass; - dsievert = sievert; - dr = r; - dg = g; - db = b; - dteTimer = teTimer; - dsv = sv; + this.dmass = this.mass; + this.dsievert = this.sievert; + this.dr = this.r; + this.dg = this.g; + this.db = this.b; + this.dteTimer = this.teTimer; + this.dsv = this.sv; return; } ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.dmass != mass) - var1.sendProgressBarUpdate(this, 21, mass); - if (this.timer % 500 == 10 || this.dsievert != sievert) - var1.sendProgressBarUpdate(this, 22, (sievert - 100)); - if (this.timer % 500 == 10 || this.dr != r) - var1.sendProgressBarUpdate(this, 23, r); - if (this.timer % 500 == 10 || this.dg != g) - var1.sendProgressBarUpdate(this, 24, g); - if (this.timer % 500 == 10 || this.db != b) - var1.sendProgressBarUpdate(this, 25, b); - if (this.timer % 500 == 10 || this.dteTimer != teTimer) - for (int i = 0; i < teTimer.length; i++) { - var1.sendProgressBarUpdate(this, 26 + i, teTimer[i]); + if (this.timer % 500 == 10 || this.dmass != this.mass) + var1.sendProgressBarUpdate(this, 21, this.mass); + if (this.timer % 500 == 10 || this.dsievert != this.sievert) + var1.sendProgressBarUpdate(this, 22, (this.sievert - 100)); + if (this.timer % 500 == 10 || this.dr != this.r) + var1.sendProgressBarUpdate(this, 23, this.r); + if (this.timer % 500 == 10 || this.dg != this.g) + var1.sendProgressBarUpdate(this, 24, this.g); + if (this.timer % 500 == 10 || this.db != this.b) + var1.sendProgressBarUpdate(this, 25, this.b); + if (this.timer % 500 == 10 || this.dteTimer != this.teTimer) + for (int i = 0; i < this.teTimer.length; i++) { + var1.sendProgressBarUpdate(this, 26 + i, this.teTimer[i]); } - if (this.timer % 500 == 10 || this.dsv != sv) - var1.sendProgressBarUpdate(this, 34, sv); + if (this.timer % 500 == 10 || this.dsv != this.sv) + var1.sendProgressBarUpdate(this, 34, this.sv); } while (this.timer % 500 != 10 && this.dmass == this.mass); } @@ -104,46 +104,46 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { super.updateProgressBar(par1, par2); switch (par1) { case 21: - mass = (byte) par2; + this.mass = (byte) par2; break; case 22: - sievert = (short) (par2 + 100); + this.sievert = (short) (par2 + 100); break; case 23: - r = (short) par2; + this.r = (short) par2; break; case 24: - g = (short) par2; + this.g = (short) par2; break; case 25: - b = (short) par2; + this.b = (short) par2; break; case 26: - teTimer[0] = (byte) par2; + this.teTimer[0] = (byte) par2; break; case 27: - teTimer[1] = (byte) par2; + this.teTimer[1] = (byte) par2; break; case 28: - teTimer[2] = (byte) par2; + this.teTimer[2] = (byte) par2; break; case 29: - teTimer[3] = (byte) par2; + this.teTimer[3] = (byte) par2; break; case 30: - teTimer[4] = (byte) par2; + this.teTimer[4] = (byte) par2; break; case 31: - teTimer[5] = (byte) par2; + this.teTimer[5] = (byte) par2; break; case 32: - teTimer[6] = (byte) par2; + this.teTimer[6] = (byte) par2; break; case 33: - teTimer[7] = (byte) par2; + this.teTimer[7] = (byte) par2; break; case 34: - sv = (short) par2; + this.sv = (short) par2; break; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java index ba85a38e79..9e832e0820 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java @@ -35,16 +35,16 @@ import java.util.logging.LogRecord; import java.util.logging.Logger; public class DebugLog { - private static boolean init = false; + private static boolean init; private static FileHandler fh; private static Logger utilLog; public DebugLog(FMLPreInitializationEvent event) throws IOException { - if (init) + if (DebugLog.init) return; - fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); - utilLog = Logger.getLogger("DebugLog"); - utilLog.setUseParentHandlers(false); - utilLog.addHandler(fh); + DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); + DebugLog.utilLog = Logger.getLogger("DebugLog"); + DebugLog.utilLog.setUseParentHandlers(false); + DebugLog.utilLog.addHandler(DebugLog.fh); Formatter formatter = new Formatter() { @Override public String format(LogRecord record) { @@ -56,13 +56,13 @@ public class DebugLog { + " " + record.getMessage() + "\n"; } }; - fh.setFormatter(formatter); - init = true; + DebugLog.fh.setFormatter(formatter); + DebugLog.init = true; } public static void log(String record){ - if (!init) + if (!DebugLog.init) return; - utilLog.info(record); + DebugLog.utilLog.info(record); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 4418d72dbd..3fe6337b7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -29,7 +29,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -44,7 +43,7 @@ import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEntity { - public short mMetaData = 0; + public short mMetaData; public static boolean placeOre(World aWorld, Coords coords, Werkstoff werkstoff) { short meta = werkstoff.getmID(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java index 6aa0ab1671..f09bb6f33d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -46,7 +46,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { } public String getUnlocalizedName(ItemStack aStack) { - return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); } public String getItemStackDisplayName(ItemStack aStack) { @@ -64,7 +64,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { } public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { - short tDamage = (short) getDamage(aStack); + short tDamage = (short) this.getDamage(aStack); if (tDamage > 0) { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 3cbd78ac89..7baa3c7090 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -37,14 +37,12 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import ic2.core.IC2Potion; -import ic2.core.item.armor.ItemArmorHazmat; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -74,8 +72,8 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; - this.setCreativeTab(metaTab); - for (int i = 0; i < aNumToGen; i++) { + this.setCreativeTab(BW_MetaGenerated_Items.metaTab); + for (int i = 0; i < this.aNumToGen; i++) { ItemStack tStack = new ItemStack(this, 1, i); Werkstoff w = werkstoffHashMap.get((short) i); if (w == null || ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0) || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) ) @@ -90,7 +88,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } public boolean onEntityItemUpdate(EntityItem aItemEntity) { - if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure || orePrefixes == OrePrefixes.crushed) { + if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); @@ -98,7 +96,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa int tX = MathHelper.floor_double(aItemEntity.posX); int tY = MathHelper.floor_double(aItemEntity.posY); int tZ = MathHelper.floor_double(aItemEntity.posZ); - if ((orePrefixes == OrePrefixes.dustImpure) || (orePrefixes == OrePrefixes.dustPure)) { + if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { @@ -106,7 +104,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } - } else if (orePrefixes == OrePrefixes.crushed) { + } else if (this.orePrefixes == OrePrefixes.crushed) { Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { @@ -126,16 +124,16 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); // if (!tooltip.isEmpty()) // aList.add(tooltip); - if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure) { + if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } - if (orePrefixes == OrePrefixes.crushed) + if (this.orePrefixes == OrePrefixes.crushed) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public String getDefaultLocalization(Werkstoff werkstoff) { - return werkstoff != null ? orePrefixes.mLocalizedMaterialPre + werkstoff.getDefaultName() + orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); + return werkstoff != null ? this.orePrefixes.mLocalizedMaterialPre + werkstoff.getDefaultName() + this.orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); } @Override @@ -145,15 +143,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public final IIconContainer getIconContainer(int aMetaData) { - return werkstoffHashMap.get((short) aMetaData) == null ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[orePrefixes.mTextureIndex]; + return werkstoffHashMap.get((short) aMetaData) == null ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; } @Override @SideOnly(Side.CLIENT) public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { - for (int i = 0; i < aNumToGen; i++) { + for (int i = 0; i < this.aNumToGen; i++) { Werkstoff werkstoff = werkstoffHashMap.get((short) i); - if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) != 0) && ((werkstoff.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) == 0)) { + if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & this.orePrefixes.mMaterialGenerationBits) != 0) && ((werkstoff.getGenerationFeatures().blacklist & this.orePrefixes.mMaterialGenerationBits) == 0)) { ItemStack tStack = new ItemStack(this, 1, i); aList.add(tStack); } @@ -163,7 +161,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public short[] getRGBa(ItemStack aStack) { - Werkstoff werkstoff = werkstoffHashMap.get((short) getDamage(aStack)); + Werkstoff werkstoff = werkstoffHashMap.get((short) this.getDamage(aStack)); return werkstoff == null ? Materials._NULL.mRGBa : werkstoff.getRGBA(); } @@ -195,7 +193,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa Werkstoff tMaterial = werkstoffHashMap.get((short) aMetaData); if (tMaterial == null) return null; - IIconContainer tIcon = getIconContainer(aMetaData); + IIconContainer tIcon = this.getIconContainer(aMetaData); if (tIcon != null) return tIcon.getIcon(); return null; @@ -208,7 +206,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getRadiationLevel(ItemStack aStack) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); return w.getStats().isRadioactive() ? (int) w.getStats().protons : 0; } @@ -219,13 +217,13 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public short[] getColorForGUI(ItemStack aStack) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); return w.getRGBA(); } @Override public String getNameForGUI(ItemStack aStack) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); return w.getDefaultName(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index ba03007669..f09c5f7442 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -60,7 +60,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) continue; GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); } } } @@ -91,7 +91,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } public String getLocalizedName() { - return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); } @Override @@ -131,7 +131,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { public void breakBlock(World world, int x, int y, int z, Block block, int meta) { TileEntity tTileEntity = world.getTileEntity(x, y, z); if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); + BW_MetaGenerated_Ores.mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); } super.breakBlock(world, x, y, z, block, meta); } @@ -141,7 +141,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres); } - return mTemporaryTileEntity.get() == null ? new ArrayList() : ((BW_MetaGeneratedOreTE) mTemporaryTileEntity.get()).getDrops(WerkstoffLoader.BWOres); + return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres); } public int getHarvestLevel(int metadata) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index bb3bea4915..e5467ea8c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -39,17 +39,17 @@ public class ThreadedLoader implements Runnable { public synchronized void run() { MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); MainMod.LOGGER.info("Starting to register BartWorks Materials Recipes to Gregtech"); - threads.add(new AllRecipes()); - threads.forEach(Thread::start); + this.threads.add(new AllRecipes()); + this.threads.forEach(Thread::start); } public synchronized void runInit() { MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); MainMod.LOGGER.info("Starting the Material Generation Thread"); - threadsInit.add(new MaterialGen()); - threadsInit.forEach(Thread::start); - for (Thread thread : threadsInit) { + this.threadsInit.add(new MaterialGen()); + this.threadsInit.forEach(Thread::start); + for (Thread thread : this.threadsInit) { try { MainMod.LOGGER.info("Trying to join the Material Generation Thread"); thread.join(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 754d07055f..ccc1335e6c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -422,7 +422,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.boilingPoint; } - public Stats setBoilingPoint(int boilingPoint) { + public Werkstoff.Stats setBoilingPoint(int boilingPoint) { this.boilingPoint = boilingPoint; return this; } @@ -431,7 +431,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.meltingPoint; } - public Stats setMeltingPoint(int meltingPoint) { + public Werkstoff.Stats setMeltingPoint(int meltingPoint) { this.meltingPoint = meltingPoint; return this; } @@ -445,12 +445,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { //logic gate shit byte quality = ~0b111111; - public Stats setmTC_AspectsArray(Pair<Object, Integer>[] mTC_Aspects) { + public Werkstoff.Stats setmTC_AspectsArray(Pair<Object, Integer>[] mTC_Aspects) { this.mTC_Aspects = mTC_Aspects; return this; } - public Stats setmTC_AspectsVarArg(Pair<Object, Integer>... mTC_Aspects) { + public Werkstoff.Stats setmTC_AspectsVarArg(Pair<Object, Integer>... mTC_Aspects) { this.mTC_Aspects = mTC_Aspects; return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 662cfbea5a..99dce114b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -44,15 +44,16 @@ import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -112,8 +113,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().onlyDust().addGems(), 4, TextureSet.SET_DIAMOND, - Arrays.asList(Zirconium), - new Pair<>(Zirconium, 1), + Arrays.asList(WerkstoffLoader.Zirconium), + new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Oxygen, 2) ); public static final Werkstoff FluorBuergerit = new Werkstoff( @@ -310,8 +311,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().addGems(), 19, TextureSet.SET_GEM_VERTICAL, - Arrays.asList(Zirconium,Materials.Silicon), - new Pair<>(Zirconium, 1), + Arrays.asList(WerkstoffLoader.Zirconium,Materials.Silicon), + new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) ); @@ -604,7 +605,7 @@ public class WerkstoffLoader implements Runnable { } } - public static int toGenerateGlobal = 0b0000000; + public static int toGenerateGlobal; private void addItemsForGeneration() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (OrePrefixes p : values()) @@ -612,20 +613,20 @@ public class WerkstoffLoader implements Runnable { MainMod.LOGGER.info("Found: "+(p+werkstoff.getDefaultName().replaceAll(" ",""))+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } - toGenerateGlobal = (toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); + WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); //System.out.println(werkstoff.getDefaultName()+": "+werkstoff.getGenerationFeatures().toGenerate); } - if ((toGenerateGlobal & 0b1) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { WerkstoffLoader.items.put(dust, new BW_MetaGenerated_Items(dust)); WerkstoffLoader.items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); WerkstoffLoader.items.put(dustSmall, new BW_MetaGenerated_Items(dustSmall)); } - if ((toGenerateGlobal & 0b10) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b10) != 0) { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); } - if ((toGenerateGlobal & 0b100) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b100) != 0) { WerkstoffLoader.items.put(gem, new BW_MetaGenerated_Items(gem)); WerkstoffLoader.items.put(gemChipped, new BW_MetaGenerated_Items(gemChipped)); WerkstoffLoader.items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite)); @@ -633,16 +634,16 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless)); WerkstoffLoader.items.put(lens,new BW_MetaGenerated_Items(lens)); } - if ((toGenerateGlobal & 0b1000) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0) { if (!ConfigHandler.experimentalThreadedLoader) - gameRegistryHandler(); + this.gameRegistryHandler(); WerkstoffLoader.items.put(crushed, new BW_MetaGenerated_Items(crushed)); WerkstoffLoader.items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); WerkstoffLoader.items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); WerkstoffLoader.items.put(dustPure, new BW_MetaGenerated_Items(dustPure)); WerkstoffLoader.items.put(dustImpure, new BW_MetaGenerated_Items(dustImpure)); } - if ((toGenerateGlobal & 0b10000) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); @@ -655,7 +656,7 @@ public class WerkstoffLoader implements Runnable { GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - runGTItemDataRegistrator(); + WerkstoffLoader.runGTItemDataRegistrator(); } public static void runGTItemDataRegistrator(){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index a6345c8736..0c8327ad69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -28,7 +28,6 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -43,7 +42,7 @@ public class AdditionalRecipes implements Runnable { public void run() { //Cubic Circonia GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, (Object) null, (int[]) null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); //Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); //Thorianit recipes diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index 25e3598df0..61a1d33d08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -31,7 +31,7 @@ import java.util.concurrent.ConcurrentHashMap; public class OreDictAdder { - private static ConcurrentHashMap<String, ItemStack> toAddMap = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap<String, ItemStack> toAddMap = new ConcurrentHashMap<>(); public static synchronized void addToMap(Pair<String, ItemStack> element){ OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); @@ -43,7 +43,7 @@ public class OreDictAdder { } public static void addToOreDict(){ - for (Map.Entry<String, ItemStack> entry: toAddMap.entrySet()){ + for (Map.Entry<String, ItemStack> entry: OreDictAdder.toAddMap.entrySet()){ GT_OreDictUnificator.registerOre(entry.getKey(),entry.getValue()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 77578b3c1c..6bc3627e7c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -50,14 +50,14 @@ public class OreDictHandler { } public static void adaptCacheForWorld(){ - Set<String> used = new HashSet<>(cache.keySet()); + Set<String> used = new HashSet<>(OreDictHandler.cache.keySet()); OreDictHandler.cache.clear(); OreDictHandler.cacheNonBW.clear(); for (String s : used) { if (!OreDictionary.getOres(s).isEmpty()) { ItemStack tmpstack = OreDictionary.getOres(s).get(0).copy(); Pair<Integer, Short> p = new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); - cache.put(s, p); + OreDictHandler.cache.put(s, p); for (ItemStack tmp : OreDictionary.getOres(s)) { Pair<Integer, Short> p2 = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); @@ -72,12 +72,12 @@ public class OreDictHandler { } public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ - if (cache.get(prefixes+elementName.replaceAll(" ","")) != null){ - Pair<Integer,Short> p = cache.get(prefixes+elementName.replaceAll(" ","")); + if (OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")) != null){ + Pair<Integer,Short> p = OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")); return new ItemStack(Item.getItemById(p.getKey()),amount,p.getValue()); } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ ItemStack tmp = OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy(); - cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); + OreDictHandler.cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); tmp.stackSize=amount; return tmp; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 7442a9a769..1dc9e080c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -23,8 +23,6 @@ package com.github.bartimaeusnek.bartworks.system.oregen; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -32,9 +30,9 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; import static gregtech.api.enums.Materials.*; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; public class BW_WorldGenRoss128b extends BW_OreLayer { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 8254b44815..39a1ffa5bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -31,9 +31,9 @@ public class GT_WorldgenUtil { private GT_WorldgenUtil() {} - public final static Block GT_TILES = GregTech_API.sBlockMachines; + public static final Block GT_TILES = GregTech_API.sBlockMachines; - public final static short[][] METAFORTIERS_ENERGY = { + public static final short[][] METAFORTIERS_ENERGY = { {100,101,102,105}, //ULV=HPSteam {1110,1115,1120,1127}, {1111,12726,1116,1121,1128}, @@ -41,7 +41,7 @@ public class GT_WorldgenUtil { {12728,1190,1130,12685}, {1191,1174,695,12686}, }; - public final static short[][] METAFORTIERS_BUFFER = { + public static final short[][] METAFORTIERS_BUFFER = { {5133,5123}, //ULV=HPSteam {161,171,181,191}, {162,172,182,192}, @@ -50,7 +50,7 @@ public class GT_WorldgenUtil { {165,175,185,195}, }; //ULV=HPSteam - public final static short[][] METAFORTIERS_CABLE = { + public static final short[][] METAFORTIERS_CABLE = { {5133,5123}, //ULV=HPSteam {1210,1230,1250,1270,1290}, {1310,1330,1350,1370,1390}, @@ -58,7 +58,7 @@ public class GT_WorldgenUtil { {1510,1530,1550,1570,1590}, {1650,1670,1690}, }; - public final static short[][] METAFORTIERS_MACHINE = { + public static final short[][] METAFORTIERS_MACHINE = { {103,104,106,107,109,110,112,113,115,116,118,119}, //ULV=HPSteam {201,211,221,231,241,251,261,271,281,291,301,311,321,331,341,351,361,371,381,391,401,411,421,431,441,451,461,471,481,491,501,511,521,531,541,551,561,571,581,591,601,611,621,631,641,651,661,671}, {}, @@ -67,39 +67,39 @@ public class GT_WorldgenUtil { {}, }; - private static boolean initialisized = false; + private static boolean initialisized; private static void init(){ for (int j = 1; j < 5; j++) { - METAFORTIERS_MACHINE[j+1]=new short[METAFORTIERS_MACHINE[1].length]; - for (int i = 0; i < METAFORTIERS_MACHINE[1].length; i++) { - METAFORTIERS_MACHINE[j+1][i]= (short) (METAFORTIERS_MACHINE[1][i]+j); + GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1]=new short[GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length]; + for (int i = 0; i < GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length; i++) { + GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1][i]= (short) (GT_WorldgenUtil.METAFORTIERS_MACHINE[1][i]+j); } } - initialisized=true; + GT_WorldgenUtil.initialisized =true; } public static short getGenerator(Random rand,int tier){ - short meta = METAFORTIERS_ENERGY[tier][rand.nextInt(METAFORTIERS_ENERGY[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getGenerator(rand,tier); + short meta = GT_WorldgenUtil.METAFORTIERS_ENERGY[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_ENERGY[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getGenerator(rand,tier); } public static short getBuffer(Random rand,int tier){ - short meta = METAFORTIERS_BUFFER[tier][rand.nextInt(METAFORTIERS_BUFFER[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getBuffer(rand,tier); + short meta = GT_WorldgenUtil.METAFORTIERS_BUFFER[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_BUFFER[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getBuffer(rand,tier); } public static short getCable(Random rand,int tier){ - short meta = METAFORTIERS_CABLE[tier][rand.nextInt(METAFORTIERS_CABLE[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getCable(rand,tier); + short meta = GT_WorldgenUtil.METAFORTIERS_CABLE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_CABLE[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getCable(rand,tier); } public static short getMachine(Random rand,int tier){ - if (!initialisized) - init(); - short meta = METAFORTIERS_MACHINE[tier][rand.nextInt(METAFORTIERS_MACHINE[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getMachine(rand,tier); + if (!GT_WorldgenUtil.initialisized) + GT_WorldgenUtil.init(); + short meta = GT_WorldgenUtil.METAFORTIERS_MACHINE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_MACHINE[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getMachine(rand,tier); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 841fe49b12..8c5db993b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -32,19 +32,14 @@ import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; -import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.common.ForgeHooks; -import java.nio.ByteBuffer; import java.security.SecureRandom; import java.util.Random; -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import static net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST; import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; public abstract class MapGenRuins extends WorldGenerator { @@ -57,30 +52,30 @@ public abstract class MapGenRuins extends WorldGenerator { } protected void setFloorBlocks(int[] metas, Block... blocks){ - ToBuildWith[0]=new Pair[metas.length]; + this.ToBuildWith[0]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[0][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[0][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } protected void setWallBlocks(int[] metas,Block... blocks){ - ToBuildWith[1]=new Pair[metas.length]; + this.ToBuildWith[1]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[1][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[1][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } protected void setRoofBlocks(int[] metas,Block... blocks){ - ToBuildWith[2]=new Pair[metas.length]; + this.ToBuildWith[2]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[2][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[2][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } protected void setMiscBlocks(int[] metas,Block... blocks){ - ToBuildWith[3]=new Pair[metas.length]; + this.ToBuildWith[3]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[3][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[3][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } @@ -88,9 +83,9 @@ public abstract class MapGenRuins extends WorldGenerator { protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair<Block,Integer>... blocks){ if (rand.nextInt(100) > airchance) - setRandomBlock(worldObj,x,y,z,rand,blocks); + this.setRandomBlock(worldObj,x,y,z,rand,blocks); else - setBlock(worldObj,x,y,z,Blocks.air,0); + this.setBlock(worldObj,x,y,z,Blocks.air,0); } protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair<Block,Integer>... blocks){ @@ -132,11 +127,11 @@ public abstract class MapGenRuins extends WorldGenerator { y--; } - setFloorBlocks(new int[]{0,0,0},Blocks.brick_block,Blocks.double_stone_slab,Blocks.stonebrick); - setWallBlocks(new int[]{0,1,2,1,1},Blocks.stonebrick); - setRoofBlocks(new int[]{9},Blocks.log); - setMiscBlocks(new int[]{1},Blocks.log); - statBlocks= new int[]{rand.nextInt(ToBuildWith[0].length)}; + this.setFloorBlocks(new int[]{0,0,0},Blocks.brick_block,Blocks.double_stone_slab,Blocks.stonebrick); + this.setWallBlocks(new int[]{0,1,2,1,1},Blocks.stonebrick); + this.setRoofBlocks(new int[]{9},Blocks.log); + this.setMiscBlocks(new int[]{1},Blocks.log); + this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; int colored=rand.nextInt(15); int tier = rand.nextInt(6); boolean useColor = rand.nextBoolean(); @@ -150,40 +145,40 @@ public abstract class MapGenRuins extends WorldGenerator { for (int dz = -6; dz <= 6; dz++) { this.setBlock(worldObj,x+dx,y+dy,z+dz,Blocks.air,0); if (dy == 0){ - Pair<Block,Integer> floor = ToBuildWith[0][statBlocks[0]]; - this.setBlock(worldObj,x+dx,y+dy,z+dz, floor.getKey(),floor.getValue()); + Pair<Block,Integer> floor = this.ToBuildWith[0][this.statBlocks[0]]; + this.setBlock(worldObj,x+dx,y+ 0,z+dz, floor.getKey(),floor.getValue()); } else if (dy > 0 && dy < 4){ if (Math.abs(dx) == 5 && Math.abs(dz) == 5){ - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,5, ToBuildWith[3][0]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,5, this.ToBuildWith[3][0]); } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)){ if (dy == 1) - this.setBlock(worldObj,x+dx,y+dy,z+dz, Blocks.iron_door,1); + this.setBlock(worldObj,x+dx,y+ 1,z+ -5, Blocks.iron_door,1); if (dy == 2) - this.setBlock(worldObj,x+dx,y+dy,z+dz, Blocks.iron_door,8); + this.setBlock(worldObj,x+dx,y+ 2,z+dz, Blocks.iron_door,8); } else if (Math.abs(dx)== 5 && Math.abs(dz) < 5 || Math.abs(dz)== 5 && Math.abs(dx) < 5){ - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); if (dy == 2) { if (rand.nextInt(100)<12) if (useColor) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.stained_glass_pane,colored)); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 2,z+dz,rand,25,new Pair<>(Blocks.stained_glass_pane,colored)); else - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.glass_pane,0)); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.glass_pane,0)); } } if (dy == 3 && Math.abs(dx)== 6){ - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 3,z+dz,rand,25, this.ToBuildWith[2]); } if (dy == 1){ if (dx == 3 && dz == -3){ - setBlock(worldObj,x + dx, y + dy, z + dz,Blocks.crafting_table,0); + this.setBlock(worldObj,x + 3, y + 1, z + dz,Blocks.crafting_table,0); } if (dx == -3 && (dz == -3 || dz == -2)){ - setBlock(worldObj,x + dx, y + dy, z + dz,Blocks.chest,5); + this.setBlock(worldObj,x + -3, y + dy, z + dz,Blocks.chest,5); IInventory chest = (IInventory)worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { WeightedRandomChestContent.generateChestContents(secureRandom, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); @@ -192,7 +187,7 @@ public abstract class MapGenRuins extends WorldGenerator { if (dx == 4 && dz==4) { short meta = GT_WorldgenUtil.getGenerator(secureRandom,tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + 4, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null,meta); BTE.setOwnerName("Ancient Cultures"); @@ -202,28 +197,28 @@ public abstract class MapGenRuins extends WorldGenerator { else if (dx == 3 && dz==4) { if (tier>0) { short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + 3, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); BTE.setFrontFacing((byte) 4); }else{ short meta = cablemeta; - setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair<Block, Integer>(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair<Block, Integer>(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (BTE != null) { BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); BTE.setFrontFacing((byte) 4); BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) 4); - BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) GT_Utility.getOppositeSide(4)); + BTE.mConnections = (byte) (BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); ((MetaPipeEntity) BTE.getMetaTileEntity()).mConnections = BTE.mConnections; } } } else if (dx < 3 && dx > -5 && dz == 4) { short meta = cablemeta; - setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair<Block, Integer>(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + 4, rand, 33, new Pair<Block, Integer>(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (BTE != null) { @@ -231,7 +226,7 @@ public abstract class MapGenRuins extends WorldGenerator { BTE.setOwnerName("Ancient Cultures"); BTE.setFrontFacing((byte) 4); BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)4); - BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte) GT_Utility.getOppositeSide(4)); + BTE.mConnections = (byte)(BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz-1); if (BPE != null) { @@ -244,7 +239,7 @@ public abstract class MapGenRuins extends WorldGenerator { else if (dx < 3 && dx > -5 && dz == 3 && set < toSet){ if (!lastset || treeinaRow > 2) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + dx, y + dy, z + 3, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); @@ -264,31 +259,31 @@ public abstract class MapGenRuins extends WorldGenerator { } else if(dy == 4){ if (Math.abs(dx)== 5) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 4,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 5){ if (Math.abs(dx)== 4) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 5,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 6){ if (Math.abs(dx)== 3) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 6,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 7){ if (Math.abs(dx)== 2) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 7,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 8) { if (Math.abs(dx) == 1 || Math.abs(dx) == 0) - setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); } } } @@ -301,7 +296,7 @@ public abstract class MapGenRuins extends WorldGenerator { if (set < toSet){ if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f7312eeab2..f774989d6a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; -import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; @@ -32,16 +31,18 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import ic2.api.item.IElectricItem; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; -import java.util.*; -import java.util.function.UnaryOperator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; import static gregtech.api.enums.GT_Values.V; @@ -149,7 +150,7 @@ public class BW_Util { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); + return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); } public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { @@ -157,7 +158,7 @@ public class BW_Util { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; + return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; } public static int calculateSv(Materials materials) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 1a0f189fd7..7e35affabf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -29,7 +29,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import java.util.HashSet; -import java.util.LinkedHashSet; public class ConnectedBlocksChecker { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 5effb4a33e..4ae8b0a85e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -53,9 +53,9 @@ public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; public static final String VERSION = "0.0.1"; public static final String MOD_ID = "bartworkscrossmod"; - public static final Logger LOGGER = LogManager.getLogger(NAME); + public static final Logger LOGGER = LogManager.getLogger(BartWorksCrossmod.NAME); - @Mod.Instance(MOD_ID) + @Mod.Instance(BartWorksCrossmod.MOD_ID) public static BartWorksCrossmod instance; @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 1c48eae294..e424b693d2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -61,7 +61,7 @@ public class RadioHatchCompat implements Runnable { private static Object rod; private static Object longRod; - public static HashSet TranslateSet = new HashSet(); + public static HashSet<String> TranslateSet = new HashSet<>(); static{ try { @@ -89,7 +89,7 @@ public class RadioHatchCompat implements Runnable { RadioHatchCompat.localizedName.setAccessible(true); RadioHatchCompat.unlocalizedName.setAccessible(true); - Object[] arr = enu.getEnumConstants(); + Object[] arr = RadioHatchCompat.enu.getEnumConstants(); for (Object o : arr){ if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) break; @@ -110,13 +110,13 @@ public class RadioHatchCompat implements Runnable { try { Class rodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); Class longrodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong"); - Constructor c1 = rodclass.getConstructor(RadioHatchCompat.materialClass); - Constructor c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass); + Constructor<? extends Item> c1 = rodclass.getConstructor(RadioHatchCompat.materialClass); + Constructor<? extends Item> c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass); Field cOwners = GameData.class.getDeclaredField("customOwners"); cOwners.setAccessible(true); Field map = RegistryNamespaced.class.getDeclaredField("field_148758_b"); map.setAccessible(true); - Map<Item,String> UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); + Map<Item,String> UniqueIdentifierMap = (Map<Item, String>) map.get(GameData.getItemRegistry()); Map<GameRegistry.UniqueIdentifier, ModContainer> ownerItems = (Map<GameRegistry.UniqueIdentifier, ModContainer>) cOwners.get(null); ModContainer gtpp = null; @@ -135,7 +135,7 @@ public class RadioHatchCompat implements Runnable { if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { - Item it = (Item) c1.newInstance(mats); + Item it = c1.newInstance(mats); UniqueIdentifierMap.replace(it,"miscutils:"+it.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); ownerItems.replace(ui,bartworks,gtpp); @@ -147,7 +147,7 @@ public class RadioHatchCompat implements Runnable { DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); } if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { - Item it2 = (Item) c2.newInstance(mats); + Item it2 = c2.newInstance(mats); UniqueIdentifierMap.replace(it2,"miscutils:"+it2.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui2 = GameRegistry.findUniqueIdentifierFor(it2); ownerItems.replace(ui2,bartworks,gtpp); @@ -212,7 +212,7 @@ public class RadioHatchCompat implements Runnable { elements.add(RadioHatchCompat.stackMaterial.get(materialStack)); } while (!toCheck.isEmpty()){ - elements.addAll(getElemets(toCheck.poll())); + elements.addAll(GTPPRadAdapter.getElemets(toCheck.poll())); } return elements; } @@ -269,4 +269,4 @@ public class RadioHatchCompat implements Runnable { } } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index e3b8aaf3cf..d30d72bacd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -35,7 +35,7 @@ public class SpaceTab extends CreativeTabs { } public static SpaceTab getInstance() { - return instance; + return SpaceTab.instance; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 483b8f5cf7..08f496edda 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -53,15 +53,15 @@ import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.Ev public class ChunkProviderRoss128b extends ChunkProviderGenerate { XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; - private BW_WordGenerator BWOreGen = new BW_WordGenerator(); - private World worldObj; - private MapGenBase caveGenerator = new MapGenCaves(); - private MapGenBase ravineGenerator = new MapGenRavine(); - private MapGenRuins.RuinsBase ruinsBase = new MapGenRuins.RuinsBase(); + private final BW_WordGenerator BWOreGen = new BW_WordGenerator(); + private final World worldObj; + private final MapGenBase caveGenerator = new MapGenCaves(); + private final MapGenBase ravineGenerator = new MapGenRavine(); + private final MapGenRuins.RuinsBase ruinsBase = new MapGenRuins.RuinsBase(); public ChunkProviderRoss128b(World par1World, long seed, boolean mapFeaturesEnabled) { super(par1World, seed, mapFeaturesEnabled); - worldObj = par1World; + this.worldObj = par1World; } @Override @@ -75,8 +75,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); - for (int i = 0; i < biomesForGeneration.length; i++) { - BiomeGenBase biomeGenBase = biomesForGeneration[i]; + for (int i = 0; i < this.biomesForGeneration.length; i++) { + BiomeGenBase biomeGenBase = this.biomesForGeneration[i]; if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { this.biomesForGeneration[i] = BiomeGenBase.taiga; } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { @@ -115,7 +115,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); } - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); int x1; int y1; @@ -126,11 +126,11 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { x1 = k + this.rand.nextInt(16) + 3; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 3; - ruinsBase.generate(worldObj, rand, x1, y1, z1); + this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1); } if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.rand.nextInt(4) == 0 - && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false, LAKE)) { + && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; @@ -142,7 +142,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { k += 8; l += 8; - boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false, ICE); + boolean doGen = TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, ICE); for (x1 = 0; doGen && x1 < 16; ++x1) { for (y1 = 0; y1 < 16; ++y1) { z1 = this.worldObj.getPrecipitationHeight(k + x1, l + y1); @@ -157,8 +157,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } } - BWOreGen.generate(rand, p_73153_2_, p_73153_3_, worldObj, this, this); - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false)); + this.BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 01bb163283..aa0968a95b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -37,10 +37,10 @@ import java.util.Arrays; public class ChunkProviderRoss128ba extends ChunkProviderMoon { - private XSTR rand = new XSTR(); - private World worldObj; + private final XSTR rand = new XSTR(); + private final World worldObj; private BiomeGenBase[] biomesForGeneration; - private MapGenBaseMeta caveGenerator; + private final MapGenBaseMeta caveGenerator; public ChunkProviderRoss128ba(World world, long seed, boolean mapFeaturesEnabled) { super(world, seed, mapFeaturesEnabled); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 1634ca0f75..121a31bf2f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -26,16 +26,13 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128Ba; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import micdoodle8.mods.galacticraft.core.GalacticraftCore; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.DimensionManager; import java.util.Arrays; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 4974a5725d..b32385e29d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -28,7 +28,7 @@ import java.util.HashMap; public class GT_NBT_DataBase { - private static HashMap<NBTTagCompound, Long> tagToIdMap = new HashMap<>(); + private static final HashMap<NBTTagCompound, Long> tagToIdMap = new HashMap<>(); private static long maxID = Long.MIN_VALUE+1; @@ -43,7 +43,7 @@ public class GT_NBT_DataBase { this.mDataTitle = mDataTitle; this.tagCompound = tagCompound; this.id = GT_NBT_DataBase.maxID; - GT_NBT_DataBase.tagToIdMap.put(tagCompound,id); + GT_NBT_DataBase.tagToIdMap.put(tagCompound, this.id); ++GT_NBT_DataBase.maxID; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 635ceb9fee..9f7c593084 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -38,12 +38,12 @@ import java.util.HashMap; //@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides/*, SimpleComponent*/ { - private static HashMap<Long,GT_NBT_DataBase> OrbDataBase = new HashMap<>(); + private static final HashMap<Long,GT_NBT_DataBase> OrbDataBase = new HashMap<>(); - private ItemStack[] mItems = new ItemStack[2]; + private final ItemStack[] mItems = new ItemStack[2]; - private byte TickTimer = 0; + private byte TickTimer; public String getComponentName() { return "GT-Data Server"; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index 542501ccce..267945116f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -22,15 +22,6 @@ package com.github.bartimaeusnek.crossmod.thaumcraft; -import com.github.bartimaeusnek.bartworks.MainMod; - -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import net.minecraft.util.ResourceLocation; - -import java.lang.reflect.Array; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - public class CustomAspects { // static Constructor aspectConstructor; // static Object TRADE; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 3daa758a88..7911b0c9af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -28,7 +28,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 3d984ed063..ebede8bf4b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -83,7 +83,7 @@ public class ThaumcraftHandler { ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass,int.class); ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi").getMethod("registerObjectTag",ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); - ThaumcraftHandler.AspectAdder.getName = mAspectClass.getMethod("getName"); + ThaumcraftHandler.AspectAdder.getName = AspectAdder.mAspectClass.getMethod("getName"); } catch (ClassNotFoundException | NoSuchMethodException e) { e.printStackTrace(); } @@ -96,7 +96,7 @@ public class ThaumcraftHandler { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Pair a : aspectPair) { if (ConfigHandler.debugLog) - DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + getName.invoke(a.getKey()) + " / " + a.getValue()); + DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); |