diff options
10 files changed, 97 insertions, 96 deletions
diff --git a/src/main/java/com/github/technus/tectech/nei/IMCForNEI.java b/src/main/java/com/github/technus/tectech/nei/IMCForNEI.java index d01ecfc2d8..b36b15b619 100644 --- a/src/main/java/com/github/technus/tectech/nei/IMCForNEI.java +++ b/src/main/java/com/github/technus/tectech/nei/IMCForNEI.java @@ -1,9 +1,12 @@ package com.github.technus.tectech.nei; +import com.github.technus.tectech.TecTech; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.event.FMLInterModComms; import net.minecraft.nbt.NBTTagCompound; +import static com.github.technus.tectech.Reference.MODID; + public class IMCForNEI { public static void IMCSender() { @@ -17,8 +20,8 @@ public class IMCForNEI { private static void sendHandler(String aName, String aBlock, int aMaxRecipesPerPage) { NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setString("handler", aName); - aNBT.setString("modName", "GregTech"); - aNBT.setString("modId", "gregtech"); + aNBT.setString("modName", MODID); + aNBT.setString("modId", MODID); aNBT.setBoolean("modRequired", true); aNBT.setString("itemName", aBlock); aNBT.setInteger("handlerHeight", 135); diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 9a5c8cdbfa..e6b2d0930c 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -31,15 +31,10 @@ public class ClientProxy extends CommonProxy { QuantumGlassBlock.renderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(QuantumGlassBlock.renderID, new QuantumGlassRender()); - // QuantumStuffBlock.renderID = RenderingRegistry.getNextAvailableRenderId(); - // RenderingRegistry.registerBlockHandler(QuantumStuffBlock.renderID, new QuantumStuffRender()); - MinecraftForgeClient.registerItemRenderer( ElementalDefinitionContainer_EM.INSTANCE, RenderElementalName.INSTANCE); MinecraftForgeClient.registerItemRenderer( DebugElementalInstanceContainer_EM.INSTANCE, RenderElementalName.INSTANCE); - // MinecraftForgeClient.registerItemRenderer(ElementalDefinitionScanStorage_EM.INSTANCE, - // RenderElementalName.INSTANCE); if (Loader.isModLoaded("openmodularturrets")) { new TT_turret_loader().run(); diff --git a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java index 355f082a02..807663c9bb 100644 --- a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java @@ -223,13 +223,13 @@ public class EyeOfHarmonyRecipe { return recipeTriggerItem; } - static final double primaryMultiplier = (0.1 + 1.0 / 9.0); // Byproduct from macerating/washing chance. - static final double secondaryMultiplier = (1.0 / 9.0); // Thermal centrifuge byproduct chance. - static final double tertiaryMultiplier = (0.1); // Macerating thermal centrifuged byproduct chance. - static final double quaternaryMultiplier = (0.7); // Mercury/chem bath processing chance. + private static final double PRIMARY_MULTIPLIER = (0.1 + 1.0 / 9.0); // Byproduct from macerating/washing chance. + private static final double SECONDARY_MULTIPLIER = (1.0 / 9.0); // Thermal centrifuge byproduct chance. + private static final double TERTIARY_MULTIPLIER = (0.1); // Macerating thermal centrifuged byproduct chance. + private static final double QUATERNARY_MULTIPLIER = (0.7); // Mercury/chem bath processing chance. - static final double[] oreMultiplier = { - primaryMultiplier, secondaryMultiplier, tertiaryMultiplier, quaternaryMultiplier + private static final double[] ORE_MULTIPLIER = { + PRIMARY_MULTIPLIER, SECONDARY_MULTIPLIER, TERTIARY_MULTIPLIER, QUATERNARY_MULTIPLIER }; public static class HashMapHelper extends HashMap<Materials, Double> { @@ -254,7 +254,7 @@ public class EyeOfHarmonyRecipe { int index = 0; for (Materials byProductMaterial : material.mOreByProducts) { outputMap.add( - byProductMaterial.mDirectSmelting, mainMultiplier * (oreMultiplier[index++] * 2) * probability); + byProductMaterial.mDirectSmelting, mainMultiplier * (ORE_MULTIPLIER[index++] * 2) * probability); } } @@ -290,7 +290,7 @@ public class EyeOfHarmonyRecipe { ArrayList<FluidStack> plasmaList = new ArrayList<>(); for (Pair<Materials, Long> pair : planetList) { - if (validPlasmas.contains(pair.getLeft())) { + if (VALID_PLASMAS.contains(pair.getLeft())) { plasmaList.add(pair.getLeft().getPlasma(1)); } } @@ -331,7 +331,7 @@ public class EyeOfHarmonyRecipe { return 3.85; } - private static final List<Materials> validPlasmas = Stream.of( + private static final List<Materials> VALID_PLASMAS = Stream.of( Materials.Helium, Materials.Iron, Materials.Calcium, @@ -352,7 +352,7 @@ public class EyeOfHarmonyRecipe { private static final HashMap<String, Long> plasmaEnergyMap = new HashMap<String, Long>() { { - validPlasmas.forEach( + VALID_PLASMAS.forEach( (material -> put(material.getPlasma(1).getFluid().getUnlocalizedName(), (long) (getPlasmaFuelValueInEUPerLiterFromMaterial(material) * getMaxPlasmaTurbineEfficiency())))); } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index 088c9bf2b0..c8e0b048fe 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -6,6 +6,7 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; import static gregtech.api.util.GT_Utility.formatNumbers; import static java.lang.Math.min; import static net.minecraft.util.EnumChatFormatting.*; +import static net.minecraft.util.StatCollector.translateToLocal; import appeng.util.ReadableNumberConverter; import codechicken.nei.PositionedStack; @@ -551,30 +552,30 @@ public class TT_recipe extends GT_Recipe { EyeOfHarmonyRecipe recipe = (EyeOfHarmonyRecipe) recipeInfo.recipe.mSpecialItems; List<String> result = new ArrayList<>(); - result.add("Hydrogen: " + formatNumbers(recipe.getHydrogenRequirement()) + " L"); - result.add("Helium: " + formatNumbers(recipe.getHydrogenRequirement()) + " L"); - result.add("Spacetime Tier: " + EOH_TIER_FANCY_NAMES[(int) recipe.getSpacetimeCasingTierRequired()]); + result.add(translateToLocal("Hydrogen: ") + formatNumbers(recipe.getHydrogenRequirement()) + " L"); + result.add(translateToLocal("Helium: ") + formatNumbers(recipe.getHydrogenRequirement()) + " L"); + result.add(translateToLocal("Spacetime Tier: ") + translateToLocal(EOH_TIER_FANCY_NAMES[(int) recipe.getSpacetimeCasingTierRequired()])); if (recipe.getEUOutput() < TRILLION) { - result.add("EU Output: " + formatNumbers(recipe.getEUOutput()) + " EU"); + result.add(translateToLocal("EU Output: ") + formatNumbers(recipe.getEUOutput()) + " EU"); } else { - result.add("EU Output: " + ReadableNumberConverter.INSTANCE.toWideReadableForm(recipe.getEUOutput()) - + " EU"); + result.add(translateToLocal("EU Output: ") + ReadableNumberConverter.INSTANCE.toWideReadableForm(recipe.getEUOutput()) + + translateToLocal(" EU")); } if (recipe.getEUOutput() < TRILLION) { - result.add("EU Input: " + formatNumbers(recipe.getEUStartCost()) + " EU"); + result.add(translateToLocal("EU Input: ") + formatNumbers(recipe.getEUStartCost()) + translateToLocal(" EU")); } else { - result.add("EU Input: " - + ReadableNumberConverter.INSTANCE.toWideReadableForm(recipe.getEUStartCost()) + " EU"); + result.add(translateToLocal("EU Input: ") + + ReadableNumberConverter.INSTANCE.toWideReadableForm(recipe.getEUStartCost()) + translateToLocal(" EU")); } - result.add("Base Recipe Chance: " + formatNumbers(100 * recipe.getBaseRecipeSuccessChance()) + "%"); + result.add(translateToLocal("Base Recipe Chance: ") + formatNumbers(100 * recipe.getBaseRecipeSuccessChance()) + "%"); result.add( - "Recipe Energy Efficiency: " + formatNumbers(100 * recipe.getRecipeEnergyEfficiency()) + "%"); + translateToLocal("Recipe Energy Efficiency: ") + formatNumbers(100 * recipe.getRecipeEnergyEfficiency()) + "%"); if (recipe.getOutputItems().size() > maxItemsToRender) { - result.add("" + DARK_RED + BOLD + "Warning" + RESET + ": Not all items displayed."); + result.add("" + DARK_RED + BOLD + translateToLocal("Warning") + RESET + translateToLocal(": Not all items displayed.")); } return result; @@ -654,7 +655,7 @@ public class TT_recipe extends GT_Recipe { // Draw tooltip on planet item. if (stack.isItemEqual(currentRecipe.getRecipeTriggerItem())) { currentTip.add( - EnumChatFormatting.GRAY + "Total Items: " + formatNumbers(currentRecipe.getSumOfItems())); + EnumChatFormatting.GRAY + translateToLocal("Total Items: ") + formatNumbers(currentRecipe.getSumOfItems())); return currentTip; } @@ -662,8 +663,8 @@ public class TT_recipe extends GT_Recipe { double percentage = currentRecipe.getItemStackToProbabilityMap().getOrDefault(stack, -1.0); if (percentage != -1.0) { - currentTip.add(EnumChatFormatting.GRAY + "Percentage of Solid Mass: " + percentage + "%"); - currentTip.add(EnumChatFormatting.GRAY + "Item Count: " + currentTip.add(EnumChatFormatting.GRAY + translateToLocal("Percentage of Solid Mass: ") + percentage + "%"); + currentTip.add(EnumChatFormatting.GRAY + translateToLocal("Item Count: ") + formatNumbers( currentRecipe.getItemStackToTrueStackSizeMap().get(stack))); } @@ -677,7 +678,7 @@ public class TT_recipe extends GT_Recipe { for (PositionedStack stack : neiCachedRecipe.mInputs) { if (stack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { if (stack.item.isItemEqual(EOHRecipe.getRecipeTriggerItem())) { - drawNEIOverlayText("NC", stack); + drawNEIOverlayText(translateToLocal("NC"), stack); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java index 68548cb53e..81cafff41d 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java +++ b/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java @@ -17,9 +17,9 @@ import org.lwjgl.opengl.GL11; public class RenderEyeOfHarmony extends TileEntitySpecialRenderer { - private static final ResourceLocation starLayer0 = new ResourceLocation(MODID, "models/StarLayer0.png"); - private static final ResourceLocation starLayer1 = new ResourceLocation(MODID, "models/StarLayer1.png"); - private static final ResourceLocation starLayer2 = new ResourceLocation(MODID, "models/StarLayer2.png"); + private static final ResourceLocation STAR_LAYER_0 = new ResourceLocation(MODID, "models/StarLayer0.png"); + private static final ResourceLocation STAR_LAYER_1 = new ResourceLocation(MODID, "models/StarLayer1.png"); + private static final ResourceLocation STAR_LAYER_2 = new ResourceLocation(MODID, "models/StarLayer2.png"); private static IModelCustom starModel; private static IModelCustom spaceModel; @@ -44,9 +44,9 @@ public class RenderEyeOfHarmony extends TileEntitySpecialRenderer { renderOrbitObjects(EOHRenderTile); // Render star stuff. - renderStarLayer(EOHRenderTile, 0, starLayer0, 1.0f); - renderStarLayer(EOHRenderTile, 1, starLayer1, 0.4f); - renderStarLayer(EOHRenderTile, 2, starLayer2, 0.2f); + renderStarLayer(EOHRenderTile, 0, STAR_LAYER_0, 1.0f); + renderStarLayer(EOHRenderTile, 1, STAR_LAYER_1, 0.4f); + renderStarLayer(EOHRenderTile, 2, STAR_LAYER_2, 0.2f); GL11.glPopMatrix(); } @@ -72,7 +72,7 @@ public class RenderEyeOfHarmony extends TileEntitySpecialRenderer { GL11.glRotatef(orbitingObject.zAngle, 0, 0, 1); GL11.glRotatef(orbitingObject.xAngle, 1, 0, 0); GL11.glRotatef((orbitingObject.rotationSpeed * 0.1f * EOHRenderTile.angle) % 360.0f, 0F, 1F, 0F); - GL11.glTranslated(-0.2 - orbitingObject.distance - starRescale * EOHRenderTile.getSize(), 0, 0); + GL11.glTranslated(-0.2 - orbitingObject.distance - STAR_RESCALE * EOHRenderTile.getSize(), 0, 0); GL11.glRotatef((orbitingObject.orbitSpeed * 0.1f * EOHRenderTile.angle) % 360.0f, 0F, 1F, 0F); renderBlockInWorld(orbitingObject.block, 0, orbitingObject.scale); GL11.glPopMatrix(); @@ -111,7 +111,7 @@ public class RenderEyeOfHarmony extends TileEntitySpecialRenderer { GL11.glPopMatrix(); } - private static final float starRescale = 0.2f; + private static final float STAR_RESCALE = 0.2f; private void renderStarLayer(TileEyeOfHarmony EOHRenderTile, int layer, ResourceLocation texture, float alpha) { @@ -134,7 +134,7 @@ public class RenderEyeOfHarmony extends TileEntitySpecialRenderer { // 0.01f magic number to shrink sphere obj down. // Size obtained from the multis current recipe. - float scale = 0.01f * starRescale * EOHRenderTile.getSize(); + float scale = 0.01f * STAR_RESCALE * EOHRenderTile.getSize(); // Put each subsequent layer further out. scale *= pow(1.04f, layer); diff --git a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java index 1d16bef0fb..192c70a1c5 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java +++ b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java @@ -124,7 +124,7 @@ public class TileEyeOfHarmony extends TileEntity { BLOCKS.keySet().removeAll(BLACKLISTED_BLOCKS); } - private static final float maxAngle = 30; + private static final float MAX_ANGLE = 30; // This must be set last. public void generateImportantInfo() { @@ -132,8 +132,8 @@ public class TileEyeOfHarmony extends TileEntity { int index = 0; for (Block block : selectNRandomElements(BLOCKS.values(), tier + 1)) { - float xAngle = generateRandomFloat(-maxAngle, maxAngle); - float zAngle = generateRandomFloat(-maxAngle, maxAngle); + float xAngle = generateRandomFloat(-MAX_ANGLE, MAX_ANGLE); + float zAngle = generateRandomFloat(-MAX_ANGLE, MAX_ANGLE); index += 1.0; float distance = index + generateRandomFloat(-0.2f, 0.2f); float scale = generateRandomFloat(0.2f, 0.9f); @@ -143,20 +143,22 @@ public class TileEyeOfHarmony extends TileEntity { } } + // Used to track the rotation of the star/planets. public float angle; - private static final String EOHNBTTag = "EOH:"; - private static final String rotationSpeedNBTTag = EOHNBTTag + "rotationSpeed"; - private static final String sizeNBTTag = EOHNBTTag + "size"; - private static final String tierNBTTag = EOHNBTTag + "tier"; + + private static final String EOH_NBT_TAG = "EOH:"; + private static final String ROTATION_SPEED_NBT_TAG = EOH_NBT_TAG + "rotationSpeed"; + private static final String SIZE_NBT_TAG = EOH_NBT_TAG + "size"; + private static final String TIER_NBT_TAG = EOH_NBT_TAG + "tier"; @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); // Save other stats. - compound.setFloat(rotationSpeedNBTTag, rotationSpeed); - compound.setFloat(sizeNBTTag, size); - compound.setLong(tierNBTTag, tier); + compound.setFloat(ROTATION_SPEED_NBT_TAG, rotationSpeed); + compound.setFloat(SIZE_NBT_TAG, size); + compound.setLong(TIER_NBT_TAG, tier); } @Override @@ -164,9 +166,9 @@ public class TileEyeOfHarmony extends TileEntity { super.readFromNBT(compound); // Load other stats. - rotationSpeed = compound.getFloat(rotationSpeedNBTTag); - size = compound.getFloat(sizeNBTTag); - tier = compound.getLong(tierNBTTag); + rotationSpeed = compound.getFloat(ROTATION_SPEED_NBT_TAG); + size = compound.getFloat(SIZE_NBT_TAG); + tier = compound.getLong(TIER_NBT_TAG); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java b/src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java index a9b49dbdd8..204c559f14 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java @@ -31,7 +31,7 @@ public class SpacetimeCompressionFieldCasing extends GT_Block_Casings_Abstract { private static IIcon textureTier6; private static IIcon textureTier7; private static IIcon textureTier8; - private static final int maxBlockTier = 9; + private static final int MAX_BLOCK_TIER = 9; private static final byte START_INDEX = 16; @@ -45,7 +45,7 @@ public class SpacetimeCompressionFieldCasing extends GT_Block_Casings_Abstract { new GT_CopiedBlockTexture(this, 6, b); } - for (int i = 0; i < maxBlockTier; i++) { + for (int i = 0; i < MAX_BLOCK_TIER; i++) { GT_LanguageManager.addStringLocalization( getUnlocalizedName() + "." + i + ".name", WHITE + EOH_TIER_FANCY_NAMES[i] + RESET + " Spacetime Compression Field Generator"); @@ -111,7 +111,7 @@ public class SpacetimeCompressionFieldCasing extends GT_Block_Casings_Abstract { @SuppressWarnings("unchecked") @Override public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { - for (int i = 0; i < maxBlockTier; i++) { + for (int i = 0; i < MAX_BLOCK_TIER; i++) { aList.add(new ItemStack(aItem, 1, i)); } } diff --git a/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java b/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java index 23df243dd8..a159128d72 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java @@ -31,7 +31,7 @@ public class StabilisationFieldCasing extends GT_Block_Casings_Abstract { private static IIcon textureTier6; private static IIcon textureTier7; private static IIcon textureTier8; - private static final int maxBlockTier = 9; + private static final int MAX_BLOCK_TIER = 9; private static final byte START_INDEX = 16; @@ -42,7 +42,7 @@ public class StabilisationFieldCasing extends GT_Block_Casings_Abstract { new GT_CopiedBlockTexture(this, 6, b); } - for (int i = 0; i < maxBlockTier; i++) { + for (int i = 0; i < MAX_BLOCK_TIER; i++) { GT_LanguageManager.addStringLocalization( getUnlocalizedName() + "." + i + ".name", WHITE + EOH_TIER_FANCY_NAMES[i] + RESET + " Stabilisation Field Generator"); @@ -108,7 +108,7 @@ public class StabilisationFieldCasing extends GT_Block_Casings_Abstract { @SuppressWarnings("unchecked") @Override public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { - for (int i = 0; i < maxBlockTier; i++) { + for (int i = 0; i < MAX_BLOCK_TIER; i++) { aList.add(new ItemStack(aItem, 1, i)); } } diff --git a/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java b/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java index 824e3de20e..cebcb47f50 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java @@ -31,7 +31,7 @@ public class TimeAccelerationFieldCasing extends GT_Block_Casings_Abstract { private static IIcon textureTier6; private static IIcon textureTier7; private static IIcon textureTier8; - private static final int maxBlockTier = 9; + private static final int MAX_BLOCK_TIER = 9; private static final byte START_INDEX = 16; @@ -45,7 +45,7 @@ public class TimeAccelerationFieldCasing extends GT_Block_Casings_Abstract { new GT_CopiedBlockTexture(this, 6, b); } - for (int i = 0; i < maxBlockTier; i++) { + for (int i = 0; i < MAX_BLOCK_TIER; i++) { GT_LanguageManager.addStringLocalization( getUnlocalizedName() + "." + i + ".name", WHITE + EOH_TIER_FANCY_NAMES[i] + RESET + " Time Dilation Field Generator"); @@ -111,7 +111,7 @@ public class TimeAccelerationFieldCasing extends GT_Block_Casings_Abstract { @SuppressWarnings("unchecked") @Override public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { - for (int i = 0; i < maxBlockTier; i++) { + for (int i = 0; i < MAX_BLOCK_TIER; i++) { aList.add(new ItemStack(aItem, 1, i)); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java index 5c3009c794..b0b7b2fd2d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java @@ -57,7 +57,7 @@ import org.spongepowered.libraries.com.google.common.math.LongMath; public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable, IGlobalWirelessEnergy, ISurvivalConstructable { - private static final boolean EOHDebugMode = false; + private static final boolean EOH_DEBUG_MODE = false; // Region variables. private static Textures.BlockIcons.CustomIcon ScreenOFF; @@ -67,7 +67,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl private int timeAccelerationFieldMetadata = -1; private int stabilisationFieldMetadata = -1; - private static final double spacetimeCasingDifferenceDiscountPercentage = 0.03; + private static final double SPACETIME_CASING_DIFFERENCE_DISCOUNT_PERCENTAGE = 0.03; private String userUUID = ""; private String userName = ""; @@ -1392,7 +1392,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl private double hydrogenOverflowProbabilityAdjustment; private double heliumOverflowProbabilityAdjustment; - private static final long ticksBetweenHatchDrain = EOHDebugMode ? 20 : 200; + private static final long TICKS_BETWEEN_HATCH_DRAIN = EOH_DEBUG_MODE ? 20 : 200; private List<ItemStackLong> outputItems = new ArrayList<>(); @@ -1445,7 +1445,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl long spacetimeCasingDifference = (recipeSpacetimeCasingRequired - spacetimeCompressionFieldMetadata); double recipeTimeDiscounted = recipeTime * pow(2.0, -timeAccelerationFieldMetadata) - * pow(1 - spacetimeCasingDifferenceDiscountPercentage, spacetimeCasingDifference); + * pow(1 - SPACETIME_CASING_DIFFERENCE_DISCOUNT_PERCENTAGE, spacetimeCasingDifference); return (int) Math.max(recipeTimeDiscounted, 1.0); } @@ -1662,7 +1662,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl private long lagPreventer = 0; // Check for recipe every recipeCheckInterval ticks. - private static final long recipeCheckInterval = 3 * 20; + private static final long RECIPE_CHECK_INTERVAL = 3 * 20; @Override public boolean checkRecipe_EM(ItemStack aStack) { @@ -1671,7 +1671,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl } lagPreventer++; - if (lagPreventer < recipeCheckInterval) { + if (lagPreventer < RECIPE_CHECK_INTERVAL) { lagPreventer = 0; // No item in multi gui slot. @@ -1696,7 +1696,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl public boolean processRecipe(EyeOfHarmonyRecipe recipeObject) { // Debug mode, overwrites the required fluids to initiate the recipe to 100L of each. - if (EOHDebugMode) { + if (EOH_DEBUG_MODE) { if ((getHydrogenStored() < 100) || (getHeliumStored() < 100)) { return false; } @@ -1723,7 +1723,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl calculateHydrogenHeliumInputExcessValues( recipeObject.getHydrogenRequirement(), recipeObject.getHeliumRequirement()); - if (EOHDebugMode) { + if (EOH_DEBUG_MODE) { hydrogenOverflowProbabilityAdjustment = 0; heliumOverflowProbabilityAdjustment = 0; } @@ -1738,7 +1738,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl validFluidMap.put(Materials.Helium.getGas(1), 0L); double yield = recipeYieldCalculator(); - if (EOHDebugMode) { + if (EOH_DEBUG_MODE) { successChance = 1; // Debug recipes, sets them to 100% output chance. } @@ -1869,7 +1869,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl } if (!recipeRunning) { - if ((aTick % ticksBetweenHatchDrain) == 0) { + if ((aTick % TICKS_BETWEEN_HATCH_DRAIN) == 0) { drainFluidFromHatchesAndStoreInternally(); } } @@ -1941,42 +1941,42 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl } // NBT save/load strings. - private static final String eyeOfHarmony = "eyeOfHarmonyOutput"; - private static final String numberOfItemsNBTTag = eyeOfHarmony + "numberOfItems"; - private static final String itemOutputNBTTag = eyeOfHarmony + "itemOutput"; - private static final String recipeRunningNBTTag = eyeOfHarmony + "recipeRunning"; - private static final String recipeEUOutputNBTTag = eyeOfHarmony + "euOutput"; - private static final String recipeSuccessChanceNBTTag = eyeOfHarmony + "recipeSuccessChance"; + private static final String EYE_OF_HARMONY = "eyeOfHarmonyOutput"; + private static final String NUMBER_OF_ITEMS_NBT_TAG = EYE_OF_HARMONY + "numberOfItems"; + private static final String ITEM_OUTPUT_NBT_TAG = EYE_OF_HARMONY + "itemOutput"; + private static final String RECIPE_RUNNING_NBT_TAG = EYE_OF_HARMONY + "recipeRunning"; + private static final String RECIPE_EU_OUTPUT_NBT_TAG = EYE_OF_HARMONY + "euOutput"; + private static final String RECIPE_SUCCESS_CHANCE_NBT_TAG = EYE_OF_HARMONY + "recipeSuccessChance"; // Sub tags, less specific names required. - private static final String stackSizeNBTTag = "stackSize"; - private static final String itemStackNBTTag = "itemStack"; + private static final String STACK_SIZE = "stackSize"; + private static final String ITEM_STACK_NBT_TAG = "itemStack"; @Override public void saveNBTData(NBTTagCompound aNBT) { // Save the quantity of fluid stored inside the controller. validFluidMap.forEach((key, value) -> aNBT.setLong("stored." + key.getUnlocalizedName(), value)); - aNBT.setBoolean(recipeRunningNBTTag, recipeRunning); - aNBT.setLong(recipeEUOutputNBTTag, euOutput); - aNBT.setDouble(recipeSuccessChanceNBTTag, successChance); + aNBT.setBoolean(RECIPE_RUNNING_NBT_TAG, recipeRunning); + aNBT.setLong(RECIPE_EU_OUTPUT_NBT_TAG, euOutput); + aNBT.setDouble(RECIPE_SUCCESS_CHANCE_NBT_TAG, successChance); // Store damage values/stack sizes of GT items being outputted. NBTTagCompound itemStackListNBTTag = new NBTTagCompound(); - itemStackListNBTTag.setLong(numberOfItemsNBTTag, outputItems.size()); + itemStackListNBTTag.setLong(NUMBER_OF_ITEMS_NBT_TAG, outputItems.size()); int index = 0; for (ItemStackLong itemStackLong : outputItems) { // Save stack size to NBT. - itemStackListNBTTag.setLong(index + stackSizeNBTTag, itemStackLong.stackSize); + itemStackListNBTTag.setLong(index + STACK_SIZE, itemStackLong.stackSize); // Save ItemStack to NBT. - aNBT.setTag(index + itemStackNBTTag, itemStackLong.itemStack.writeToNBT(new NBTTagCompound())); + aNBT.setTag(index + ITEM_STACK_NBT_TAG, itemStackLong.itemStack.writeToNBT(new NBTTagCompound())); index++; } - aNBT.setTag(itemOutputNBTTag, itemStackListNBTTag); + aNBT.setTag(ITEM_OUTPUT_NBT_TAG, itemStackListNBTTag); super.saveNBTData(aNBT); } @@ -1989,21 +1989,21 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl (key, value) -> validFluidMap.put(key, aNBT.getLong("stored." + key.getUnlocalizedName()))); // Load other stuff from NBT. - recipeRunning = aNBT.getBoolean(recipeRunningNBTTag); - euOutput = aNBT.getLong(recipeEUOutputNBTTag); - successChance = aNBT.getDouble(recipeSuccessChanceNBTTag); + recipeRunning = aNBT.getBoolean(RECIPE_RUNNING_NBT_TAG); + euOutput = aNBT.getLong(RECIPE_EU_OUTPUT_NBT_TAG); + successChance = aNBT.getDouble(RECIPE_SUCCESS_CHANCE_NBT_TAG); // Load damage values/stack sizes of GT items being outputted and convert back to items. - NBTTagCompound tempItemTag = aNBT.getCompoundTag(itemOutputNBTTag); + NBTTagCompound tempItemTag = aNBT.getCompoundTag(ITEM_OUTPUT_NBT_TAG); // Iterate over all stored items. - for (int index = 0; index < tempItemTag.getInteger(numberOfItemsNBTTag); index++) { + for (int index = 0; index < tempItemTag.getInteger(NUMBER_OF_ITEMS_NBT_TAG); index++) { // Load stack size from NBT. - long stackSize = tempItemTag.getLong(index + stackSizeNBTTag); + long stackSize = tempItemTag.getLong(index + STACK_SIZE); // Load ItemStack from NBT. - ItemStack itemStack = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag(index + itemStackNBTTag)); + ItemStack itemStack = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag(index + ITEM_STACK_NBT_TAG)); outputItems.add(new ItemStackLong(itemStack, stackSize)); } |