aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-03-15 19:19:35 +0100
committerTechnus <daniel112092@gmail.com>2017-03-15 19:19:35 +0100
commitc9863b6044bf9d15dc152ee4782d728e5ef81097 (patch)
tree6008d2dbfccfb0519149bd0befd916be1d894d68 /src/main
parentcd16be8962ac4a16ba73d100803de02d7589da22 (diff)
downloadGT5-Unofficial-c9863b6044bf9d15dc152ee4782d728e5ef81097.tar.gz
GT5-Unofficial-c9863b6044bf9d15dc152ee4782d728e5ef81097.tar.bz2
GT5-Unofficial-c9863b6044bf9d15dc152ee4782d728e5ef81097.zip
Refactor of packages
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/github/technus/tectech/CustomItemList.java288
-rw-r--r--src/main/java/com/github/technus/tectech/GT_CustomLoader.java37
-rw-r--r--src/main/java/com/github/technus/tectech/GT_Loader_Machines.java140
-rw-r--r--src/main/java/com/github/technus/tectech/GT_Loader_Recipes.java4
-rw-r--r--src/main/java/com/github/technus/tectech/TecTech.java185
-rw-r--r--src/main/java/com/github/technus/tectech/XSTR.java32
-rw-r--r--src/main/java/com/github/technus/tectech/auxiliary/Reference.java13
-rw-r--r--src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java60
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/Behaviour_elementalMatterContainer.java18
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDecay.java28
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java38
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStack.java32
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStackTree.java273
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStack.java55
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStackTree.java335
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java21
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipe.java16
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeTree.java44
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/commonValues.java26
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/definitions/cPrimitiveDefinition.java18
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java329
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java66
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/definitions/eBosonDefinition.java12
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/definitions/eLeptonDefinition.java24
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/definitions/eNeutrinoDefinition.java20
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/definitions/eQuarkDefinition.java28
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_Uncertainty.java106
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iElementalInstanceContainer.java1
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iHasElementalDefinition.java1
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMjunction.java118
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_Uncertainty.java288
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/ClientProxy.java102
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/CommonProxy.java43
-rw-r--r--src/main/java/com/github/technus/tectech/things/block/QuantumGlass.java (renamed from src/main/java/com/github/technus/tectech/blocks/QuantumGlass.java)25
-rw-r--r--src/main/java/com/github/technus/tectech/things/block/QuantumGlassRender.java (renamed from src/main/java/com/github/technus/tectech/blocks/QuantumGlassRender.java)19
-rw-r--r--src/main/java/com/github/technus/tectech/things/casing/GT_Block_CasingsTT.java (renamed from src/main/java/com/github/technus/tectech/casing/GT_Block_CasingsTT.java)44
-rw-r--r--src/main/java/com/github/technus/tectech/things/casing/GT_Container_CasingsTT.java (renamed from src/main/java/com/github/technus/tectech/casing/GT_Container_CasingsTT.java)4
-rw-r--r--src/main/java/com/github/technus/tectech/things/casing/GT_Item_CasingsTT.java (renamed from src/main/java/com/github/technus/tectech/casing/GT_Item_CasingsTT.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/things/casing/GT_Loader_CasingsTT.java (renamed from src/main/java/com/github/technus/tectech/casing/GT_Loader_CasingsTT.java)4
-rw-r--r--src/main/java/com/github/technus/tectech/things/machineTT.java7
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/GT_MetaTileEntity_Hatch_ElementalContainer.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_ElementalContainer.java)107
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/GT_MetaTileEntity_MultiblockBase_EM.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_MultiblockBase_Elemental.java)663
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_DynamoMulti.java)9
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_EnergyMulti.java)15
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_InputElemental.java)7
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_MufflerElemental.java)74
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_OutputElemental.java)30
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_Param.java)25
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java297
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_Container_Param.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_Param.java)55
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_Uncertainty.java)24
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_Param.java)22
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java109
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_UncertaintyAdv.java)92
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMbhg.java)52
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMcollider.java)22
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Computer.java)22
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMcrafter.java)22
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantifier.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMdequantifier.java)24
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java118
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMmachine.java)22
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_quantifier.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMquantifier.java)246
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMscanner.java)22
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMtransformer.java)51
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMwormhole.java)22
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/gui/GT_Container_MultiMachineEM.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_MultiMachineEM.java)58
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/gui/GT_GUIContainer_MultiMachineEM.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_MultiMachineEM.java)126
-rw-r--r--src/main/java/com/github/technus/tectech/things/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java (renamed from src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMpipe.java)55
68 files changed, 2714 insertions, 2583 deletions
diff --git a/src/main/java/com/github/technus/tectech/CustomItemList.java b/src/main/java/com/github/technus/tectech/CustomItemList.java
index 65bdba09b7..5b3c2fd350 100644
--- a/src/main/java/com/github/technus/tectech/CustomItemList.java
+++ b/src/main/java/com/github/technus/tectech/CustomItemList.java
@@ -10,144 +10,152 @@ import net.minecraft.item.ItemStack;
import static gregtech.api.enums.GT_Values.W;
-public enum CustomItemList implements IItemContainer
-{
- EMpipe,
- eM_dynamomulti4_UV,eM_dynamomulti16_UV,eM_dynamomulti64_UV,
- eM_dynamomulti4_UHV,eM_dynamomulti16_UHV,eM_dynamomulti64_UHV,
- eM_dynamomulti4_UEV,eM_dynamomulti16_UEV,eM_dynamomulti64_UEV,
- eM_dynamomulti4_UIV,eM_dynamomulti16_UIV,eM_dynamomulti64_UIV,
- eM_dynamomulti4_UMV,eM_dynamomulti16_UMV,eM_dynamomulti64_UMV,
- eM_dynamomulti4_UXV,eM_dynamomulti16_UXV,eM_dynamomulti64_UXV,
- eM_energymulti4_UV,eM_energymulti16_UV,eM_energymulti64_UV,
- eM_energymulti4_UHV,eM_energymulti16_UHV,eM_energymulti64_UHV,
- eM_energymulti4_UEV,eM_energymulti16_UEV,eM_energymulti64_UEV,
- eM_energymulti4_UIV,eM_energymulti16_UIV,eM_energymulti64_UIV,
- eM_energymulti4_UMV,eM_energymulti16_UMV,eM_energymulti64_UMV,
- eM_energymulti4_UXV,eM_energymulti16_UXV,eM_energymulti64_UXV,
- eM_in_UV,eM_in_UHV,eM_in_UEV,eM_in_UIV,eM_in_UMV,eM_in_UXV,
- eM_out_UV,eM_out_UHV,eM_out_UEV,eM_out_UIV,eM_out_UMV,eM_out_UXV,
- eM_muffler_UV,eM_muffler_UHV,eM_muffler_UEV,eM_muffler_UIV,eM_muffler_UMV,eM_muffler_UXV,
- Parametrizer_Hatch,Uncertainty_Hatch,UncertaintyX_Hatch,
- eM_Casing,eM_Field,eM_Field_Casing,eM_Coil,eM_Tele,eM_TimeSpaceWarp,
- debugBlock,
- Machine_Multi_MatterToEM,Machine_Multi_EMToMatter,Machine_Multi_EMjunction,
- Machine_Multi_Transformer,Machine_Multi_Computer,
- Machine_Multi_BHG,Machine_Multi_EMmachine,Machine_Multi_Collider,Machine_Multi_Wormhole,Machine_Multi_EMCrafter,Machine_Multi_Scanner;
-
-
- private ItemStack mStack = null;
- private boolean mHasNotBeenSet = true;
-
- //public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas;
-
- @Override
- public IItemContainer set(Item aItem) {
- mHasNotBeenSet = false;
- if (aItem == null) return this;
- ItemStack aStack = new ItemStack(aItem, 1, 0);
- mStack = GT_Utility.copyAmount(1, aStack);
- return this;
- }
-
- @Override
- public IItemContainer set(ItemStack aStack) {
- mHasNotBeenSet = false;
- mStack = GT_Utility.copyAmount(1, aStack);
- return this;
- }
-
- @Override
- public Item getItem() {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return null;
- return mStack.getItem();
- }
-
- @Override
- public Block getBlock() {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- return GT_Utility.getBlockFromStack(getItem());
- }
-
- @Override
- public final boolean hasBeenSet() {
- return !mHasNotBeenSet;
- }
-
- @Override
- public boolean isStackEqual(Object aStack) {
- return isStackEqual(aStack, false, false);
- }
-
- @Override
- public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) {
- if (GT_Utility.isStackInvalid(aStack)) return false;
- return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT);
- }
-
- @Override
- public ItemStack get(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getWildcard(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getUndamaged(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) {
- ItemStack rStack = get(1, aReplacements);
- if (GT_Utility.isStackInvalid(rStack)) return null;
- rStack.setStackDisplayName(aDisplayName);
- return GT_Utility.copyAmount(aAmount, rStack);
- }
-
- @Override
- public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) {
- ItemStack rStack = get(1, aReplacements);
- if (GT_Utility.isStackInvalid(rStack)) return null;
- GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
- return GT_Utility.copyAmount(aAmount, rStack);
- }
-
- @Override
- public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
- return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public IItemContainer registerOre(Object... aOreNames) {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1));
- return this;
- }
-
- @Override
- public IItemContainer registerWildcardAsOre(Object... aOreNames) {
- if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1));
- return this;
- }
+public enum CustomItemList implements IItemContainer {
+ EMpipe,
+ eM_dynamomulti4_UV, eM_dynamomulti16_UV, eM_dynamomulti64_UV,
+ eM_dynamomulti4_UHV, eM_dynamomulti16_UHV, eM_dynamomulti64_UHV,
+ eM_dynamomulti4_UEV, eM_dynamomulti16_UEV, eM_dynamomulti64_UEV,
+ eM_dynamomulti4_UIV, eM_dynamomulti16_UIV, eM_dynamomulti64_UIV,
+ eM_dynamomulti4_UMV, eM_dynamomulti16_UMV, eM_dynamomulti64_UMV,
+ eM_dynamomulti4_UXV, eM_dynamomulti16_UXV, eM_dynamomulti64_UXV,
+ eM_energymulti4_UV, eM_energymulti16_UV, eM_energymulti64_UV,
+ eM_energymulti4_UHV, eM_energymulti16_UHV, eM_energymulti64_UHV,
+ eM_energymulti4_UEV, eM_energymulti16_UEV, eM_energymulti64_UEV,
+ eM_energymulti4_UIV, eM_energymulti16_UIV, eM_energymulti64_UIV,
+ eM_energymulti4_UMV, eM_energymulti16_UMV, eM_energymulti64_UMV,
+ eM_energymulti4_UXV, eM_energymulti16_UXV, eM_energymulti64_UXV,
+ eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV,
+ eM_out_UV, eM_out_UHV, eM_out_UEV, eM_out_UIV, eM_out_UMV, eM_out_UXV,
+ eM_muffler_UV, eM_muffler_UHV, eM_muffler_UEV, eM_muffler_UIV, eM_muffler_UMV, eM_muffler_UXV,
+ Parametrizer_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch,
+ eM_Casing, eM_Field, eM_Field_Casing, eM_Coil, eM_Tele, eM_TimeSpaceWarp,
+ debugBlock,
+ Machine_Multi_MatterToEM, Machine_Multi_EMToMatter, Machine_Multi_EMjunction,
+ Machine_Multi_Transformer, Machine_Multi_Computer,
+ Machine_Multi_BHG, Machine_Multi_EMmachine, Machine_Multi_Collider, Machine_Multi_Wormhole, Machine_Multi_EMCrafter, Machine_Multi_Scanner;
+
+
+ private ItemStack mStack = null;
+ private boolean mHasNotBeenSet = true;
+
+ //public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas;
+
+ @Override
+ public IItemContainer set(Item aItem) {
+ mHasNotBeenSet = false;
+ if (aItem == null) return this;
+ ItemStack aStack = new ItemStack(aItem, 1, 0);
+ mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
+ }
+
+ @Override
+ public IItemContainer set(ItemStack aStack) {
+ mHasNotBeenSet = false;
+ mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
+ }
+
+ @Override
+ public Item getItem() {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return null;
+ return mStack.getItem();
+ }
+
+ @Override
+ public Block getBlock() {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ return GT_Utility.getBlockFromStack(getItem());
+ }
+
+ @Override
+ public final boolean hasBeenSet() {
+ return !mHasNotBeenSet;
+ }
+
+ @Override
+ public boolean isStackEqual(Object aStack) {
+ return isStackEqual(aStack, false, false);
+ }
+
+ @Override
+ public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT);
+ }
+
+ @Override
+ public ItemStack get(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getWildcard(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getUndamaged(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) {
+ ItemStack rStack = get(1, aReplacements);
+ if (GT_Utility.isStackInvalid(rStack)) return null;
+ rStack.setStackDisplayName(aDisplayName);
+ return GT_Utility.copyAmount(aAmount, rStack);
+ }
+
+ @Override
+ public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) {
+ ItemStack rStack = get(1, aReplacements);
+ if (GT_Utility.isStackInvalid(rStack)) return null;
+ GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
+ return GT_Utility.copyAmount(aAmount, rStack);
+ }
+
+ @Override
+ public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public IItemContainer registerOre(Object... aOreNames) {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1));
+ return this;
+ }
+
+ @Override
+ public IItemContainer registerWildcardAsOre(Object... aOreNames) {
+ if (mHasNotBeenSet)
+ throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1));
+ return this;
+ }
} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/GT_CustomLoader.java b/src/main/java/com/github/technus/tectech/GT_CustomLoader.java
index 8026b4b6e2..196b97c074 100644
--- a/src/main/java/com/github/technus/tectech/GT_CustomLoader.java
+++ b/src/main/java/com/github/technus/tectech/GT_CustomLoader.java
@@ -1,26 +1,27 @@
package com.github.technus.tectech;
-import com.github.technus.tectech.casing.GT_Loader_CasingsTT;
+import com.github.technus.tectech.things.casing.GT_Loader_CasingsTT;
public class GT_CustomLoader {
- private GT_Loader_Machines ElementalLoader;
- private GT_Loader_CasingsTT ElementalCasing;
- private GT_Loader_Recipes ElementalRecipes;
+ private GT_Loader_Machines ElementalLoader;
+ private GT_Loader_CasingsTT ElementalCasing;
+ private GT_Loader_Recipes ElementalRecipes;
- public GT_CustomLoader() {}
+ public GT_CustomLoader() {
+ }
- public void run() {
- ElementalCasing = new GT_Loader_CasingsTT();
- ElementalCasing.run();
- TecTech.Logger.info("Casing Init Done");
- ElementalLoader = new GT_Loader_Machines();
- ElementalLoader.run();
- TecTech.Logger.info("Machine Init Done");
- }
+ public void run() {
+ ElementalCasing = new GT_Loader_CasingsTT();
+ ElementalCasing.run();
+ TecTech.Logger.info("Casing Init Done");
+ ElementalLoader = new GT_Loader_Machines();
+ ElementalLoader.run();
+ TecTech.Logger.info("Machine Init Done");
+ }
- public void run2() {
- ElementalRecipes = new GT_Loader_Recipes();
- ElementalRecipes.run();
- TecTech.Logger.info("Recipe Init Done Done");
- }
+ public void run2() {
+ ElementalRecipes = new GT_Loader_Recipes();
+ ElementalRecipes.run();
+ TecTech.Logger.info("Recipe Init Done Done");
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/GT_Loader_Machines.java b/src/main/java/com/github/technus/tectech/GT_Loader_Machines.java
index f11da31d19..1364498063 100644
--- a/src/main/java/com/github/technus/tectech/GT_Loader_Machines.java
+++ b/src/main/java/com/github/technus/tectech/GT_Loader_Machines.java
@@ -1,7 +1,5 @@
package com.github.technus.tectech;
-import com.github.technus.tectech.elementalMatter.machine.*;
-
/**
* Created by danie_000 on 16.11.2016.
*/
@@ -12,112 +10,112 @@ public class GT_Loader_Machines implements Runnable {
// ===================================================================================================
CustomItemList.eM_in_UV.set(new GT_MetaTileEntity_Hatch_InputElemental(
- 12070, "hatch.emin.tier.08", "UV Elemental Input Hatch",8).getStackForm(1L));
+ 12070, "hatch.emin.tier.08", "UV Elemental Input Hatch", 8).getStackForm(1L));
CustomItemList.eM_in_UHV.set(new GT_MetaTileEntity_Hatch_InputElemental(
- 12071, "hatch.emin.tier.09", "UHV Elemental Input Hatch",9).getStackForm(1L));
+ 12071, "hatch.emin.tier.09", "UHV Elemental Input Hatch", 9).getStackForm(1L));
CustomItemList.eM_in_UEV.set(new GT_MetaTileEntity_Hatch_InputElemental(
- 12072, "hatch.emin.tier.10", "UEV Elemental Input Hatch",10).getStackForm(1L));
+ 12072, "hatch.emin.tier.10", "UEV Elemental Input Hatch", 10).getStackForm(1L));
CustomItemList.eM_in_UIV.set(new GT_MetaTileEntity_Hatch_InputElemental(
- 12073, "hatch.emin.tier.11", "UIV Elemental Input Hatch",11).getStackForm(1L));
+ 12073, "hatch.emin.tier.11", "UIV Elemental Input Hatch", 11).getStackForm(1L));
CustomItemList.eM_in_UMV.set(new GT_MetaTileEntity_Hatch_InputElemental(
- 12074, "hatch.emin.tier.12", "UMV Elemental Input Hatch",12).getStackForm(1L));
+ 12074, "hatch.emin.tier.12", "UMV Elemental Input Hatch", 12).getStackForm(1L));
CustomItemList.eM_in_UXV.set(new GT_MetaTileEntity_Hatch_InputElemental(
- 12075, "hatch.emin.tier.13", "UXV Elemental Input Hatch",13).getStackForm(1L));
+ 12075, "hatch.emin.tier.13", "UXV Elemental Input Hatch", 13).getStackForm(1L));
// ===================================================================================================
// eM OUT
// ===================================================================================================
CustomItemList.eM_out_UV.set(new GT_MetaTileEntity_Hatch_OutputElemental(
- 12080, "hatch.emout.tier.08", "UV Elemental Output Hatch",8).getStackForm(1L));
+ 12080, "hatch.emout.tier.08", "UV Elemental Output Hatch", 8).getStackForm(1L));
CustomItemList.eM_out_UHV.set(new GT_MetaTileEntity_Hatch_OutputElemental(
- 12081, "hatch.emout.tier.09", "UHV Elemental Output Hatch",9).getStackForm(1L));
+ 12081, "hatch.emout.tier.09", "UHV Elemental Output Hatch", 9).getStackForm(1L));
CustomItemList.eM_out_UEV.set(new GT_MetaTileEntity_Hatch_OutputElemental(
- 12082, "hatch.emout.tier.10", "UEV Elemental Output Hatch",10).getStackForm(1L));
+ 12082, "hatch.emout.tier.10", "UEV Elemental Output Hatch", 10).getStackForm(1L));
CustomItemList.eM_out_UIV.set(new GT_MetaTileEntity_Hatch_OutputElemental(
- 12083, "hatch.emout.tier.11", "UIV Elemental Output Hatch",11).getStackForm(1L));
+ 12083, "hatch.emout.tier.11", "UIV Elemental Output Hatch", 11).getStackForm(1L));
CustomItemList.eM_out_UMV.set(new GT_MetaTileEntity_Hatch_OutputElemental(
- 12084, "hatch.emout.tier.12", "UMV Elemental Output Hatch",12).getStackForm(1L));
+ 12084, "hatch.emout.tier.12", "UMV Elemental Output Hatch", 12).getStackForm(1L));
CustomItemList.eM_out_UXV.set(new GT_MetaTileEntity_Hatch_OutputElemental(
- 12085, "hatch.emout.tier.13", "UXV Elemental Output Hatch",13).getStackForm(1L));
+ 12085, "hatch.emout.tier.13", "UXV Elemental Output Hatch", 13).getStackForm(1L));
// ===================================================================================================
// eM Waste OUT
// ===================================================================================================
CustomItemList.eM_muffler_UV.set(new GT_MetaTileEntity_Hatch_MufflerElemental(
- 12090, "hatch.emmuffler.tier.08", "UV Overflow Output Hatch",8,1e10f).getStackForm(1L));
+ 12090, "hatch.emmuffler.tier.08", "UV Overflow Output Hatch", 8, 1e10f).getStackForm(1L));
CustomItemList.eM_muffler_UHV.set(new GT_MetaTileEntity_Hatch_MufflerElemental(
- 12091, "hatch.emmuffler.tier.09", "UHV Overflow Output Hatch",9,5e10f).getStackForm(1L));
+ 12091, "hatch.emmuffler.tier.09", "UHV Overflow Output Hatch", 9, 5e10f).getStackForm(1L));
CustomItemList.eM_muffler_UEV.set(new GT_MetaTileEntity_Hatch_MufflerElemental(
- 12092, "hatch.emmuffler.tier.10", "UEV Overflow Output Hatch",10,25e10f).getStackForm(1L));
+ 12092, "hatch.emmuffler.tier.10", "UEV Overflow Output Hatch", 10, 25e10f).getStackForm(1L));
CustomItemList.eM_muffler_UIV.set(new GT_MetaTileEntity_Hatch_MufflerElemental(
- 12093, "hatch.emmuffler.tier.11", "UIV Overflow Output Hatch",11,125e10f).getStackForm(1L));
+ 12093, "hatch.emmuffler.tier.11", "UIV Overflow Output Hatch", 11, 125e10f).getStackForm(1L));
CustomItemList.eM_muffler_UMV.set(new GT_MetaTileEntity_Hatch_MufflerElemental(
- 12094, "hatch.emmuffler.tier.12", "UMV Overflow Output Hatch",12,125e11f).getStackForm(1L));
+ 12094, "hatch.emmuffler.tier.12", "UMV Overflow Output Hatch", 12, 125e11f).getStackForm(1L));
CustomItemList.eM_muffler_UXV.set(new GT_MetaTileEntity_Hatch_MufflerElemental(
- 12095, "hatch.emmuffler.tier.13", "UXV Overflow Output Hatch",13,125e12f).getStackForm(1L));
+ 12095, "hatch.emmuffler.tier.13", "UXV Overflow Output Hatch", 13, 125e12f).getStackForm(1L));
// ===================================================================================================
// Multi AMP Power INPUTS
// ===================================================================================================
CustomItemList.eM_energymulti4_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12100, "hatch.energymulti04.tier.08", "UV 4A Energy Hatch",8,4).getStackForm(1L));
+ 12100, "hatch.energymulti04.tier.08", "UV 4A Energy Hatch", 8, 4).getStackForm(1L));
CustomItemList.eM_energymulti16_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12110, "hatch.energymulti16.tier.08", "UV 16A Energy Hatch",8,16).getStackForm(1L));
+ 12110, "hatch.energymulti16.tier.08", "UV 16A Energy Hatch", 8, 16).getStackForm(1L));
CustomItemList.eM_energymulti64_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12120, "hatch.energymulti64.tier.08", "UV 64A Energy Hatch",8,64).getStackForm(1L));
+ 12120, "hatch.energymulti64.tier.08", "UV 64A Energy Hatch", 8, 64).getStackForm(1L));
CustomItemList.eM_energymulti4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12101, "hatch.energymulti04.tier.09", "UHV 4A Energy Hatch",9,4).getStackForm(1L));
+ 12101, "hatch.energymulti04.tier.09", "UHV 4A Energy Hatch", 9, 4).getStackForm(1L));
CustomItemList.eM_energymulti16_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12111, "hatch.energymulti16.tier.09", "UHV 16A Energy Hatch",9,16).getStackForm(1L));
+ 12111, "hatch.energymulti16.tier.09", "UHV 16A Energy Hatch", 9, 16).getStackForm(1L));
CustomItemList.eM_energymulti64_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12121, "hatch.energymulti64.tier.09", "UHV 64A Energy Hatch",9,64).getStackForm(1L));
+ 12121, "hatch.energymulti64.tier.09", "UHV 64A Energy Hatch", 9, 64).getStackForm(1L));
CustomItemList.eM_energymulti4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12102, "hatch.energymulti04.tier.10", "UEV 4A Energy Hatch",10,4).getStackForm(1L));
+ 12102, "hatch.energymulti04.tier.10", "UEV 4A Energy Hatch", 10, 4).getStackForm(1L));
CustomItemList.eM_energymulti16_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12112, "hatch.energymulti16.tier.10", "UEV 16A Energy Hatch",10,16).getStackForm(1L));
+ 12112, "hatch.energymulti16.tier.10", "UEV 16A Energy Hatch", 10, 16).getStackForm(1L));
CustomItemList.eM_energymulti64_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12122, "hatch.energymulti64.tier.10", "UEV 64A Energy Hatch",10,64).getStackForm(1L));
+ 12122, "hatch.energymulti64.tier.10", "UEV 64A Energy Hatch", 10, 64).getStackForm(1L));
CustomItemList.eM_energymulti4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12103, "hatch.energymulti04.tier.11", "UIV 4A Energy Hatch",11,4).getStackForm(1L));
+ 12103, "hatch.energymulti04.tier.11", "UIV 4A Energy Hatch", 11, 4).getStackForm(1L));
CustomItemList.eM_energymulti16_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12113, "hatch.energymulti16.tier.11", "UIV 16A Energy Hatch",11,16).getStackForm(1L));
+ 12113, "hatch.energymulti16.tier.11", "UIV 16A Energy Hatch", 11, 16).getStackForm(1L));
CustomItemList.eM_energymulti64_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12123, "hatch.energymulti64.tier.11", "UIV 64A Energy Hatch",11,64).getStackForm(1L));
+ 12123, "hatch.energymulti64.tier.11", "UIV 64A Energy Hatch", 11, 64).getStackForm(1L));
CustomItemList.eM_energymulti4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12104, "hatch.energymulti04.tier.12", "UMV 4A Energy Hatch",12,4).getStackForm(1L));
+ 12104, "hatch.energymulti04.tier.12", "UMV 4A Energy Hatch", 12, 4).getStackForm(1L));
CustomItemList.eM_energymulti16_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12114, "hatch.energymulti16.tier.12", "UMV 16A Energy Hatch",12,16).getStackForm(1L));
+ 12114, "hatch.energymulti16.tier.12", "UMV 16A Energy Hatch", 12, 16).getStackForm(1L));
CustomItemList.eM_energymulti64_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12124, "hatch.energymulti64.tier.12", "UMV 64A Energy Hatch",12,64).getStackForm(1L));
+ 12124, "hatch.energymulti64.tier.12", "UMV 64A Energy Hatch", 12, 64).getStackForm(1L));
CustomItemList.eM_energymulti4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12105, "hatch.energymulti04.tier.13", "UXV 4A Energy Hatch",13,4).getStackForm(1L));
+ 12105, "hatch.energymulti04.tier.13", "UXV 4A Energy Hatch", 13, 4).getStackForm(1L));
CustomItemList.eM_energymulti16_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12115, "hatch.energymulti16.tier.13", "UXV 16A Energy Hatch",13,16).getStackForm(1L));
+ 12115, "hatch.energymulti16.tier.13", "UXV 16A Energy Hatch", 13, 16).getStackForm(1L));
CustomItemList.eM_energymulti64_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti(
- 12125, "hatch.energymulti64.tier.13", "UXV 64A Energy Hatch",13,64).getStackForm(1L));
+ 12125, "hatch.energymulti64.tier.13", "UXV 64A Energy Hatch", 13, 64).getStackForm(1L));
// ===================================================================================================
@@ -125,73 +123,73 @@ public class GT_Loader_Machines implements Runnable {
// ===================================================================================================
CustomItemList.eM_dynamomulti4_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12130, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo Hatch",8,4).getStackForm(1L));
+ 12130, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo Hatch", 8, 4).getStackForm(1L));
CustomItemList.eM_dynamomulti16_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12140, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo Hatch",8,16).getStackForm(1L));
+ 12140, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo Hatch", 8, 16).getStackForm(1L));
CustomItemList.eM_dynamomulti64_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12150, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo Hatch",8,64).getStackForm(1L));
+ 12150, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo Hatch", 8, 64).getStackForm(1L));
CustomItemList.eM_dynamomulti4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12131, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo Hatch",9,4).getStackForm(1L));
+ 12131, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo Hatch", 9, 4).getStackForm(1L));
CustomItemList.eM_dynamomulti16_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12141, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo Hatch",9,16).getStackForm(1L));
+ 12141, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo Hatch", 9, 16).getStackForm(1L));
CustomItemList.eM_dynamomulti64_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12151, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo Hatch",9,64).getStackForm(1L));
+ 12151, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo Hatch", 9, 64).getStackForm(1L));
CustomItemList.eM_dynamomulti4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12132, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo Hatch",10,4).getStackForm(1L));
+ 12132, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo Hatch", 10, 4).getStackForm(1L));
CustomItemList.eM_dynamomulti16_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12142, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo Hatch",10,16).getStackForm(1L));
+ 12142, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo Hatch", 10, 16).getStackForm(1L));
CustomItemList.eM_dynamomulti64_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12152, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo Hatch",10,64).getStackForm(1L));
+ 12152, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo Hatch", 10, 64).getStackForm(1L));
CustomItemList.eM_dynamomulti4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12133, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo Hatch",11,4).getStackForm(1L));
+ 12133, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo Hatch", 11, 4).getStackForm(1L));
CustomItemList.eM_dynamomulti16_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12143, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo Hatch",11,16).getStackForm(1L));
+ 12143, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo Hatch", 11, 16).getStackForm(1L));
CustomItemList.eM_dynamomulti64_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12153, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo Hatch",11,64).getStackForm(1L));
+ 12153, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo Hatch", 11, 64).getStackForm(1L));
CustomItemList.eM_dynamomulti4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12134, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo Hatch",12,4).getStackForm(1L));
+ 12134, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo Hatch", 12, 4).getStackForm(1L));
CustomItemList.eM_dynamomulti16_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12144, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo Hatch",12,16).getStackForm(1L));
+ 12144, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo Hatch", 12, 16).getStackForm(1L));
CustomItemList.eM_dynamomulti64_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12154, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo Hatch",12,64).getStackForm(1L));
+ 12154, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo Hatch", 12, 64).getStackForm(1L));
CustomItemList.eM_dynamomulti4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12135, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo Hatch",13,4).getStackForm(1L));
+ 12135, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo Hatch", 13, 4).getStackForm(1L));
CustomItemList.eM_dynamomulti16_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12145, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo Hatch",13,16).getStackForm(1L));
+ 12145, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo Hatch", 13, 16).getStackForm(1L));
CustomItemList.eM_dynamomulti64_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti(
- 12155, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo Hatch",13,64).getStackForm(1L));
+ 12155, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo Hatch", 13, 64).getStackForm(1L));
// ===================================================================================================
// MULTIBLOCKS EM
// ===================================================================================================
- CustomItemList.Machine_Multi_Transformer.set(new GT_MetaTileEntity_EMtransformer(12160,"multimachine.em.transformer", "Active Transformer").getStackForm(1L));
- CustomItemList.Machine_Multi_MatterToEM.set(new GT_MetaTileEntity_EMquantifier(12161,"multimachine.em.mattertoem","Matter Quantifier").getStackForm(1L));
- CustomItemList.Machine_Multi_EMToMatter.set(new GT_MetaTileEntity_EMdequantifier(12162,"multimachine.em.emtomatter","Matter De-quantifier").getStackForm(1L));
- CustomItemList.Machine_Multi_EMjunction.set(new GT_MetaTileEntity_EMjunction(12163,"multimachine.em.junction","Matter junction").getStackForm(1L));
- CustomItemList.Machine_Multi_EMmachine.set(new GT_MetaTileEntity_EMmachine(12164,"multimachine.em.processing","Quantum Processing Machine").getStackForm(1L));
- CustomItemList.Machine_Multi_EMCrafter.set(new GT_MetaTileEntity_EMcrafter(12165,"multimachine.em.crafter","Matter Assembler").getStackForm(1L));
- CustomItemList.Machine_Multi_Collider.set(new GT_MetaTileEntity_EMcollider(12166,"multimachine.em.collider","Matter Collider").getStackForm(1L));
- CustomItemList.Machine_Multi_BHG.set(new GT_MetaTileEntity_EMbhg(12167,"multimachine.em.blackholegenerator","Black Hole Generator").getStackForm(1L));
- CustomItemList.Machine_Multi_Wormhole.set(new GT_MetaTileEntity_EMwormhole(12168,"multimachine.em.wormhole","Wormhole").getStackForm(1L));
- CustomItemList.Machine_Multi_Scanner.set(new GT_MetaTileEntity_EMscanner(12169,"multimachine.em.scanner","Elemental Scanner").getStackForm(1L));
- CustomItemList.Machine_Multi_Computer.set(new GT_MetaTileEntity_Computer(12170,"multimachine.em.computer","Quantum computer").getStackForm(1L));
+ CustomItemList.Machine_Multi_Transformer.set(new GT_MetaTileEntity_EM_transformer(12160, "multimachine.em.transformer", "Active Transformer").getStackForm(1L));
+ CustomItemList.Machine_Multi_MatterToEM.set(new GT_MetaTileEntity_EM_quantifier(12161, "multimachine.em.mattertoem", "Matter Quantifier").getStackForm(1L));
+ CustomItemList.Machine_Multi_EMToMatter.set(new GT_MetaTileEntity_EM_dequantifier(12162, "multimachine.em.emtomatter", "Matter De-quantifier").getStackForm(1L));
+ CustomItemList.Machine_Multi_EMjunction.set(new GT_MetaTileEntity_EM_junction(12163, "multimachine.em.junction", "Matter junction").getStackForm(1L));
+ CustomItemList.Machine_Multi_EMmachine.set(new GT_MetaTileEntity_EM_machine(12164, "multimachine.em.processing", "Quantum Processing Machine").getStackForm(1L));
+ CustomItemList.Machine_Multi_EMCrafter.set(new GT_MetaTileEntity_EM_crafter(12165, "multimachine.em.crafter", "Matter Assembler").getStackForm(1L));
+ CustomItemList.Machine_Multi_Collider.set(new GT_MetaTileEntity_EM_collider(12166, "multimachine.em.collider", "Matter Collider").getStackForm(1L));
+ CustomItemList.Machine_Multi_BHG.set(new GT_MetaTileEntity_EM_bhg(12167, "multimachine.em.blackholegenerator", "Black Hole Generator").getStackForm(1L));
+ CustomItemList.Machine_Multi_Wormhole.set(new GT_MetaTileEntity_EM_wormhole(12168, "multimachine.em.wormhole", "Wormhole").getStackForm(1L));
+ CustomItemList.Machine_Multi_Scanner.set(new GT_MetaTileEntity_EM_scanner(12169, "multimachine.em.scanner", "Elemental Scanner").getStackForm(1L));
+ CustomItemList.Machine_Multi_Computer.set(new GT_MetaTileEntity_EM_computer(12170, "multimachine.em.computer", "Quantum computer").getStackForm(1L));
// ===================================================================================================
// Hatches EM
// ===================================================================================================
- CustomItemList.Parametrizer_Hatch.set(new GT_MetaTileEntity_Hatch_Param(12180,"hatch.param.tier.06","Parametrizer for machines",6).getStackForm(1L));
- CustomItemList.Uncertainty_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12181,"hatch.emcertain.tier.06","Uncertainty resolver",6).getStackForm(1L));
- CustomItemList.UncertaintyX_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12182,"hatch.emcertain.tier.10","Uncertainty resolver X",10).getStackForm(1L));
+ CustomItemList.Parametrizer_Hatch.set(new GT_MetaTileEntity_Hatch_Param(12180, "hatch.param.tier.06", "Parametrizer for machines", 6).getStackForm(1L));
+ CustomItemList.Uncertainty_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12181, "hatch.emcertain.tier.06", "Uncertainty resolver", 6).getStackForm(1L));
+ CustomItemList.UncertaintyX_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12182, "hatch.emcertain.tier.10", "Uncertainty resolver X", 10).getStackForm(1L));
// ===================================================================================================
// EM pipe
// ===================================================================================================
- CustomItemList.EMpipe.set(new GT_MetaTileEntity_EMpipe(12179,"pipe.elementalmatter","Quantum tunnel").getStackForm(1L));
+ CustomItemList.EMpipe.set(new GT_MetaTileEntity_Pipe_EM(12179, "pipe.elementalmatter", "Quantum tunnel").getStackForm(1L));
}
}
diff --git a/src/main/java/com/github/technus/tectech/GT_Loader_Recipes.java b/src/main/java/com/github/technus/tectech/GT_Loader_Recipes.java
index 2d26587d31..fc957224dc 100644
--- a/src/main/java/com/github/technus/tectech/GT_Loader_Recipes.java
+++ b/src/main/java/com/github/technus/tectech/GT_Loader_Recipes.java
@@ -2,7 +2,7 @@ package com.github.technus.tectech;
import com.github.technus.tectech.elementalMatter.classes.cElementalPrimitive;
import com.github.technus.tectech.elementalMatter.definitions.*;
-import com.github.technus.tectech.elementalMatter.machine.GT_MetaTileEntity_EMquantifier;
+import com.github.technus.tectech.things.metaTileEntity.multi.GT_MetaTileEntity_EM_quantifier;
/**
* Created by danie_000 on 16.11.2016.
@@ -30,6 +30,6 @@ public class GT_Loader_Recipes implements Runnable {
// Recipe init
// ===================================================================================================
- GT_MetaTileEntity_EMquantifier.run();
+ GT_MetaTileEntity_EM_quantifier.run();
}
}
diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java
index d776dac376..5104cbc055 100644
--- a/src/main/java/com/github/technus/tectech/TecTech.java
+++ b/src/main/java/com/github/technus/tectech/TecTech.java
@@ -2,8 +2,9 @@ package com.github.technus.tectech;
import com.github.technus.tectech.auxiliary.Reference;
import com.github.technus.tectech.auxiliary.TecTechConfig;
-import com.github.technus.tectech.blocks.QuantumGlass;
-import com.github.technus.tectech.casing.GT_Container_CasingsTT;
+import com.github.technus.tectech.things.block.QuantumGlass;
+import com.github.technus.tectech.things.casing.GT_Container_CasingsTT;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.proxy.CommonProxy;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
@@ -20,94 +21,108 @@ import cpw.mods.fml.relauncher.SideOnly;
import eu.usrv.yamcore.auxiliary.IngameErrorLog;
import eu.usrv.yamcore.auxiliary.LogHelper;
import eu.usrv.yamcore.items.ModItemManager;
+import gregtech.api.GregTech_API;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import java.util.List;
+
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, dependencies = "required-after:Forge@[10.13.4.1614,);"
- + "required-after:YAMCore@[0.5.70,);" + "required-after:gregtech;")
+ + "required-after:YAMCore@[0.5.70,);" + "required-after:gregtech;")
public class TecTech {
- @SidedProxy(clientSide = Reference.CLIENTSIDE, serverSide = Reference.SERVERSIDE)
- public static CommonProxy proxy;
-
- @Instance(Reference.MODID)
- public static TecTech instance;
-
- //public static ModFluidManager FluidManager = null;
- //public static ModBlockManager BlockManager = null;
- public static ModItemManager ItemManager = null;
- public static IngameErrorLog Module_AdminErrorLogs = null;
- public static GT_CustomLoader GTCustomLoader = null;
- public static TecTechConfig ModConfig;
- public static XSTR Rnd = null;
- public static LogHelper Logger = new LogHelper(Reference.MODID);
- public static CreativeTabs mainTab=null;
-
- public static void AddLoginError(String pMessage) {
- if (Module_AdminErrorLogs != null)
- Module_AdminErrorLogs.AddErrorLogOnAdminJoin(pMessage);
- }
-
- @EventHandler
- public void PreLoad(FMLPreInitializationEvent PreEvent) {
- Logger.setDebugOutput(true);
- Rnd = new XSTR();
-
- //ItemManager = new ModItemManager(Refstrings.MODID);
- //BlockManager = new ModBlockManager(Refstrings.MODID);
- //FluidManager = new ModFluidManager(Refstrings.MODID);
-
- ModConfig = new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME,
- Reference.MODID);
- if (!ModConfig.LoadConfig())
- Logger.error(Reference.MODID+" could not load its config file. Things are going to be weird!");
-
- if (ModConfig.ModAdminErrorLogs_Enabled) {
- Logger.debug("Module_AdminErrorLogs is enabled");
- Module_AdminErrorLogs = new IngameErrorLog();
- }
- }
-
- @EventHandler
- public void load(FMLInitializationEvent event) {
- GameRegistry.registerBlock(QuantumGlass.INSTANCE,QuantumGlass.INSTANCE.getUnlocalizedName());
- proxy.registerRenderInfo();
- }
-
- @EventHandler
- public void PostLoad(FMLPostInitializationEvent PostEvent) {
- GTCustomLoader = new GT_CustomLoader();
- GTCustomLoader.run();
- GTCustomLoader.run2();
-
- mainTab=new CreativeTabs("TecTech") {
- @SideOnly(Side.CLIENT)
- @Override
- public Item getTabIconItem() {
- return CustomItemList.eM_TimeSpaceWarp.getItem();
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public ItemStack getIconItemStack() {
- return CustomItemList.eM_TimeSpaceWarp.getWithDamage(1,8);
- }
- };
- RegisterThingsInTabs();
- if(Loader.isModLoaded("dreamcraft"));//TODO init recipes for GTNH coremod
- }
-
- public void RegisterThingsInTabs(){
- QuantumGlass.INSTANCE.setCreativeTab(mainTab);//TODO? COPY PASTE GT CLASSES TO ADD MY THINGS TO CREATIVE TAB
- GT_Container_CasingsTT.sBlockCasingsTT.setCreativeTab(mainTab);
- }
-
- /**
- * Do some stuff once the server starts
- *
- * @param pEvent
- */
- @EventHandler
- public void serverLoad(FMLServerStartingEvent pEvent) {}
+ @SidedProxy(clientSide = Reference.CLIENTSIDE, serverSide = Reference.SERVERSIDE)
+ public static CommonProxy proxy;
+
+ @Instance(Reference.MODID)
+ public static TecTech instance;
+
+ //public static ModFluidManager FluidManager = null;
+ //public static ModBlockManager BlockManager = null;
+ public static ModItemManager ItemManager = null;
+ public static IngameErrorLog Module_AdminErrorLogs = null;
+ public static GT_CustomLoader GTCustomLoader = null;
+ public static TecTechConfig ModConfig;
+ public static XSTR Rnd = null;
+ public static LogHelper Logger = new LogHelper(Reference.MODID);
+ public static CreativeTabs mainTab = null;
+
+ public static void AddLoginError(String pMessage) {
+ if (Module_AdminErrorLogs != null)
+ Module_AdminErrorLogs.AddErrorLogOnAdminJoin(pMessage);
+ }
+
+ @EventHandler
+ public void PreLoad(FMLPreInitializationEvent PreEvent) {
+ Logger.setDebugOutput(true);
+ Rnd = new XSTR();
+
+ //ItemManager = new ModItemManager(Refstrings.MODID);
+ //BlockManager = new ModBlockManager(Refstrings.MODID);
+ //FluidManager = new ModFluidManager(Refstrings.MODID);
+
+ ModConfig = new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME,
+ Reference.MODID);
+ if (!ModConfig.LoadConfig())
+ Logger.error(Reference.MODID + " could not load its config file. Things are going to be weird!");
+
+ if (ModConfig.ModAdminErrorLogs_Enabled) {
+ Logger.debug("Module_AdminErrorLogs is enabled");
+ Module_AdminErrorLogs = new IngameErrorLog();
+ }
+ }
+
+ @EventHandler
+ public void load(FMLInitializationEvent event) {
+ GameRegistry.registerBlock(QuantumGlass.INSTANCE, QuantumGlass.INSTANCE.getUnlocalizedName());
+ proxy.registerRenderInfo();
+ }
+
+ @EventHandler
+ public void PostLoad(FMLPostInitializationEvent PostEvent) {
+ GTCustomLoader = new GT_CustomLoader();
+ GTCustomLoader.run();
+ GTCustomLoader.run2();
+
+ mainTab = new CreativeTabs("TecTech") {
+ @SideOnly(Side.CLIENT)
+ @Override
+ public Item getTabIconItem() {
+ return CustomItemList.eM_TimeSpaceWarp.getItem();
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public ItemStack getIconItemStack() {
+ return CustomItemList.eM_TimeSpaceWarp.getWithDamage(1, 8);
+ }
+
+ @Override
+ public void displayAllReleventItems(List stuffToShow) {
+ for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
+ if (GregTech_API.METATILEENTITIES[i] instanceof machineTT) {
+ stuffToShow.add(new ItemStack(GregTech_API.sBlockMachines, 1, i));
+ }
+ }
+ super.displayAllReleventItems(stuffToShow);
+ }
+ };
+ RegisterThingsInTabs();
+ if (Loader.isModLoaded("dreamcraft")) ;//TODO init recipes for GTNH coremod
+ }
+
+ public void RegisterThingsInTabs() {
+ QuantumGlass.INSTANCE.setCreativeTab(mainTab);//TODO? COPY PASTE GT CLASSES TO ADD MY THINGS TO CREATIVE TAB
+ GT_Container_CasingsTT.sBlockCasingsTT.setCreativeTab(mainTab);
+ }
+
+ /**
+ * Do some stuff once the server starts
+ *
+ * @param pEvent
+ */
+ @EventHandler
+ public void serverLoad(FMLServerStartingEvent pEvent) {
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/XSTR.java b/src/main/java/com/github/technus/tectech/XSTR.java
index e733e8cfb8..4fa4b98fbd 100644
--- a/src/main/java/com/github/technus/tectech/XSTR.java
+++ b/src/main/java/com/github/technus/tectech/XSTR.java
@@ -2,24 +2,24 @@ package com.github.technus.tectech;
/**
* A subclass of java.util.random that implements the Xorshift random number
* generator
- *
+ * <p>
* - it is 30% faster than the generator from Java's library - it produces
* random sequences of higher quality than java.util.Random - this class also
* provides a clone() function
- *
+ * <p>
* Usage: XSRandom rand = new XSRandom(); //Instantiation x = rand.nextInt();
* //pull a random number
- *
+ * <p>
* To use the class in legacy code, you may also instantiate an XSRandom object
* and assign it to a java.util.Random object: java.util.Random rand = new
* XSRandom();
- *
+ * <p>
* for an explanation of the algorithm, see
* http://demesos.blogspot.com/2011/09/pseudo-random-number-generators.html
*
* @author Wilfried Elmenreich University of Klagenfurt/Lakeside Labs
* http://www.elmenreich.tk
- *
+ * <p>
* This code is released under the GNU Lesser General Public License Version 3
* http://www.gnu.org/licenses/lgpl-3.0.txt
*/
@@ -42,12 +42,13 @@ public class XSTR extends Random {
private static final int PROBE_INCREMENT = 0x9e3779b9;
private static final long SEEDER_INCREMENT = 0xbb67ae8584caa73bL;
private static final double DOUBLE_UNIT = 0x1.0p-53; // 1.0 / (1L << 53)
- private static final float FLOAT_UNIT = 0x1.0p-24f; // 1.0f / (1 << 24)
+ private static final float FLOAT_UNIT = 0x1.0p-24f; // 1.0f / (1 << 24)
/*
MODIFIED BY: Robotia
Modification: Implemented Random class seed generator
*/
+
/**
* Creates a new pseudo random number generator. The seed is initialized to
* the current time, as if by
@@ -56,13 +57,14 @@ public class XSTR extends Random {
public XSTR() {
this(seedUniquifier() ^ System.nanoTime());
}
+
private static final AtomicLong seedUniquifier
= new AtomicLong(8682522807148012L);
private static long seedUniquifier() {
// L'Ecuyer, "Tables of Linear Congruential Generators of
// Different Sizes and Good Lattice Structure", 1999
- for (;;) {
+ for (; ; ) {
long current = seedUniquifier.get();
long next = current * 181783497276652981L;
if (seedUniquifier.compareAndSet(current, next)) {
@@ -80,13 +82,15 @@ public class XSTR extends Random {
public XSTR(long seed) {
this.seed = seed;
}
+
public boolean nextBoolean() {
return next(1) != 0;
}
public double nextDouble() {
- return (((long)(next(26)) << 27) + next(27)) * DOUBLE_UNIT;
+ return (((long) (next(26)) << 27) + next(27)) * DOUBLE_UNIT;
}
+
/**
* Returns the current state of the seed, can be used to clone the object
*
@@ -132,8 +136,10 @@ public class XSTR extends Random {
x &= ((1L << nbits) - 1);
return (int) x;
}
+
boolean haveNextNextGaussian = false;
double nextNextGaussian = 0;
+
synchronized public double nextGaussian() {
// See Knuth, ACP, Section 3.4.1 Algorithm C.
if (haveNextNextGaussian) {
@@ -146,12 +152,13 @@ public class XSTR extends Random {
v2 = 2 * nextDouble() - 1; // between -1 and 1
s = v1 * v1 + v2 * v2;
} while (s >= 1 || s == 0);
- double multiplier = StrictMath.sqrt(-2 * StrictMath.log(s)/s);
+ double multiplier = StrictMath.sqrt(-2 * StrictMath.log(s) / s);
nextNextGaussian = v2 * multiplier;
haveNextNextGaussian = true;
return v1 * multiplier;
}
}
+
/**
* Returns a pseudorandom, uniformly distributed {@code int} value between 0
* (inclusive) and the specified value (exclusive), drawn from this random
@@ -232,6 +239,7 @@ public class XSTR extends Random {
int out = (int) last % bound;
return (out < 0) ? -out : out;
}
+
public int nextInt() {
return next(32);
}
@@ -242,14 +250,14 @@ public class XSTR extends Random {
public long nextLong() {
// it's okay that the bottom word remains signed.
- return ((long)(next(32)) << 32) + next(32);
+ return ((long) (next(32)) << 32) + next(32);
}
public void nextBytes(byte[] bytes_arr) {
for (int iba = 0, lenba = bytes_arr.length; iba < lenba; )
for (int rndba = nextInt(),
- nba = Math.min(lenba - iba, Integer.SIZE/Byte.SIZE);
+ nba = Math.min(lenba - iba, Integer.SIZE / Byte.SIZE);
nba-- > 0; rndba >>= Byte.SIZE)
- bytes_arr[iba++] = (byte)rndba;
+ bytes_arr[iba++] = (byte) rndba;
}
} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/auxiliary/Reference.java b/src/main/java/com/github/technus/tectech/auxiliary/Reference.java
index 85f57f2c24..709ba7f620 100644
--- a/src/main/java/com/github/technus/tectech/auxiliary/Reference.java
+++ b/src/main/java/com/github/technus/tectech/auxiliary/Reference.java
@@ -1,11 +1,10 @@
-
package com.github.technus.tectech.auxiliary;
public class Reference {
- public static final String MODID = "tectech";
- public static final String NAME = "TecTech - Tec Technology!";
- public static final String VERSION = "GRADLETOKEN_VERSION";
- public static final String COLLECTIONNAME = "TecTech";
- public static final String CLIENTSIDE = "com.github.technus.tectech.proxy.ClientProxy";
- public static final String SERVERSIDE = "com.github.technus.tectech.proxy.CommonProxy";
+ public static final String MODID = "tectech";
+ public static final String NAME = "TecTech - Tec Technology!";
+ public static final String VERSION = "GRADLETOKEN_VERSION";
+ public static final String COLLECTIONNAME = "TecTech";
+ public static final String CLIENTSIDE = "com.github.technus.tectech.proxy.ClientProxy";
+ public static final String SERVERSIDE = "com.github.technus.tectech.proxy.CommonProxy";
}
diff --git a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java b/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java
index ae005b1b94..a3b03570fa 100644
--- a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java
+++ b/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java
@@ -5,34 +5,34 @@ import eu.usrv.yamcore.config.ConfigManager;
import java.io.File;
public class TecTechConfig extends ConfigManager {
- public TecTechConfig(File pConfigBaseDirectory, String pModCollectionDirectory, String pModID) {
- super(pConfigBaseDirectory, pModCollectionDirectory, pModID);
- }
-
- public boolean ModAdminErrorLogs_Enabled;
-
- public boolean DEBUG_MODE;
- public boolean BOOM_ENABLE;
-
- @Override
- protected void PreInit() {
- ModAdminErrorLogs_Enabled = false;
- DEBUG_MODE=false;
- BOOM_ENABLE=true;
- }
-
- @Override
- protected void Init() {
- ModAdminErrorLogs_Enabled = _mainConfig.getBoolean("AdminErrorLog", "Modules", ModAdminErrorLogs_Enabled,
- "If set to true, every op/admin will receive all errors occoured during the startup phase as ingame message on join");
- DEBUG_MODE=_mainConfig.getBoolean("DebugPrint", "Debug", DEBUG_MODE,
- "Enables logging");
- BOOM_ENABLE=_mainConfig.getBoolean("BoomEnable","Features", BOOM_ENABLE,
- "Set to false to disable explosions on everything bad that you can do (this will not be available after release)");
- }
-
- @Override
- protected void PostInit() {
-
- }
+ public TecTechConfig(File pConfigBaseDirectory, String pModCollectionDirectory, String pModID) {
+ super(pConfigBaseDirectory, pModCollectionDirectory, pModID);
+ }
+
+ public boolean ModAdminErrorLogs_Enabled;
+
+ public boolean DEBUG_MODE;
+ public boolean BOOM_ENABLE;
+
+ @Override
+ protected void PreInit() {
+ ModAdminErrorLogs_Enabled = false;
+ DEBUG_MODE = false;
+ BOOM_ENABLE = true;
+ }
+
+ @Override
+ protected void Init() {
+ ModAdminErrorLogs_Enabled = _mainConfig.getBoolean("AdminErrorLog", "Modules", ModAdminErrorLogs_Enabled,
+ "If set to true, every op/admin will receive all errors occoured during the startup phase as ingame message on join");
+ DEBUG_MODE = _mainConfig.getBoolean("DebugPrint", "Debug", DEBUG_MODE,
+ "Enables logging");
+ BOOM_ENABLE = _mainConfig.getBoolean("BoomEnable", "Features", BOOM_ENABLE,
+ "Set to false to disable explosions on everything bad that you can do (this will not be available after release)");
+ }
+
+ @Override
+ protected void PostInit() {
+
+ }
} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/Behaviour_elementalMatterContainer.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/Behaviour_elementalMatterContainer.java
index 6b28e3ba0a..4136d78339 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/Behaviour_elementalMatterContainer.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/Behaviour_elementalMatterContainer.java
@@ -32,16 +32,16 @@ public final class Behaviour_elementalMatterContainer extends Behaviour_None {
NBTTagCompound tNBT = aStack.getTagCompound();
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (aPlayer instanceof EntityPlayerMP) {
- aStack.stackSize=1;
+ aStack.stackSize = 1;
if (tTileEntity != null && tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity metaTE=((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if(metaTE !=null && metaTE instanceof iElementalInstanceContainer) {
- cElementalInstanceStackTree content=((iElementalInstanceContainer) metaTE).getContainerHandler();
+ IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
+ if (metaTE != null && metaTE instanceof iElementalInstanceContainer) {
+ cElementalInstanceStackTree content = ((iElementalInstanceContainer) metaTE).getContainerHandler();
if (tNBT.hasKey("content")) {
try {
content.putUnifyAll(cElementalInstanceStackTree.fromNBT(tNBT.getCompoundTag("content")));
- }catch (tElementalException e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
return true;
}
((iElementalInstanceContainer) metaTE).purgeOverflow();
@@ -65,11 +65,13 @@ public final class Behaviour_elementalMatterContainer extends Behaviour_None {
aList.add(mTooltip);
try {
NBTTagCompound tNBT = aStack.getTagCompound();
- if(tNBT.hasKey("info")) {
+ if (tNBT.hasKey("info")) {
aList.add("Contains:");
Collections.addAll(aList, cElementalInstanceStackTree.infoFromNBT(tNBT.getCompoundTag("info")));
}
- }catch(Exception e){aList.add("---Unexpected Termination---");}
+ } catch (Exception e) {
+ aList.add("---Unexpected Termination---");
+ }
return aList;
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDecay.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDecay.java
index 086d7c164e..7b9dcd91dc 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDecay.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDecay.java
@@ -6,12 +6,12 @@ import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinitio
* Created by danie_000 on 22.10.2016.
*/
public final class cElementalDecay {
- public static final cElementalDecay[] noDecay=(cElementalDecay[]) null;
- //DECAY IMPOSSIBLE!!!
- //Do not use regular NULL java will not make it work with varargs!!!
- //Or cast null into ARRAY type but this static is more convenient!!!
- public static final cElementalDecay[] noProduct=new cElementalDecay[0];
- //this in turn can be used to tell that the thing should just vanish
+ public static final cElementalDecay[] noDecay = (cElementalDecay[]) null;
+ //DECAY IMPOSSIBLE!!!
+ //Do not use regular NULL java will not make it work with varargs!!!
+ //Or cast null into ARRAY type but this static is more convenient!!!
+ public static final cElementalDecay[] noProduct = new cElementalDecay[0];
+ //this in turn can be used to tell that the thing should just vanish
public final cElementalDefinitionStackTree outputStacks;
public final float probability;
@@ -37,28 +37,28 @@ public final class cElementalDecay {
this.probability = probability;
}
- public cElementalDecay(cElementalDefinitionStackTree tree){
+ public cElementalDecay(cElementalDefinitionStackTree tree) {
this(2F, tree);
}
- public cElementalDecay(float probability,cElementalDefinitionStackTree tree){
- this.outputStacks=tree;
- this.probability=probability;
+ public cElementalDecay(float probability, cElementalDefinitionStackTree tree) {
+ this.outputStacks = tree;
+ this.probability = probability;
}
public cElementalInstanceStackTree getResults(float lifeMult, long age, int energy, int amountDecaying) {
cElementalInstanceStackTree decayResult = new cElementalInstanceStackTree();
- if(outputStacks == null) return decayResult;//This is to prevent null pointer exceptions.
- //Deny decay code is in instance!
+ if (outputStacks == null) return decayResult;//This is to prevent null pointer exceptions.
+ //Deny decay code is in instance!
int qtty = 0;
for (cElementalDefinitionStack stack : outputStacks.values()) qtty += stack.amount;
- if(qtty<=0) return decayResult;
+ if (qtty <= 0) return decayResult;
//energy /= qtty;
//lifeMult /= (float) qtty;
for (cElementalDefinitionStack stack : outputStacks.values()) {
decayResult.putUnify(new cElementalInstanceStack(stack.definition,
amountDecaying * stack.amount,
- lifeMult, age, energy/Math.max(1,stack.amount)));//get instances from stack
+ lifeMult, age, energy / Math.max(1, stack.amount)));//get instances from stack
}
return decayResult;
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java
index 827df7e684..01a55805d8 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java
@@ -15,54 +15,54 @@ import static com.github.technus.tectech.elementalMatter.definitions.cPrimitiveD
*/
public abstract class cElementalDefinition implements iElementalDefinition {
//add text based creators for recipe formula input?
- private static final TreeMap<Byte,Method> nbtCreationBind=new TreeMap<>();//creator methods in subclasses
+ private static final TreeMap<Byte, Method> nbtCreationBind = new TreeMap<>();//creator methods in subclasses
- protected static Method addCreatorFromNBT(byte b,Method m){
- return nbtCreationBind.put(b,m);
+ protected static Method addCreatorFromNBT(byte b, Method m) {
+ return nbtCreationBind.put(b, m);
}
//Nothing array
public static final iElementalDefinition[] nothing = new cElementalPrimitive[0];
- public static iElementalDefinition fromNBT(NBTTagCompound nbt){
+ public static iElementalDefinition fromNBT(NBTTagCompound nbt) {
try {
return (iElementalDefinition) nbtCreationBind.get(nbt.getByte("t")).invoke(null, nbt);
- }catch(Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
return debug__;
}
}
@Override
public final boolean equals(Object obj) {
- if(obj instanceof iElementalDefinition)
- return compareTo((iElementalDefinition) obj)==0;
- if(obj instanceof iHasElementalDefinition)
- return compareTo(((iHasElementalDefinition) obj).getDefinition())==0;
+ if (obj instanceof iElementalDefinition)
+ return compareTo((iElementalDefinition) obj) == 0;
+ if (obj instanceof iHasElementalDefinition)
+ return compareTo(((iHasElementalDefinition) obj).getDefinition()) == 0;
return false;
}
@Override
public int compareTo(iElementalDefinition o) {
- if(getClassType()==o.getClassType()){
+ if (getClassType() == o.getClassType()) {
//only of the internal def stacks!!!
//that allows neat check if the same thing and
//top hierarchy amount can be used to store amount info
- return compareDefinitionStacksWithAmount(getSubParticles().values(),o.getSubParticles().values());
+ return compareDefinitionStacksWithAmount(getSubParticles().values(), o.getSubParticles().values());
}
return compareClasses(o);
}
- public final int compareClasses(iElementalDefinition obj){
- return ((int)getClassType())-obj.getClassType();
+ public final int compareClasses(iElementalDefinition obj) {
+ return ((int) getClassType()) - obj.getClassType();
}
//use only for nested operations!
- private static int compareDefinitionStacksWithAmount(cElementalDefinitionStack[] tc, cElementalDefinitionStack[] sc){
- if(tc == null)
- if(sc == null) return 0;
+ private static int compareDefinitionStacksWithAmount(cElementalDefinitionStack[] tc, cElementalDefinitionStack[] sc) {
+ if (tc == null)
+ if (sc == null) return 0;
else return -1;
- if(sc == null) return 1;
+ if (sc == null) return 1;
if (tc.length > sc.length) return 1;
if (tc.length < sc.length) return -1;
@@ -71,7 +71,7 @@ public abstract class cElementalDefinition implements iElementalDefinition {
int cn = tc[i].definition.compareTo(sc[i].definition);
if (cn != 0) return cn;
- if (tc[i].amount > sc[i].amount) return 1;
+ if (tc[i].amount > sc[i].amount) return 1;
if (tc[i].amount < sc[i].amount) return -1;
}
return 0;
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStack.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStack.java
index 679c1a9c43..a2ec188820 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStack.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStack.java
@@ -14,7 +14,7 @@ public final class cElementalDefinitionStack implements iHasElementalDefinition
public final int amount;
public cElementalDefinitionStack(iElementalDefinition def, int amount) {
- this.definition = def==null?null__:def;
+ this.definition = def == null ? null__ : def;
this.amount = amount;
}
@@ -43,32 +43,32 @@ public final class cElementalDefinitionStack implements iHasElementalDefinition
@Override
public boolean equals(Object obj) {
- if(obj instanceof iElementalDefinition)
- return definition.compareTo((iElementalDefinition) obj)==0;
- if(obj instanceof iHasElementalDefinition)
- return definition.compareTo(((iHasElementalDefinition) obj).getDefinition())==0;
+ if (obj instanceof iElementalDefinition)
+ return definition.compareTo((iElementalDefinition) obj) == 0;
+ if (obj instanceof iHasElementalDefinition)
+ return definition.compareTo(((iHasElementalDefinition) obj).getDefinition()) == 0;
return false;
}
public NBTTagCompound toNBT() {
- NBTTagCompound nbt=new NBTTagCompound();
- nbt.setTag("d",definition.toNBT());
- nbt.setInteger("q",amount);
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setTag("d", definition.toNBT());
+ nbt.setInteger("q", amount);
return nbt;
}
- public static cElementalDefinitionStack fromNBT(NBTTagCompound nbt){
+ public static cElementalDefinitionStack fromNBT(NBTTagCompound nbt) {
return new cElementalDefinitionStack(
cElementalDefinition.fromNBT(nbt.getCompoundTag("d")),
nbt.getInteger("q"));
}
- public cElementalDefinitionStack unifyIntoNew(cElementalDefinitionStack... other){
- if(other==null)return this;
- int i=amount;
- for(cElementalDefinitionStack stack:other)
- if(stack!=null)
- i+=stack.amount;
- return new cElementalDefinitionStack(definition,i);
+ public cElementalDefinitionStack unifyIntoNew(cElementalDefinitionStack... other) {
+ if (other == null) return this;
+ int i = amount;
+ for (cElementalDefinitionStack stack : other)
+ if (stack != null)
+ i += stack.amount;
+ return new cElementalDefinitionStack(definition, i);
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStackTree.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStackTree.java
index 347c46b1a4..969fa1cbf7 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStackTree.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinitionStackTree.java
@@ -14,29 +14,31 @@ import static com.github.technus.tectech.elementalMatter.definitions.cPrimitiveD
* Created by danie_000 on 22.01.2017.
*/
public final class cElementalDefinitionStackTree implements Comparable<cElementalDefinitionStackTree> {
- private TreeMap<iElementalDefinition,cElementalDefinitionStack> tree=new TreeMap<>();
-//Constructors
- public cElementalDefinitionStackTree(){}
+ private TreeMap<iElementalDefinition, cElementalDefinitionStack> tree = new TreeMap<>();
+
+ //Constructors
+ public cElementalDefinitionStackTree() {
+ }
@Deprecated
- public cElementalDefinitionStackTree(iElementalDefinition... in){
- if(in==null)return;
- for(iElementalDefinition definition:in)
- tree.put(definition, new cElementalDefinitionStack(definition,1));
+ public cElementalDefinitionStackTree(iElementalDefinition... in) {
+ if (in == null) return;
+ for (iElementalDefinition definition : in)
+ tree.put(definition, new cElementalDefinitionStack(definition, 1));
}
- public cElementalDefinitionStackTree(cElementalDefinitionStack... in){
- if(in==null)return;
- for(cElementalDefinitionStack stack:in)
+ public cElementalDefinitionStackTree(cElementalDefinitionStack... in) {
+ if (in == null) return;
+ for (cElementalDefinitionStack stack : in)
tree.put(stack.definition, stack);
}
- private cElementalDefinitionStackTree(TreeMap<iElementalDefinition,cElementalDefinitionStack> in){
- if(in==null)return;
- tree=in;
+ private cElementalDefinitionStackTree(TreeMap<iElementalDefinition, cElementalDefinitionStack> in) {
+ if (in == null) return;
+ tree = in;
}
- public cElementalDefinitionStackTree(cElementalDefinitionStackTree in){
+ public cElementalDefinitionStackTree(cElementalDefinitionStackTree in) {
this(in.tree);
}
@@ -47,53 +49,53 @@ public final class cElementalDefinitionStackTree implements Comparable<cElementa
@Override
public int compareTo(cElementalDefinitionStackTree o) {
- if(tree.size()!=o.tree.size())return tree.size()-o.tree.size();
- cElementalDefinitionStack[] ofThis=values(),ofThat=o.values();
- for(int i=0;i<ofThat.length;i++){
- int result=ofThis[i].compareTo(ofThat[i]);
- if(result!=0) return result;
+ if (tree.size() != o.tree.size()) return tree.size() - o.tree.size();
+ cElementalDefinitionStack[] ofThis = values(), ofThat = o.values();
+ for (int i = 0; i < ofThat.length; i++) {
+ int result = ofThis[i].compareTo(ofThat[i]);
+ if (result != 0) return result;
}
return 0;
}
//Removers
- public void clear(){
+ public void clear() {
tree.clear();
}
- public cElementalDefinitionStack remove(iElementalDefinition def){
+ public cElementalDefinitionStack remove(iElementalDefinition def) {
return tree.remove(def);
}
@Deprecated
- public cElementalDefinitionStack remove(iHasElementalDefinition has){
+ public cElementalDefinitionStack remove(iHasElementalDefinition has) {
return tree.remove(has.getDefinition());
}
- public void removeAll(iElementalDefinition... definitions){
- for(iElementalDefinition def:definitions)
+ public void removeAll(iElementalDefinition... definitions) {
+ for (iElementalDefinition def : definitions)
tree.remove(def);
}
@Deprecated
- private void removeAll(iHasElementalDefinition... hasElementals){
- for(iHasElementalDefinition has:hasElementals)
+ private void removeAll(iHasElementalDefinition... hasElementals) {
+ for (iHasElementalDefinition has : hasElementals)
tree.remove(has.getDefinition());
}
-//Remove amounts
- public boolean removeAmount(boolean testOnly, cElementalInstanceStack instance){
- final cElementalDefinitionStack target=tree.get(instance.definition);
- if(target==null)
+ //Remove amounts
+ public boolean removeAmount(boolean testOnly, cElementalInstanceStack instance) {
+ final cElementalDefinitionStack target = tree.get(instance.definition);
+ if (target == null)
return false;
- if(testOnly)
- return target.amount>=instance.amount;
- else{
- final int diff=target.amount-instance.amount;
- if(diff>0) {
- tree.put(target.definition,new cElementalDefinitionStack(target.definition,diff));
+ if (testOnly)
+ return target.amount >= instance.amount;
+ else {
+ final int diff = target.amount - instance.amount;
+ if (diff > 0) {
+ tree.put(target.definition, new cElementalDefinitionStack(target.definition, diff));
return true;
- }else if(diff==0){
+ } else if (diff == 0) {
tree.remove(instance.definition);
return true;
}
@@ -101,18 +103,18 @@ public final class cElementalDefinitionStackTree implements Comparable<cElementa
return false;
}
- public boolean removeAmount(boolean testOnly, cElementalDefinitionStack stack){
- final cElementalDefinitionStack target=tree.get(stack.definition);
- if(target==null)
+ public boolean removeAmount(boolean testOnly, cElementalDefinitionStack stack) {
+ final cElementalDefinitionStack target = tree.get(stack.definition);
+ if (target == null)
return false;
- if(testOnly)
- return target.amount>=stack.amount;
- else{
- final int diff=target.amount-stack.amount;
- if(diff>0) {
- tree.put(target.definition,new cElementalDefinitionStack(target.definition,diff));
+ if (testOnly)
+ return target.amount >= stack.amount;
+ else {
+ final int diff = target.amount - stack.amount;
+ if (diff > 0) {
+ tree.put(target.definition, new cElementalDefinitionStack(target.definition, diff));
return true;
- }else if(diff==0){
+ } else if (diff == 0) {
tree.remove(stack.definition);
return true;
}
@@ -121,183 +123,184 @@ public final class cElementalDefinitionStackTree implements Comparable<cElementa
}
@Deprecated
- public boolean removeAmount(boolean testOnly, iElementalDefinition def){
- return removeAmount(testOnly,new cElementalDefinitionStack(def,1));
+ public boolean removeAmount(boolean testOnly, iElementalDefinition def) {
+ return removeAmount(testOnly, new cElementalDefinitionStack(def, 1));
}
public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStack... instances) {
- boolean test=true;
- for(cElementalInstanceStack stack:instances)
- test&=removeAmount(true,stack);
- if(testOnly || !test)return test;
- for(cElementalInstanceStack stack:instances)
- removeAmount(false,stack);
+ boolean test = true;
+ for (cElementalInstanceStack stack : instances)
+ test &= removeAmount(true, stack);
+ if (testOnly || !test) return test;
+ for (cElementalInstanceStack stack : instances)
+ removeAmount(false, stack);
return true;
}
- public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStack... stacks){
- boolean test=true;
- for(cElementalDefinitionStack stack:stacks)
- test&=removeAmount(true,stack);
- if(testOnly || !test)return test;
- for(cElementalDefinitionStack stack:stacks)
- removeAmount(false,stack);
+ public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStack... stacks) {
+ boolean test = true;
+ for (cElementalDefinitionStack stack : stacks)
+ test &= removeAmount(true, stack);
+ if (testOnly || !test) return test;
+ for (cElementalDefinitionStack stack : stacks)
+ removeAmount(false, stack);
return true;
}
@Deprecated
- public boolean removeAllAmounts(boolean testOnly, iElementalDefinition... definitions){
- final cElementalDefinitionStack[] stacks=new cElementalDefinitionStack[definitions.length];
- for (int i=0;i<stacks.length;i++)
- stacks[i]=new cElementalDefinitionStack(definitions[i],1);
- return removeAllAmounts(testOnly,stacks);
+ public boolean removeAllAmounts(boolean testOnly, iElementalDefinition... definitions) {
+ final cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[definitions.length];
+ for (int i = 0; i < stacks.length; i++)
+ stacks[i] = new cElementalDefinitionStack(definitions[i], 1);
+ return removeAllAmounts(testOnly, stacks);
}
- public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStackTree container){
- return removeAllAmounts(testOnly,container.values());
+ public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStackTree container) {
+ return removeAllAmounts(testOnly, container.values());
}
- public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStackTree container){
- return removeAllAmounts(testOnly,container.values());
+ public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStackTree container) {
+ return removeAllAmounts(testOnly, container.values());
}
-//Put replace
- public cElementalDefinitionStack putReplace(cElementalDefinitionStack defStackUnsafe){
- return tree.put(defStackUnsafe.definition,defStackUnsafe);
+ //Put replace
+ public cElementalDefinitionStack putReplace(cElementalDefinitionStack defStackUnsafe) {
+ return tree.put(defStackUnsafe.definition, defStackUnsafe);
}
- public void putReplaceAll(cElementalDefinitionStack... defStacks){
- for(cElementalDefinitionStack defStack:defStacks)
- this.tree.put(defStack.definition,defStack);
+ public void putReplaceAll(cElementalDefinitionStack... defStacks) {
+ for (cElementalDefinitionStack defStack : defStacks)
+ this.tree.put(defStack.definition, defStack);
}
- private void putReplaceAll(Map<iElementalDefinition,cElementalDefinitionStack> inTreeUnsafe){
+ private void putReplaceAll(Map<iElementalDefinition, cElementalDefinitionStack> inTreeUnsafe) {
this.tree.putAll(inTreeUnsafe);
}
- public void putReplaceAll(cElementalDefinitionStackTree inContainerUnsafe){
+ public void putReplaceAll(cElementalDefinitionStackTree inContainerUnsafe) {
putReplaceAll(inContainerUnsafe.tree);
}
-//Put unify
- public cElementalDefinitionStack putUnify(cElementalDefinitionStack def){
- return tree.put(def.definition,def.unifyIntoNew(tree.get(def.definition)));
+ //Put unify
+ public cElementalDefinitionStack putUnify(cElementalDefinitionStack def) {
+ return tree.put(def.definition, def.unifyIntoNew(tree.get(def.definition)));
}
@Deprecated
- public cElementalDefinitionStack putUnify(iElementalDefinition def){
- return putUnify(new cElementalDefinitionStack(def,1));
+ public cElementalDefinitionStack putUnify(iElementalDefinition def) {
+ return putUnify(new cElementalDefinitionStack(def, 1));
}
- public void putUnifyAll(cElementalDefinitionStack... defs){
- for(cElementalDefinitionStack def:defs)
+ public void putUnifyAll(cElementalDefinitionStack... defs) {
+ for (cElementalDefinitionStack def : defs)
putUnify(def);
}
@Deprecated
- public void putUnifyAll(iElementalDefinition... defs){
- for(iElementalDefinition def:defs)
+ public void putUnifyAll(iElementalDefinition... defs) {
+ for (iElementalDefinition def : defs)
putUnify(def);
}
- private void putUnifyAll(Map<iElementalDefinition,cElementalDefinitionStack> inTreeUnsafe){
- for (cElementalDefinitionStack in:inTreeUnsafe.values())
+ private void putUnifyAll(Map<iElementalDefinition, cElementalDefinitionStack> inTreeUnsafe) {
+ for (cElementalDefinitionStack in : inTreeUnsafe.values())
putUnify(in);
}
- public void putUnifyAll(cElementalDefinitionStackTree containerUnsafe){
+ public void putUnifyAll(cElementalDefinitionStackTree containerUnsafe) {
putUnifyAll(containerUnsafe.tree);
}
-//Getters
- public cElementalDefinitionStack getDefinitionStack(iElementalDefinition def){
+
+ //Getters
+ public cElementalDefinitionStack getDefinitionStack(iElementalDefinition def) {
return tree.get(def);
}
public String[] getElementalInfo() {
- final String[] info=new String[tree.size()*3];
- int i=0;
- for(cElementalDefinitionStack defStack:tree.values()){
- info[i ]=EnumChatFormatting.BLUE + defStack.definition.getName();
- info[i+1]=EnumChatFormatting.AQUA + defStack.definition.getSymbol();
- info[i+2]="Amount "+EnumChatFormatting.GREEN + defStack.amount;
- i+=3;
+ final String[] info = new String[tree.size() * 3];
+ int i = 0;
+ for (cElementalDefinitionStack defStack : tree.values()) {
+ info[i] = EnumChatFormatting.BLUE + defStack.definition.getName();
+ info[i + 1] = EnumChatFormatting.AQUA + defStack.definition.getSymbol();
+ info[i + 2] = "Amount " + EnumChatFormatting.GREEN + defStack.amount;
+ i += 3;
}
return info;
}
- public cElementalDefinitionStack[] values(){
+ public cElementalDefinitionStack[] values() {
return tree.values().toArray(new cElementalDefinitionStack[0]);
}
- public iElementalDefinition[] keys(){
+ public iElementalDefinition[] keys() {
return tree.keySet().toArray(new iElementalDefinition[0]);
}
-//Tests
- public boolean containsDefinition(iElementalDefinition def){
+ //Tests
+ public boolean containsDefinition(iElementalDefinition def) {
return tree.containsKey(def);
}
- public boolean containsDefinitionStack(cElementalDefinitionStack inst){
+ public boolean containsDefinitionStack(cElementalDefinitionStack inst) {
return tree.containsValue(inst);
}
- public int size(){
+ public int size() {
return tree.size();
}
- public boolean hasStacks(){
- return tree.size()>0;
+ public boolean hasStacks() {
+ return tree.size() > 0;
}
-//NBT
- public NBTTagCompound getInfoNBT(){
- final NBTTagCompound nbt=new NBTTagCompound();
- final String[] info=getElementalInfo();
- nbt.setInteger("i",info.length);
- for(int i=0;i<info.length;i++)
- nbt.setString(Integer.toString(i),info[i]);
+ //NBT
+ public NBTTagCompound getInfoNBT() {
+ final NBTTagCompound nbt = new NBTTagCompound();
+ final String[] info = getElementalInfo();
+ nbt.setInteger("i", info.length);
+ for (int i = 0; i < info.length; i++)
+ nbt.setString(Integer.toString(i), info[i]);
return nbt;
}
- public static String[] infoFromNBT(NBTTagCompound nbt){
- final String[] strings=new String[nbt.getInteger("i")];
- for(int i=0;i<strings.length;i++)
- strings[i]=nbt.getString(Integer.toString(i));
+ public static String[] infoFromNBT(NBTTagCompound nbt) {
+ final String[] strings = new String[nbt.getInteger("i")];
+ for (int i = 0; i < strings.length; i++)
+ strings[i] = nbt.getString(Integer.toString(i));
return strings;
}
public NBTTagCompound toNBT() {
- final NBTTagCompound nbt=new NBTTagCompound();
- nbt.setInteger("i",tree.size());
- int i=0;
- for(cElementalDefinitionStack defStack: tree.values())
- nbt.setTag(Integer.toString(i++),defStack.toNBT());
+ final NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setInteger("i", tree.size());
+ int i = 0;
+ for (cElementalDefinitionStack defStack : tree.values())
+ nbt.setTag(Integer.toString(i++), defStack.toNBT());
return nbt;
}
- public static cElementalDefinitionStackTree fromNBT(NBTTagCompound nbt) throws tElementalException{
- final cElementalDefinitionStack[] defStacks=new cElementalDefinitionStack[nbt.getInteger("i")];
- for(int i=0;i<defStacks.length;i++) {
+ public static cElementalDefinitionStackTree fromNBT(NBTTagCompound nbt) throws tElementalException {
+ final cElementalDefinitionStack[] defStacks = new cElementalDefinitionStack[nbt.getInteger("i")];
+ for (int i = 0; i < defStacks.length; i++) {
defStacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i)));
- if(defStacks[i].definition.equals(debug__))
+ if (defStacks[i].definition.equals(debug__))
throw new tElementalException("Something went Wrong");
}
return new cElementalDefinitionStackTree(defStacks);
}
-//stackUp
+ //stackUp
@Deprecated
- public static cElementalDefinitionStackTree stackUpTree(iElementalDefinition... in){
- final cElementalDefinitionStackTree inTree=new cElementalDefinitionStackTree();
- for(iElementalDefinition def:in){
- inTree.putUnify(new cElementalDefinitionStack(def,1));
+ public static cElementalDefinitionStackTree stackUpTree(iElementalDefinition... in) {
+ final cElementalDefinitionStackTree inTree = new cElementalDefinitionStackTree();
+ for (iElementalDefinition def : in) {
+ inTree.putUnify(new cElementalDefinitionStack(def, 1));
}
return inTree;
}
- public static cElementalDefinitionStackTree stackUpTree(cElementalDefinitionStack... in){
- final cElementalDefinitionStackTree inTree=new cElementalDefinitionStackTree();
+ public static cElementalDefinitionStackTree stackUpTree(cElementalDefinitionStack... in) {
+ final cElementalDefinitionStackTree inTree = new cElementalDefinitionStackTree();
inTree.putUnifyAll(in);
return inTree;
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStack.java
index 8698463bca..1c4d165018 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStack.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStack.java
@@ -26,7 +26,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
}
public cElementalInstanceStack(cElementalDefinitionStack stackSafe, float lifeTimeMult, long age, int energy) {
- this(stackSafe.definition,stackSafe.amount,lifeTimeMult,age,energy);
+ this(stackSafe.definition, stackSafe.amount, lifeTimeMult, age, energy);
}
public cElementalInstanceStack(iElementalDefinition defSafe, int amount) {
@@ -34,7 +34,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
}
public cElementalInstanceStack(iElementalDefinition defSafe, int amount, float lifeTimeMult, long age, int energy) {
- this.definition = defSafe==null?null__:defSafe;
+ this.definition = defSafe == null ? null__ : defSafe;
byte color = definition.getColor();
if (color < (byte) 0) {//transforms colorable??? into proper color
this.color = color;
@@ -45,7 +45,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
this.lifeTime = definition.getRawLifeTime() * this.lifeTimeMult;
this.age = age;
this.energy = energy;
- this.amount=amount;
+ this.amount = amount;
}
@Override
@@ -62,7 +62,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
}
public cElementalDefinitionStack getDefinitionStack() {
- return new cElementalDefinitionStack(definition,amount);
+ return new cElementalDefinitionStack(definition, amount);
}
@Override
@@ -134,7 +134,8 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
private cElementalInstanceStackTree decayCompute(cElementalDecay[] decays, float lifeTimeMult, long age, int energy) {
if (decays == null) return null;//Can not decay so it wont
- else if (decays.length == 0) return new cElementalInstanceStackTree();//provide non null 0 length array for annihilation
+ else if (decays.length == 0)
+ return new cElementalInstanceStackTree();//provide non null 0 length array for annihilation
else if (decays.length == 1) {//only one type of decay :D, doesn't need dead end
return decays[0].getResults(lifeTimeMult, age, energy, this.amount);
} else {
@@ -194,7 +195,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
}
public cElementalInstanceStack getCopy() {
- cElementalInstanceStack cI = new cElementalInstanceStack(definition,amount, lifeTimeMult, age, energy);
+ cElementalInstanceStack cI = new cElementalInstanceStack(definition, amount, lifeTimeMult, age, energy);
cI.setColor(color);
return cI;
}
@@ -206,21 +207,21 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
@Override
public boolean equals(Object obj) {
- if(obj instanceof iElementalDefinition)
- return definition.compareTo((iElementalDefinition) obj)==0;
- if(obj instanceof iHasElementalDefinition)
- return definition.compareTo(((iHasElementalDefinition) obj).getDefinition())==0;
+ if (obj instanceof iElementalDefinition)
+ return definition.compareTo((iElementalDefinition) obj) == 0;
+ if (obj instanceof iHasElementalDefinition)
+ return definition.compareTo(((iHasElementalDefinition) obj).getDefinition()) == 0;
return false;
}
- public cElementalInstanceStack unifyIntoThis(cElementalInstanceStack... instances){
- if(instances==null)return this;
+ public cElementalInstanceStack unifyIntoThis(cElementalInstanceStack... instances) {
+ if (instances == null) return this;
//returns with the definition from the first object passed
- int energy=this.energy*this.amount;
- float lifeTimeMul=this.lifeTimeMult;
+ int energy = this.energy * this.amount;
+ float lifeTimeMul = this.lifeTimeMult;
- for(cElementalInstanceStack instance:instances){
- if(instance!=null && this.compareTo(instance)==0) {
+ for (cElementalInstanceStack instance : instances) {
+ if (instance != null && this.compareTo(instance) == 0) {
this.amount += instance.amount;
energy += instance.energy * instance.amount;
lifeTimeMul = Math.min(lifeTimeMul, instance.lifeTimeMult);
@@ -228,27 +229,27 @@ public final class cElementalInstanceStack implements iHasElementalDefinition {
}
}
- if(amount!=0)energy/=Math.abs(amount);
+ if (amount != 0) energy /= Math.abs(amount);
- this.energy=energy;
+ this.energy = energy;
this.multLifeTime(lifeTimeMul);
return this;
}
public NBTTagCompound toNBT() {
- NBTTagCompound nbt=new NBTTagCompound();
+ NBTTagCompound nbt = new NBTTagCompound();
nbt.setTag("d", definition.toNBT());
- nbt.setInteger("q",amount);
- nbt.setInteger("e",energy);
- nbt.setByte("c",color);
- nbt.setLong("a",age);
- nbt.setFloat("m",lifeTimeMult);
+ nbt.setInteger("q", amount);
+ nbt.setInteger("e", energy);
+ nbt.setByte("c", color);
+ nbt.setLong("a", age);
+ nbt.setFloat("m", lifeTimeMult);
return nbt;
}
- public static cElementalInstanceStack fromNBT(NBTTagCompound nbt){
- NBTTagCompound definition=nbt.getCompoundTag("d");
- cElementalInstanceStack instance= new cElementalInstanceStack(
+ public static cElementalInstanceStack fromNBT(NBTTagCompound nbt) {
+ NBTTagCompound definition = nbt.getCompoundTag("d");
+ cElementalInstanceStack instance = new cElementalInstanceStack(
cElementalDefinition.fromNBT(definition),
nbt.getInteger("q"),
nbt.getFloat("m"),
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStackTree.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStackTree.java
index a7cf708197..24474229ee 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStackTree.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalInstanceStackTree.java
@@ -14,48 +14,50 @@ import static com.github.technus.tectech.elementalMatter.definitions.cPrimitiveD
* Created by danie_000 on 22.01.2017.
*/
public final class cElementalInstanceStackTree implements Comparable<cElementalInstanceStackTree> {
- private TreeMap<iElementalDefinition,cElementalInstanceStack> tree=new TreeMap<>();
-//Constructors
- public cElementalInstanceStackTree(){}
+ private TreeMap<iElementalDefinition, cElementalInstanceStack> tree = new TreeMap<>();
- public cElementalInstanceStackTree(cElementalInstanceStack... inSafe){
+ //Constructors
+ public cElementalInstanceStackTree() {
+ }
+
+ public cElementalInstanceStackTree(cElementalInstanceStack... inSafe) {
this(true, inSafe);
}
- public cElementalInstanceStackTree(boolean copy, cElementalInstanceStack... in){
- if(in==null)return;
- if(copy){
- for(cElementalInstanceStack instance:in) {
+ public cElementalInstanceStackTree(boolean copy, cElementalInstanceStack... in) {
+ if (in == null) return;
+ if (copy) {
+ for (cElementalInstanceStack instance : in) {
tree.put(instance.definition, instance.getCopy());
}
- }else{
- for(cElementalInstanceStack instance:in) {
+ } else {
+ for (cElementalInstanceStack instance : in) {
tree.put(instance.definition, instance);
}
}
}
- private cElementalInstanceStackTree(TreeMap<iElementalDefinition,cElementalInstanceStack> inSafe){
- this(true,inSafe);
+ private cElementalInstanceStackTree(TreeMap<iElementalDefinition, cElementalInstanceStack> inSafe) {
+ this(true, inSafe);
}
- private cElementalInstanceStackTree(boolean copy, TreeMap<iElementalDefinition,cElementalInstanceStack> in){
- if(in==null)return;
- if(copy){
- for(cElementalInstanceStack instance:in.values()){
- tree.put(instance.definition,instance.getCopy());
+ private cElementalInstanceStackTree(boolean copy, TreeMap<iElementalDefinition, cElementalInstanceStack> in) {
+ if (in == null) return;
+ if (copy) {
+ for (cElementalInstanceStack instance : in.values()) {
+ tree.put(instance.definition, instance.getCopy());
}
- }else{
- tree=in;
+ } else {
+ tree = in;
}
}
- public cElementalInstanceStackTree(cElementalInstanceStackTree inSafe){
- this(true,inSafe.tree);
+ public cElementalInstanceStackTree(cElementalInstanceStackTree inSafe) {
+ this(true, inSafe.tree);
}
- public cElementalInstanceStackTree(boolean copy, cElementalInstanceStackTree in){
- this(copy,in.tree);
+ public cElementalInstanceStackTree(boolean copy, cElementalInstanceStackTree in) {
+ this(copy, in.tree);
}
@Override
@@ -65,53 +67,53 @@ public final class cElementalInstanceStackTree implements Comparable<cElementalI
@Override
public int compareTo(cElementalInstanceStackTree o) {
- if(tree.size()!=o.tree.size())return tree.size()-o.tree.size();
- cElementalInstanceStack[] ofThis=values(),ofThat=o.values();
- for(int i=0;i<ofThat.length;i++){
- int result=ofThis[i].compareTo(ofThat[i]);
- if(result!=0) return result;
+ if (tree.size() != o.tree.size()) return tree.size() - o.tree.size();
+ cElementalInstanceStack[] ofThis = values(), ofThat = o.values();
+ for (int i = 0; i < ofThat.length; i++) {
+ int result = ofThis[i].compareTo(ofThat[i]);
+ if (result != 0) return result;
}
return 0;
}
-//Removers
- public void clear(){
+ //Removers
+ public void clear() {
tree.clear();
}
- public cElementalInstanceStack remove(iElementalDefinition def){
+ public cElementalInstanceStack remove(iElementalDefinition def) {
return tree.remove(def);
}
@Deprecated
- public cElementalInstanceStack remove(iHasElementalDefinition has){
+ public cElementalInstanceStack remove(iHasElementalDefinition has) {
return tree.remove(has.getDefinition());
}
- public void removeAll(iElementalDefinition... definitions){
- for(iElementalDefinition def:definitions)
+ public void removeAll(iElementalDefinition... definitions) {
+ for (iElementalDefinition def : definitions)
tree.remove(def);
}
@Deprecated
- private void removeAll(iHasElementalDefinition... hasElementals){
- for(iHasElementalDefinition has:hasElementals)
+ private void removeAll(iHasElementalDefinition... hasElementals) {
+ for (iHasElementalDefinition has : hasElementals)
tree.remove(has.getDefinition());
}
-//Remove amounts
- public boolean removeAmount(boolean testOnly, cElementalInstanceStack instance){
- final cElementalInstanceStack target=tree.get(instance.definition);
- if(target==null)
+ //Remove amounts
+ public boolean removeAmount(boolean testOnly, cElementalInstanceStack instance) {
+ final cElementalInstanceStack target = tree.get(instance.definition);
+ if (target == null)
return false;
- if(testOnly)
- return target.amount>=instance.amount;
- else{
- final int diff=target.amount-instance.amount;
- if(diff>0) {
- target.amount=diff;
+ if (testOnly)
+ return target.amount >= instance.amount;
+ else {
+ final int diff = target.amount - instance.amount;
+ if (diff > 0) {
+ target.amount = diff;
return true;
- }else if(diff==0){
+ } else if (diff == 0) {
tree.remove(instance.definition);
return true;
}
@@ -119,18 +121,18 @@ public final class cElementalInstanceStackTree implements Comparable<cElementalI
return false;
}
- public boolean removeAmount(boolean testOnly, cElementalDefinitionStack stack){
- final cElementalInstanceStack target=tree.get(stack.definition);
- if(target==null)
+ public boolean removeAmount(boolean testOnly, cElementalDefinitionStack stack) {
+ final cElementalInstanceStack target = tree.get(stack.definition);
+ if (target == null)
return false;
- if(testOnly)
- return target.amount>=stack.amount;
- else{
- final int diff=target.amount-stack.amount;
- if(diff>0) {
- target.amount=diff;
+ if (testOnly)
+ return target.amount >= stack.amount;
+ else {
+ final int diff = target.amount - stack.amount;
+ if (diff > 0) {
+ target.amount = diff;
return true;
- }else if(diff==0){
+ } else if (diff == 0) {
tree.remove(stack.definition);
return true;
}
@@ -139,220 +141,221 @@ public final class cElementalInstanceStackTree implements Comparable<cElementalI
}
@Deprecated
- public boolean removeAmount(boolean testOnly, iElementalDefinition def){
- return removeAmount(testOnly,new cElementalDefinitionStack(def,1));
+ public boolean removeAmount(boolean testOnly, iElementalDefinition def) {
+ return removeAmount(testOnly, new cElementalDefinitionStack(def, 1));
}
public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStack... instances) {
- boolean test=true;
- for(cElementalInstanceStack stack:instances)
- test&=removeAmount(true,stack);
- if(testOnly || !test)return test;
- for(cElementalInstanceStack stack:instances)
- removeAmount(false,stack);
+ boolean test = true;
+ for (cElementalInstanceStack stack : instances)
+ test &= removeAmount(true, stack);
+ if (testOnly || !test) return test;
+ for (cElementalInstanceStack stack : instances)
+ removeAmount(false, stack);
return true;
}
- public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStack... stacks){
- boolean test=true;
- for(cElementalDefinitionStack stack:stacks)
- test&=removeAmount(true,stack);
- if(testOnly || !test)return test;
- for(cElementalDefinitionStack stack:stacks)
- removeAmount(false,stack);
+ public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStack... stacks) {
+ boolean test = true;
+ for (cElementalDefinitionStack stack : stacks)
+ test &= removeAmount(true, stack);
+ if (testOnly || !test) return test;
+ for (cElementalDefinitionStack stack : stacks)
+ removeAmount(false, stack);
return true;
}
@Deprecated
- public boolean removeAllAmounts(boolean testOnly, iElementalDefinition... definitions){
- final cElementalDefinitionStack[] stacks=new cElementalDefinitionStack[definitions.length];
- for (int i=0;i<stacks.length;i++)
- stacks[i]=new cElementalDefinitionStack(definitions[i],1);
- return removeAllAmounts(testOnly,stacks);
+ public boolean removeAllAmounts(boolean testOnly, iElementalDefinition... definitions) {
+ final cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[definitions.length];
+ for (int i = 0; i < stacks.length; i++)
+ stacks[i] = new cElementalDefinitionStack(definitions[i], 1);
+ return removeAllAmounts(testOnly, stacks);
}
- public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStackTree container){
- return removeAllAmounts(testOnly,container.values());
+ public boolean removeAllAmounts(boolean testOnly, cElementalDefinitionStackTree container) {
+ return removeAllAmounts(testOnly, container.values());
}
- public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStackTree container){
- return removeAllAmounts(testOnly,container.values());
+ public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStackTree container) {
+ return removeAllAmounts(testOnly, container.values());
}
-//Remove overflow
- public float removeOverflow(int stacksCount,int stackCapacity){
- float massRemoved=0;
+ //Remove overflow
+ public float removeOverflow(int stacksCount, int stackCapacity) {
+ float massRemoved = 0;
- if(tree.size()>stacksCount) {
- iElementalDefinition[] keys= this.keys();
- for(int i=stacksCount;i<keys.length;i++){
- massRemoved+=tree.get(keys[i]).getDefinitionStack().getMass();
+ if (tree.size() > stacksCount) {
+ iElementalDefinition[] keys = this.keys();
+ for (int i = stacksCount; i < keys.length; i++) {
+ massRemoved += tree.get(keys[i]).getDefinitionStack().getMass();
tree.remove(keys[i]);
}
}
- for(cElementalInstanceStack instance:this.values())
- if(instance.amount>stackCapacity) {
- massRemoved+=instance.definition.getMass()*(instance.amount-stackCapacity);
- instance.amount=stackCapacity;
+ for (cElementalInstanceStack instance : this.values())
+ if (instance.amount > stackCapacity) {
+ massRemoved += instance.definition.getMass() * (instance.amount - stackCapacity);
+ instance.amount = stackCapacity;
}
return massRemoved;
}
-//Put replace
- public cElementalInstanceStack putReplace(cElementalInstanceStack instanceUnsafe){
- return tree.put(instanceUnsafe.definition,instanceUnsafe);
+ //Put replace
+ public cElementalInstanceStack putReplace(cElementalInstanceStack instanceUnsafe) {
+ return tree.put(instanceUnsafe.definition, instanceUnsafe);
}
- public void putReplaceAll(cElementalInstanceStack... instances){
- for(cElementalInstanceStack instance:instances)
- this.tree.put(instance.definition,instance);
+ public void putReplaceAll(cElementalInstanceStack... instances) {
+ for (cElementalInstanceStack instance : instances)
+ this.tree.put(instance.definition, instance);
}
- private void putReplaceAll(Map<iElementalDefinition,cElementalInstanceStack> inTreeUnsafe){
+ private void putReplaceAll(Map<iElementalDefinition, cElementalInstanceStack> inTreeUnsafe) {
this.tree.putAll(inTreeUnsafe);
}
- public void putReplaceAll(cElementalInstanceStackTree inContainerUnsafe){
+ public void putReplaceAll(cElementalInstanceStackTree inContainerUnsafe) {
putReplaceAll(inContainerUnsafe.tree);
}
-//Put unify
- public cElementalInstanceStack putUnify(cElementalInstanceStack instance){
- return tree.put(instance.definition,instance.unifyIntoThis(tree.get(instance.definition)));
+ //Put unify
+ public cElementalInstanceStack putUnify(cElementalInstanceStack instance) {
+ return tree.put(instance.definition, instance.unifyIntoThis(tree.get(instance.definition)));
}
- public void putUnifyAll(cElementalInstanceStack... instances){
- for(cElementalInstanceStack instance:instances)
+ public void putUnifyAll(cElementalInstanceStack... instances) {
+ for (cElementalInstanceStack instance : instances)
putUnify(instance);
}
- private void putUnifyAll(Map<iElementalDefinition,cElementalInstanceStack> inTreeUnsafe){
- for (cElementalInstanceStack in:inTreeUnsafe.values())
+ private void putUnifyAll(Map<iElementalDefinition, cElementalInstanceStack> inTreeUnsafe) {
+ for (cElementalInstanceStack in : inTreeUnsafe.values())
putUnify(in);
}
- public void putUnifyAll(cElementalInstanceStackTree containerUnsafe){
+ public void putUnifyAll(cElementalInstanceStackTree containerUnsafe) {
putUnifyAll(containerUnsafe.tree);
}
-//Getters
- public cElementalInstanceStack getInstance(iElementalDefinition def){
+ //Getters
+ public cElementalInstanceStack getInstance(iElementalDefinition def) {
return tree.get(def);
}
public String[] getElementalInfo() {
- final String[] info=new String[tree.size()*3];
- int i=0;
- for(cElementalInstanceStack instance:tree.values()){
- info[i ]=EnumChatFormatting.BLUE + instance.definition.getName();
- info[i+1]=EnumChatFormatting.AQUA + instance.definition.getSymbol();
- info[i+2]="Amount "+EnumChatFormatting.GREEN + instance.amount;
- i+=3;
+ final String[] info = new String[tree.size() * 3];
+ int i = 0;
+ for (cElementalInstanceStack instance : tree.values()) {
+ info[i] = EnumChatFormatting.BLUE + instance.definition.getName();
+ info[i + 1] = EnumChatFormatting.AQUA + instance.definition.getSymbol();
+ info[i + 2] = "Amount " + EnumChatFormatting.GREEN + instance.amount;
+ i += 3;
}
return info;
}
- public cElementalInstanceStack[] values(){
+ public cElementalInstanceStack[] values() {
return tree.values().toArray(new cElementalInstanceStack[0]);
}
- public iElementalDefinition[] keys(){
+ public iElementalDefinition[] keys() {
return tree.keySet().toArray(new iElementalDefinition[0]);
}
- public float getMass(){
- float mass=0;
- for(cElementalInstanceStack stack:tree.values()){
- mass+=stack.getMass();
+ public float getMass() {
+ float mass = 0;
+ for (cElementalInstanceStack stack : tree.values()) {
+ mass += stack.getMass();
}
return mass;
}
-//Tests
- public boolean containsDefinition(iElementalDefinition def){
+
+ //Tests
+ public boolean containsDefinition(iElementalDefinition def) {
return tree.containsKey(def);
}
- public boolean containsInstance(cElementalInstanceStack inst){
+ public boolean containsInstance(cElementalInstanceStack inst) {
return tree.containsValue(inst);
}
- public int size(){
+ public int size() {
return tree.size();
}
- public boolean hasStacks(){
- return tree.size()>0;
+ public boolean hasStacks() {
+ return tree.size() > 0;
}
-//Tick Content
- public void tickContent(float lifeTimeMult, int postEnergize){
- for(cElementalInstanceStack instance:this.values()){
- cElementalInstanceStackTree newThings=instance.decay(lifeTimeMult,instance.age+=20,postEnergize);
- if(newThings==null){
+ //Tick Content
+ public void tickContent(float lifeTimeMult, int postEnergize) {
+ for (cElementalInstanceStack instance : this.values()) {
+ cElementalInstanceStackTree newThings = instance.decay(lifeTimeMult, instance.age += 20, postEnergize);
+ if (newThings == null) {
instance.nextColor();
- }else{
+ } else {
tree.remove(instance.definition);
- for(cElementalInstanceStack newInstance:newThings.values())
+ for (cElementalInstanceStack newInstance : newThings.values())
putUnify(newInstance);
}
}
}
- public void tickContent(int postEnergize){
- for(cElementalInstanceStack instance:this.values()){
- cElementalInstanceStackTree newThings=instance.decay(instance.age+=20,postEnergize);
- if(newThings==null){
+ public void tickContent(int postEnergize) {
+ for (cElementalInstanceStack instance : this.values()) {
+ cElementalInstanceStackTree newThings = instance.decay(instance.age += 20, postEnergize);
+ if (newThings == null) {
instance.nextColor();
- }else{
+ } else {
tree.remove(instance.definition);
- for(cElementalInstanceStack newInstance:newThings.values())
+ for (cElementalInstanceStack newInstance : newThings.values())
putUnify(newInstance);
}
}
}
-//NBT
- public NBTTagCompound getInfoNBT(){
- final NBTTagCompound nbt=new NBTTagCompound();
- final String[] info=getElementalInfo();
- nbt.setInteger("i",info.length);
- for(int i=0;i<info.length;i++)
- nbt.setString(Integer.toString(i),info[i]);
+ //NBT
+ public NBTTagCompound getInfoNBT() {
+ final NBTTagCompound nbt = new NBTTagCompound();
+ final String[] info = getElementalInfo();
+ nbt.setInteger("i", info.length);
+ for (int i = 0; i < info.length; i++)
+ nbt.setString(Integer.toString(i), info[i]);
return nbt;
}
- public static String[] infoFromNBT(NBTTagCompound nbt){
- final String[] strings=new String[nbt.getInteger("i")];
- for(int i=0;i<strings.length;i++)
- strings[i]=nbt.getString(Integer.toString(i));
+ public static String[] infoFromNBT(NBTTagCompound nbt) {
+ final String[] strings = new String[nbt.getInteger("i")];
+ for (int i = 0; i < strings.length; i++)
+ strings[i] = nbt.getString(Integer.toString(i));
return strings;
}
public NBTTagCompound toNBT() {
- final NBTTagCompound nbt=new NBTTagCompound();
- nbt.setInteger("i",tree.size());
- int i=0;
- for(cElementalInstanceStack instance: tree.values())
- nbt.setTag(Integer.toString(i++),instance.toNBT());
+ final NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setInteger("i", tree.size());
+ int i = 0;
+ for (cElementalInstanceStack instance : tree.values())
+ nbt.setTag(Integer.toString(i++), instance.toNBT());
return nbt;
}
- public static cElementalInstanceStackTree fromNBT(NBTTagCompound nbt) throws tElementalException{
- final cElementalInstanceStack[] instances=new cElementalInstanceStack[nbt.getInteger("i")];
- for(int i=0;i<instances.length;i++){
- instances[i]= cElementalInstanceStack.fromNBT(nbt.getCompoundTag(Integer.toString(i)));
- if(instances[i].definition.equals(debug__))
+ public static cElementalInstanceStackTree fromNBT(NBTTagCompound nbt) throws tElementalException {
+ final cElementalInstanceStack[] instances = new cElementalInstanceStack[nbt.getInteger("i")];
+ for (int i = 0; i < instances.length; i++) {
+ instances[i] = cElementalInstanceStack.fromNBT(nbt.getCompoundTag(Integer.toString(i)));
+ if (instances[i].definition.equals(debug__))
throw new tElementalException("Something went Wrong");
}
return new cElementalInstanceStackTree(false, instances);
}
-//stackUp
- public static cElementalInstanceStack[] stackUp(cElementalInstanceStack... in){
- final cElementalInstanceStackTree inTree=new cElementalInstanceStackTree();
+ //stackUp
+ public static cElementalInstanceStack[] stackUp(cElementalInstanceStack... in) {
+ final cElementalInstanceStackTree inTree = new cElementalInstanceStackTree();
inTree.putUnifyAll(in);
return inTree.values();
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java
index eb7375555b..f10108e9e9 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java
@@ -15,10 +15,12 @@ import java.util.TreeMap;
* EXTEND THIS TO ADD NEW PRIMITIVES, WATCH OUT FOR ID'S!!! (-1 to 32 can be assumed as used)
*/
public abstract class cElementalPrimitive extends cElementalDefinition {
- private static final byte nbtType=(byte) 'p';
+ public static final TreeMap<cElementalPrimitive, ItemStack> itemBinds = new TreeMap<>();
+ public static final TreeMap<cElementalPrimitive, FluidStack> fluidBinds = new TreeMap<>();
- public static final TreeMap<Integer, iElementalDefinition> bindsBO = new TreeMap<>();
+ private static final byte nbtType = (byte) 'p';
+ public static final TreeMap<Integer, iElementalDefinition> bindsBO = new TreeMap<>();
public final String name;
public final String symbol;
@@ -50,7 +52,8 @@ public abstract class cElementalPrimitive extends cElementalDefinition {
this.charge = (byte) charge;
this.color = (byte) color;
this.ID = ID;
- if(bindsBO.put(ID, this)!=null) Minecraft.getMinecraft().crashed(new CrashReport("Primitive definition",new tElementalException("Duplicate ID")));
+ if (bindsBO.put(ID, this) != null)
+ Minecraft.getMinecraft().crashed(new CrashReport("Primitive definition", new tElementalException("Duplicate ID")));
}
//
@@ -136,9 +139,9 @@ public abstract class cElementalPrimitive extends cElementalDefinition {
@Override
public final NBTTagCompound toNBT() {
- NBTTagCompound nbt=new NBTTagCompound();
- nbt.setByte("t",nbtType);
- nbt.setInteger("c",ID);
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setByte("t", nbtType);
+ nbt.setInteger("c", ID);
return nbt;
}
@@ -153,8 +156,8 @@ public abstract class cElementalPrimitive extends cElementalDefinition {
@Override
public final int compareTo(iElementalDefinition o) {
- if(getClassType()==o.getClassType()){
- int oID=((cElementalPrimitive)o).ID;
+ if (getClassType() == o.getClassType()) {
+ int oID = ((cElementalPrimitive) o).ID;
if (ID > oID) return 1;
if (ID < oID) return -1;
return 0;
@@ -166,7 +169,7 @@ public abstract class cElementalPrimitive extends cElementalDefinition {
try {
cElementalDefinition.addCreatorFromNBT(nbtType, cElementalPrimitive.class.getMethod("fromNBT", NBTTagCompound.class));
} catch (Exception e) {
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipe.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipe.java
index f7df77fb78..b7abbd86fd 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipe.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipe.java
@@ -11,21 +11,21 @@ public class rElementalRecipe implements Comparable<rElementalRecipe> {
public final cElementalDefinitionStackTree outEM;
public final ItemStack[] outItems;
public final FluidStack[] outFluids;
- public Object[] extension=null;
+ public Object[] extension = null;
public rElementalRecipe(
cElementalDefinitionStackTree inEMnotNull,
cElementalDefinitionStackTree outEM,
ItemStack[] outItems,
- FluidStack[] outFluids){
- this.inEM=inEMnotNull;
- this.outEM=outEM;
- this.outItems=outItems;
- this.outFluids=outFluids;
+ FluidStack[] outFluids) {
+ this.inEM = inEMnotNull;
+ this.outEM = outEM;
+ this.outItems = outItems;
+ this.outFluids = outFluids;
}
- public void extend(Object... data){
- extension=data;
+ public void extend(Object... data) {
+ extension = data;
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeTree.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeTree.java
index 154f390138..92d9c5e05f 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeTree.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeTree.java
@@ -6,54 +6,54 @@ import java.util.TreeMap;
* Created by Tec on 02.03.2017.
*/
public class rElementalRecipeTree {
- private TreeMap<cElementalDefinitionStackTree,rElementalRecipe> recipes=new TreeMap<>();
+ private TreeMap<cElementalDefinitionStackTree, rElementalRecipe> recipes = new TreeMap<>();
- public rElementalRecipeTree(rElementalRecipe... contents){
- for(rElementalRecipe recipe:contents)
- recipes.put(recipe.inEM,recipe);
+ public rElementalRecipeTree(rElementalRecipe... contents) {
+ for (rElementalRecipe recipe : contents)
+ recipes.put(recipe.inEM, recipe);
}
- public rElementalRecipe put(rElementalRecipe in){
- return recipes.put(in.inEM,in);
+ public rElementalRecipe put(rElementalRecipe in) {
+ return recipes.put(in.inEM, in);
}
- public void putAll(rElementalRecipe... contents){
- for(rElementalRecipe recipe:contents)
- recipes.put(recipe.inEM,recipe);
+ public void putAll(rElementalRecipe... contents) {
+ for (rElementalRecipe recipe : contents)
+ recipes.put(recipe.inEM, recipe);
}
- public rElementalRecipe findExact(cElementalDefinitionStackTree in){
+ public rElementalRecipe findExact(cElementalDefinitionStackTree in) {
return recipes.get(in);
}
- public rElementalRecipe findTopMatch(cElementalDefinitionStackTree in){
- for (cElementalDefinitionStackTree requirement:recipes.descendingKeySet()){
- if(in.removeAllAmounts(true,requirement))
+ public rElementalRecipe findTopMatch(cElementalDefinitionStackTree in) {
+ for (cElementalDefinitionStackTree requirement : recipes.descendingKeySet()) {
+ if (in.removeAllAmounts(true, requirement))
return recipes.get(requirement);
}
return null;
}
- public rElementalRecipe findTopMatch(cElementalInstanceStackTree in, boolean testOnly){
- for (cElementalDefinitionStackTree requirement:recipes.descendingKeySet()){
- if(in.removeAllAmounts(testOnly,requirement))
+ public rElementalRecipe findTopMatch(cElementalInstanceStackTree in, boolean testOnly) {
+ for (cElementalDefinitionStackTree requirement : recipes.descendingKeySet()) {
+ if (in.removeAllAmounts(testOnly, requirement))
return recipes.get(requirement);
}
return null;
}
- public rElementalRecipe findBottomMatch(cElementalDefinitionStackTree in){
- for (cElementalDefinitionStackTree requirement:recipes.keySet()){
- if(in.removeAllAmounts(true,requirement)){
+ public rElementalRecipe findBottomMatch(cElementalDefinitionStackTree in) {
+ for (cElementalDefinitionStackTree requirement : recipes.keySet()) {
+ if (in.removeAllAmounts(true, requirement)) {
return recipes.get(requirement);
}
}
return null;
}
- public rElementalRecipe findBottomMatch(cElementalInstanceStackTree in, boolean testOnly){
- for (cElementalDefinitionStackTree requirement:recipes.keySet()){
- if(in.removeAllAmounts(testOnly,requirement)){
+ public rElementalRecipe findBottomMatch(cElementalInstanceStackTree in, boolean testOnly) {
+ for (cElementalDefinitionStackTree requirement : recipes.keySet()) {
+ if (in.removeAllAmounts(testOnly, requirement)) {
return recipes.get(requirement);
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/commonValues.java b/src/main/java/com/github/technus/tectech/elementalMatter/commonValues.java
index 8f71e93c23..c18c543ee5 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/commonValues.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/commonValues.java
@@ -6,17 +6,17 @@ import net.minecraft.util.EnumChatFormatting;
* Created by danie_000 on 11.01.2017.
*/
public final class commonValues {
- public final static String tecMark =
- EnumChatFormatting.BLUE + "Tec" +
- EnumChatFormatting.DARK_BLUE + "Tech" +
- EnumChatFormatting.BLUE + ": Elemental Matter";
- public final static byte decayAt = 0;// hatches compute dacays
- public final static byte multiPurge1At = 2;// multiblocks clean their hatches 1
- public final static byte moveAt = 4;// move stuff around
- public final static byte recipeAt = 6;// move stuff around
- public final static byte multiPurge2At = 8;// multiblocks clean their hatches 2
- public final static byte overflowAt = 10;// then hatches clean themselves
- // - in case some hatches are not in multiblock structure
- public final static byte multiCheckAt = 12;// multiblock checks it's state
- public final static byte disperseAt = 14;// overflow hatches perform disperse
+ public final static String tecMark =
+ EnumChatFormatting.BLUE + "Tec" +
+ EnumChatFormatting.DARK_BLUE + "Tech" +
+ EnumChatFormatting.BLUE + ": Elemental Matter";
+ public final static byte decayAt = 0;// hatches compute dacays
+ public final static byte multiPurge1At = 2;// multiblocks clean their hatches 1
+ public final static byte moveAt = 4;// move stuff around
+ public final static byte recipeAt = 6;// move stuff around
+ public final static byte multiPurge2At = 8;// multiblocks clean their hatches 2
+ public final static byte overflowAt = 10;// then hatches clean themselves
+ // - in case some hatches are not in multiblock structure
+ public final static byte multiCheckAt = 12;// multiblock checks it's state
+ public final static byte disperseAt = 14;// overflow hatches perform disperse
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/cPrimitiveDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/cPrimitiveDefinition.java
index 5c05e6d54a..c64f987d0f 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/cPrimitiveDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/cPrimitiveDefinition.java
@@ -11,15 +11,15 @@ import static com.github.technus.tectech.elementalMatter.classes.cElementalDecay
* Created by danie_000 on 22.10.2016.
*/
public final class cPrimitiveDefinition extends cElementalPrimitive {
- public static final cPrimitiveDefinition debug__ = new cPrimitiveDefinition("Fallback of a bug","!",0,0f,0,Integer.MIN_VALUE,Integer.MIN_VALUE);
- public static final cPrimitiveDefinition null__ = new cPrimitiveDefinition("This is a bug",".", 0, 0F, 0, -3,Integer.MAX_VALUE);
- //Never create null__ particle - if u need fallback use debug__
- public static final cPrimitiveDefinition space__ = new cPrimitiveDefinition("Space", "_", 0, 0F, 0, -4,0);
- public static final cPrimitiveDefinition magic = new cPrimitiveDefinition("Magic", "Ma", 4, -1F, 0, 0,1);
- public static final cPrimitiveDefinition magic_ = new cPrimitiveDefinition("Antimagic", "~Ma", -4, -1F, 0, 0,2);
+ public static final cPrimitiveDefinition debug__ = new cPrimitiveDefinition("Fallback of a bug", "!", 0, 0f, 0, Integer.MIN_VALUE, Integer.MIN_VALUE);
+ public static final cPrimitiveDefinition null__ = new cPrimitiveDefinition("This is a bug", ".", 0, 0F, 0, -3, Integer.MAX_VALUE);
+ //Never create null__ particle - if u need fallback use debug__
+ public static final cPrimitiveDefinition space__ = new cPrimitiveDefinition("Space", "_", 0, 0F, 0, -4, 0);
+ public static final cPrimitiveDefinition magic = new cPrimitiveDefinition("Magic", "Ma", 4, -1F, 0, 0, 1);
+ public static final cPrimitiveDefinition magic_ = new cPrimitiveDefinition("Antimagic", "~Ma", -4, -1F, 0, 0, 2);
protected cPrimitiveDefinition(String name, String symbol, int type, float mass, int charge, int color, int ID) {
- super(name,symbol,type,mass,charge,color,ID);
+ super(name, symbol, type, mass, charge, color, ID);
}
public static iElementalDefinition fromNBT(NBTTagCompound content) {
@@ -27,8 +27,8 @@ public final class cPrimitiveDefinition extends cElementalPrimitive {
}
public static void run() {
- debug__.init(null__, -1F, -1, -1, noDecay);
- null__.init(null__, -1F, -1, -1, noProduct);
+ debug__.init(null__, -1F, -1, -1, noDecay);
+ null__.init(null__, -1F, -1, -1, noProduct);
space__.init(space__, -1F, -1, -1, noProduct);
magic.init(magic_, -1F, -1, -1, noDecay);
magic_.init(magic, -1F, -1, -1, noDecay);
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java
index 11c7c4589b..8187791c0c 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java
@@ -18,12 +18,15 @@ import static com.github.technus.tectech.elementalMatter.definitions.eBosonDefin
* Created by danie_000 on 18.11.2016.
*/
public final class dAtomDefinition extends cElementalDefinition {
- private static final byte nbtType=(byte)'a';
+ public static final TreeMap<dAtomDefinition, ItemStack> itemBinds = new TreeMap<>();
+ public static final TreeMap<dAtomDefinition, FluidStack> fluidBinds = new TreeMap<>();
+
+ private static final byte nbtType = (byte) 'a';
private static final Random xstr = new XSTR();//NEEDS SEPARATE!
- private static HashMap<Integer,TreeSet<Integer>> stableIsotopes=new HashMap<>();
- private static final TreeMap<Integer,dAtomDefinition> stableAtoms=new TreeMap<>();
- private static HashMap<Integer,TreeMap<Float,Integer>> mostStableUnstableIsotopes=new HashMap<>();
- private static final TreeMap<Integer,dAtomDefinition> unstableAtoms=new TreeMap<>();
+ private static HashMap<Integer, TreeSet<Integer>> stableIsotopes = new HashMap<>();
+ private static final TreeMap<Integer, dAtomDefinition> stableAtoms = new TreeMap<>();
+ private static HashMap<Integer, TreeMap<Float, Integer>> mostStableUnstableIsotopes = new HashMap<>();
+ private static final TreeMap<Integer, dAtomDefinition> unstableAtoms = new TreeMap<>();
private static cElementalDefinitionStack alfa;
//float-mass in eV/c^2
@@ -109,76 +112,80 @@ public final class dAtomDefinition extends cElementalDefinition {
element = Math.abs(element);
- xstr.setSeed((long) (element+1)*(isotope+100));
+ xstr.setSeed((long) (element + 1) * (isotope + 100));
//stability curve
int StableIsotope = stableIzoCurve(element);
- int izoDiff =isotope-StableIsotope;
+ int izoDiff = isotope - StableIsotope;
int izoDiffAbs = Math.abs(izoDiff);
- this.rawLifeTime= calculateLifeTime(izoDiff,izoDiffAbs,element,isotope,containsAnti);
- if(izoDiff==0)
- this.decayMode=0;
+ this.rawLifeTime = calculateLifeTime(izoDiff, izoDiffAbs, element, isotope, containsAnti);
+ if (izoDiff == 0)
+ this.decayMode = 0;
else
- this.decayMode=izoDiff>0?(byte)Math.min(2,1+izoDiffAbs/4):(byte)-Math.min(2,1+izoDiffAbs/4);
- this.stable=isStable(this.rawLifeTime);
+ this.decayMode = izoDiff > 0 ? (byte) Math.min(2, 1 + izoDiffAbs / 4) : (byte) -Math.min(2, 1 + izoDiffAbs / 4);
+ this.stable = isStable(this.rawLifeTime);
}
- private static boolean isStable(float lifeTime){
- return lifeTime>1.5e25f;
+ private static boolean isStable(float lifeTime) {
+ return lifeTime > 1.5e25f;
}
- private static int stableIzoCurve(int element){
+ private static int stableIzoCurve(int element) {
return (int) Math.round(-1.19561E-06 * Math.pow(element, 4D) +
1.60885E-04 * Math.pow(element, 3D) +
3.76604E-04 * Math.pow(element, 2D) +
1.08418E+00 * (double) element);
}
- private static float calculateLifeTime(int izoDiff, int izoDiffAbs, int element, int isotope, boolean containsAnti){
+ private static float calculateLifeTime(int izoDiff, int izoDiffAbs, int element, int isotope, boolean containsAnti) {
float rawLifeTime;
- if (element<=83 && isotope<127 && (izoDiffAbs == 0 ||
+ if (element <= 83 && isotope < 127 && (izoDiffAbs == 0 ||
(element == 1 && isotope == 0) ||
(element == 2 && isotope == 1) ||
(izoDiffAbs == 1 && element > 2 && element % 2 == 1) ||
(izoDiffAbs == 3 && element > 30 && element % 2 == 0) ||
(izoDiffAbs == 5 && element > 30 && element % 2 == 0) ||
(izoDiffAbs == 2 && element > 20 && element % 2 == 1))) {
- rawLifeTime = containsAnti ? 2.381e4f*(1f+xstr.nextFloat()*9f) : (1f+xstr.nextFloat()*9f) * 1.5347e25F;
+ rawLifeTime = containsAnti ? 2.381e4f * (1f + xstr.nextFloat() * 9f) : (1f + xstr.nextFloat() * 9f) * 1.5347e25F;
} else {
//Y = (X-A)/(B-A) * (D-C) + C
- float unstabilityEXP=0;
- if(element==0){
+ float unstabilityEXP = 0;
+ if (element == 0) {
return 1e-35f;
- }else if(element==1){
- unstabilityEXP=1.743f-(Math.abs(izoDiff-1)*9.743f);
- }else if(element==2){
- switch(isotope){
+ } else if (element == 1) {
+ unstabilityEXP = 1.743f - (Math.abs(izoDiff - 1) * 9.743f);
+ } else if (element == 2) {
+ switch (isotope) {
case 4:
- unstabilityEXP=1.61f;break;
+ unstabilityEXP = 1.61f;
+ break;
case 5:
- unstabilityEXP=-7.523F;break;
+ unstabilityEXP = -7.523F;
+ break;
case 6:
- unstabilityEXP=-1.51f;break;
+ unstabilityEXP = -1.51f;
+ break;
default:
- unstabilityEXP=-(izoDiffAbs*6.165F);break;
+ unstabilityEXP = -(izoDiffAbs * 6.165F);
+ break;
}
- }else if(element<=83 || (isotope<=127 && element<=120)){
- float elementPow4=(float)Math.pow(element,4f);
-
- unstabilityEXP=Math.min(element/2.4f,6+((element+1)%2)*3e6F/elementPow4)+(((float)-izoDiff*elementPow4)/1e8F)-(Math.abs(izoDiff-1+element/60F)*(3f-(element/12.5f)+((element*element)/1500f)));
- }else if(element<180){
- unstabilityEXP=Math.min((element-85)*2,16+((isotope+1)%2)*2.5F-(element-85)/3F)-(Math.abs(izoDiff)*(3f-(element/13f)+((element*element)/1600f)));
- }else return -1;
- if((isotope==127 || isotope==128) && (element<120 && element>83)) unstabilityEXP-=1.8f;
- if(element>83 && element<93 && isotope%2==0 && izoDiff==3) unstabilityEXP+=6;
- if(element>93 && element<103 && isotope%2==0 && izoDiff==4) unstabilityEXP+=6;
- rawLifeTime = (containsAnti ? 1e-8f : 1f)*(float)(Math.pow(10F,unstabilityEXP))*(1f+xstr.nextFloat()*9f);
+ } else if (element <= 83 || (isotope <= 127 && element <= 120)) {
+ float elementPow4 = (float) Math.pow(element, 4f);
+
+ unstabilityEXP = Math.min(element / 2.4f, 6 + ((element + 1) % 2) * 3e6F / elementPow4) + (((float) -izoDiff * elementPow4) / 1e8F) - (Math.abs(izoDiff - 1 + element / 60F) * (3f - (element / 12.5f) + ((element * element) / 1500f)));
+ } else if (element < 180) {
+ unstabilityEXP = Math.min((element - 85) * 2, 16 + ((isotope + 1) % 2) * 2.5F - (element - 85) / 3F) - (Math.abs(izoDiff) * (3f - (element / 13f) + ((element * element) / 1600f)));
+ } else return -1;
+ if ((isotope == 127 || isotope == 128) && (element < 120 && element > 83)) unstabilityEXP -= 1.8f;
+ if (element > 83 && element < 93 && isotope % 2 == 0 && izoDiff == 3) unstabilityEXP += 6;
+ if (element > 93 && element < 103 && isotope % 2 == 0 && izoDiff == 4) unstabilityEXP += 6;
+ rawLifeTime = (containsAnti ? 1e-8f : 1f) * (float) (Math.pow(10F, unstabilityEXP)) * (1f + xstr.nextFloat() * 9f);
}
- if(rawLifeTime<8e-15)return 1e-35f;
- if(rawLifeTime>8e28)return 8e30f;
+ if (rawLifeTime < 8e-15) return 1e-35f;
+ if (rawLifeTime > 8e28) return 8e30f;
return rawLifeTime;
}
@@ -235,31 +242,31 @@ public final class dAtomDefinition extends cElementalDefinition {
@Override
public String getName() {
- final int element=Math.abs(this.element);
- final boolean negative=element<0;
- try{
- if(type!=1) return (negative?"~? ":"? ") +nomenclature.Name[element];
- return negative?"~"+ nomenclature.Name[element]:nomenclature.Name[element];
- }catch(Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
- return (negative?"Element: ~":"Element: ") + element;
+ final int element = Math.abs(this.element);
+ final boolean negative = element < 0;
+ try {
+ if (type != 1) return (negative ? "~? " : "? ") + nomenclature.Name[element];
+ return negative ? "~" + nomenclature.Name[element] : nomenclature.Name[element];
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
+ return (negative ? "Element: ~" : "Element: ") + element;
}
}
@Override
public String getSymbol() {
- final int element=Math.abs(this.element);
- final boolean negative=element<0;
- try{
- return (negative?"~":"") + nomenclature.Symbol[element]+" N:"+isotope+" I:"+getIonization();
- }catch(Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ final int element = Math.abs(this.element);
+ final boolean negative = element < 0;
+ try {
+ return (negative ? "~" : "") + nomenclature.Symbol[element] + " N:" + isotope + " I:" + getIonization();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
try {
- int s100 = element / 100, s1 = (element/10) % 10, s10 = (element) % 10;
- return (negative?"~":"") + nomenclature.SymbolIUPAC[10+s100]+nomenclature.SymbolIUPAC[s10]+nomenclature.SymbolIUPAC[s1]+ " N:" + isotope + " I:" + getIonization();
- }catch (Exception E){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
- return (negative?"~":"") + "? N:" + isotope + " I:" + getIonization();
+ int s100 = element / 100, s1 = (element / 10) % 10, s10 = (element) % 10;
+ return (negative ? "~" : "") + nomenclature.SymbolIUPAC[10 + s100] + nomenclature.SymbolIUPAC[s10] + nomenclature.SymbolIUPAC[s1] + " N:" + isotope + " I:" + getIonization();
+ } catch (Exception E) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
+ return (negative ? "~" : "") + "? N:" + isotope + " I:" + getIonization();
}
}
}
@@ -271,81 +278,87 @@ public final class dAtomDefinition extends cElementalDefinition {
@Override
public cElementalDecay[] getDecayArray() {
- if(this.type==1){
- switch(decayMode){
- case -2: return PbetaDecay();
- case -1: return Emmision(dHadronDefinition.hadron_p1);
- case 0: return alphaDecay();
- case 1: return Emmision(dHadronDefinition.hadron_n1);
- case 2: return MbetaDecay();
- default: return getNaturalDecayInstant();
+ if (this.type == 1) {
+ switch (decayMode) {
+ case -2:
+ return PbetaDecay();
+ case -1:
+ return Emmision(dHadronDefinition.hadron_p1);
+ case 0:
+ return alphaDecay();
+ case 1:
+ return Emmision(dHadronDefinition.hadron_n1);
+ case 2:
+ return MbetaDecay();
+ default:
+ return getNaturalDecayInstant();
}
- }else{
+ } else {
return getNaturalDecayInstant();
}
}
- private cElementalDecay[] Emmision(cElementalDefinitionStack emit){
- final cElementalDefinitionStackTree tree=new cElementalDefinitionStackTree(elementalStacks.values());
- if(tree.removeAmount(false,emit)){
+ private cElementalDecay[] Emmision(cElementalDefinitionStack emit) {
+ final cElementalDefinitionStackTree tree = new cElementalDefinitionStackTree(elementalStacks.values());
+ if (tree.removeAmount(false, emit)) {
try {
return new cElementalDecay[]{
new cElementalDecay(0.5f, this),
- new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree),1),emit),
+ new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree), 1), emit),
deadEnd
};
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
return getNaturalDecayInstant();
}
- private cElementalDecay[] alphaDecay(){
- final cElementalDefinitionStackTree tree=new cElementalDefinitionStackTree(elementalStacks.values());
- if(tree.removeAllAmounts(false,dHadronDefinition.hadron_n2,dHadronDefinition.hadron_p2)){
+ private cElementalDecay[] alphaDecay() {
+ final cElementalDefinitionStackTree tree = new cElementalDefinitionStackTree(elementalStacks.values());
+ if (tree.removeAllAmounts(false, dHadronDefinition.hadron_n2, dHadronDefinition.hadron_p2)) {
try {
return new cElementalDecay[]{
new cElementalDecay(0.5f, this),
- new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree),1),alfa),
+ new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree), 1), alfa),
deadEnd
};
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
return getNaturalDecayInstant();
}
- private cElementalDecay[] MbetaDecay(){
- final cElementalDefinitionStackTree tree=new cElementalDefinitionStackTree(elementalStacks.values());
- if(tree.removeAmount(false,dHadronDefinition.hadron_n1)){
+ private cElementalDecay[] MbetaDecay() {
+ final cElementalDefinitionStackTree tree = new cElementalDefinitionStackTree(elementalStacks.values());
+ if (tree.removeAmount(false, dHadronDefinition.hadron_n1)) {
try {
tree.putUnify(dHadronDefinition.hadron_p1);
return new cElementalDecay[]{
new cElementalDecay(0.5f, this),
- new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree),1),eLeptonDefinition.lepton_e1,eNeutrinoDefinition.lepton_Ve_1),
+ new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree), 1), eLeptonDefinition.lepton_e1, eNeutrinoDefinition.lepton_Ve_1),
deadEnd
};
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
return getNaturalDecayInstant();
}
- private cElementalDecay[] PbetaDecay(){
- final cElementalDefinitionStackTree tree=new cElementalDefinitionStackTree(elementalStacks.values());
- if(tree.removeAmount(false,dHadronDefinition.hadron_p1)){
+ private cElementalDecay[] PbetaDecay() {
+ final cElementalDefinitionStackTree tree = new cElementalDefinitionStackTree(elementalStacks.values());
+ if (tree.removeAmount(false, dHadronDefinition.hadron_p1)) {
try {
tree.putUnify(dHadronDefinition.hadron_n1);
return new cElementalDecay[]{
new cElementalDecay(0.5f, this),
- new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree),1),eLeptonDefinition.lepton_e_1,eNeutrinoDefinition.lepton_Ve1),
+ new cElementalDecay(0.5f, new cElementalDefinitionStack(new dAtomDefinition(tree), 1), eLeptonDefinition.lepton_e_1, eNeutrinoDefinition.lepton_Ve1),
deadEnd
};
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
return getNaturalDecayInstant();
@@ -354,25 +367,25 @@ public final class dAtomDefinition extends cElementalDefinition {
@Override
public cElementalDecay[] getEnergeticDecayInstant() {
//strip leptons
- boolean doIt=true;
+ boolean doIt = true;
ArrayList<cElementalDefinitionStack> decaysInto = new ArrayList<cElementalDefinitionStack>();
ArrayList<cElementalDefinitionStack> newAtom = new ArrayList<cElementalDefinitionStack>();
for (cElementalDefinitionStack elementalStack : elementalStacks.values()) {
- if(elementalStack.definition instanceof eLeptonDefinition && doIt){
- doIt=false;
- if(elementalStack.amount>1)
- newAtom.add(new cElementalDefinitionStack(elementalStack.definition,elementalStack.amount-1));
- decaysInto.add(new cElementalDefinitionStack(elementalStack.definition,1));
- }else{
+ if (elementalStack.definition instanceof eLeptonDefinition && doIt) {
+ doIt = false;
+ if (elementalStack.amount > 1)
+ newAtom.add(new cElementalDefinitionStack(elementalStack.definition, elementalStack.amount - 1));
+ decaysInto.add(new cElementalDefinitionStack(elementalStack.definition, 1));
+ } else {
newAtom.add(elementalStack);
}
}
try {
- decaysInto.add(new cElementalDefinitionStack(new dAtomDefinition(newAtom.toArray(new cElementalDefinitionStack[newAtom.size()])),1));
+ decaysInto.add(new cElementalDefinitionStack(new dAtomDefinition(newAtom.toArray(new cElementalDefinitionStack[newAtom.size()])), 1));
return new cElementalDecay[]{new cElementalDecay(0.95F, decaysInto.toArray(new cElementalDefinitionStack[decaysInto.size()])), eBosonDefinition.deadEnd};
- }catch(tElementalException e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
- for(cElementalDefinitionStack things:newAtom){
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
+ for (cElementalDefinitionStack things : newAtom) {
decaysInto.add(things);
}
return new cElementalDecay[]{new cElementalDecay(0.75F, decaysInto.toArray(new cElementalDefinitionStack[decaysInto.size()])), eBosonDefinition.deadEnd};
@@ -397,7 +410,7 @@ public final class dAtomDefinition extends cElementalDefinition {
@Override
public iElementalDefinition getAnti() {
- cElementalDefinitionStack[] elementalStacks=this.elementalStacks.values();
+ cElementalDefinitionStack[] elementalStacks = this.elementalStacks.values();
cElementalDefinitionStack[] antiElements = new cElementalDefinitionStack[elementalStacks.length];
for (int i = 0; i < antiElements.length; i++) {
antiElements[i] = new cElementalDefinitionStack(elementalStacks[i].definition.getAnti(), elementalStacks[i].amount);
@@ -405,7 +418,7 @@ public final class dAtomDefinition extends cElementalDefinition {
try {
return new dAtomDefinition(false, antiElements);
} catch (tElementalException e) {
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
return null;
}
}
@@ -422,103 +435,103 @@ public final class dAtomDefinition extends cElementalDefinition {
return null;
}
- private final static class nomenclature{
+ private final static class nomenclature {
static final private String[] Symbol = new String[]{"Nt", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Cn", "Nh", "Fl", "Mc", "Lv", "Ts", "Og"};
static final private String[] Name = new String[]{"Neutronium", "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium", "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Nihonium", "Flerovium", "Moscovium", "Livermorium", "Tennessine", "Oganesson"};
- static final private String[] SymbolIUPAC = new String[]{"n","u","b","t","q","p","h","s","o","e","N","U","B","T","Q","P","H","S","O","E"};
+ static final private String[] SymbolIUPAC = new String[]{"n", "u", "b", "t", "q", "p", "h", "s", "o", "e", "N", "U", "B", "T", "Q", "P", "H", "S", "O", "E"};
}
@Override
public NBTTagCompound toNBT() {
- NBTTagCompound nbt=new NBTTagCompound();
- nbt.setByte("t",nbtType);
- cElementalDefinitionStack[] elementalStacksValues=elementalStacks.values();
- nbt.setInteger("i",elementalStacksValues.length);
- for (int i=0;i<elementalStacksValues.length;i++)
- nbt.setTag(Integer.toString(i),elementalStacksValues[i].toNBT());
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setByte("t", nbtType);
+ cElementalDefinitionStack[] elementalStacksValues = elementalStacks.values();
+ nbt.setInteger("i", elementalStacksValues.length);
+ for (int i = 0; i < elementalStacksValues.length; i++)
+ nbt.setTag(Integer.toString(i), elementalStacksValues[i].toNBT());
return nbt;
}
- public static iElementalDefinition fromNBT(NBTTagCompound nbt){
- cElementalDefinitionStack[] stacks=new cElementalDefinitionStack[nbt.getInteger("i")];
- for(int i=0;i<stacks.length;i++)
- stacks[i]=cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i)));
+ public static iElementalDefinition fromNBT(NBTTagCompound nbt) {
+ cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[nbt.getInteger("i")];
+ for (int i = 0; i < stacks.length; i++)
+ stacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i)));
try {
return new dAtomDefinition(stacks);
- }catch (tElementalException e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
return null;
}
}
- public static void run(){
+ public static void run() {
try {
cElementalDefinition.addCreatorFromNBT(nbtType, dAtomDefinition.class.getMethod("fromNBT", NBTTagCompound.class));
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
//populate stable isotopes
el:
- for(int element=1;element<84;element++)//Up to Astatine exclusive
- for(int isotope=0;isotope<130;isotope++){
- xstr.setSeed((long) (element+1)*(isotope+100));
+ for (int element = 1; element < 84; element++)//Up to Astatine exclusive
+ for (int isotope = 0; isotope < 130; isotope++) {
+ xstr.setSeed((long) (element + 1) * (isotope + 100));
//stability curve
final int StableIsotope = stableIzoCurve(element);
- final int izoDiff =isotope-StableIsotope;
+ final int izoDiff = isotope - StableIsotope;
final int izoDiffAbs = Math.abs(izoDiff);
- final float rawLifeTime= calculateLifeTime(izoDiff,izoDiffAbs,element,isotope,false);
- if(isStable(rawLifeTime)){
- TreeSet<Integer> isotopes=stableIsotopes.get(element);
- if(isotopes==null) stableIsotopes.put(element,isotopes=new TreeSet<>());
+ final float rawLifeTime = calculateLifeTime(izoDiff, izoDiffAbs, element, isotope, false);
+ if (isStable(rawLifeTime)) {
+ TreeSet<Integer> isotopes = stableIsotopes.get(element);
+ if (isotopes == null) stableIsotopes.put(element, isotopes = new TreeSet<>());
isotopes.add(isotope);
}
}
- for(int element=84;element<150;element++)
- for(int isotope=100;isotope<180;isotope++){
- xstr.setSeed((long) (element+1)*(isotope+100));
+ for (int element = 84; element < 150; element++)
+ for (int isotope = 100; isotope < 180; isotope++) {
+ xstr.setSeed((long) (element + 1) * (isotope + 100));
//stability curve
final int Isotope = stableIzoCurve(element);
- final int izoDiff =isotope-Isotope;
+ final int izoDiff = isotope - Isotope;
final int izoDiffAbs = Math.abs(izoDiff);
- final float rawLifeTime= calculateLifeTime(izoDiff,izoDiffAbs,element,isotope,false);
- TreeMap<Float,Integer> isotopes=mostStableUnstableIsotopes.get(element);
- if(isotopes==null) mostStableUnstableIsotopes.put(element,isotopes=new TreeMap<>());
- isotopes.put(rawLifeTime,isotope);
+ final float rawLifeTime = calculateLifeTime(izoDiff, izoDiffAbs, element, isotope, false);
+ TreeMap<Float, Integer> isotopes = mostStableUnstableIsotopes.get(element);
+ if (isotopes == null) mostStableUnstableIsotopes.put(element, isotopes = new TreeMap<>());
+ isotopes.put(rawLifeTime, isotope);
}
try {
- for(int key:stableIsotopes.keySet()){
- stableAtoms.put(key,new dAtomDefinition(
- new cElementalDefinitionStack(dHadronDefinition.hadron_p,key),
- new cElementalDefinitionStack(dHadronDefinition.hadron_n,stableIsotopes.get(key).first()),
- new cElementalDefinitionStack(eLeptonDefinition.lepton_e,key)));
- if(TecTech.ModConfig.DEBUG_MODE)
- TecTech.Logger.info("Added Stable Atom:"+key+" "+stableIsotopes.get(key).first()+" "+stableAtoms.get(key).getMass());
+ for (int key : stableIsotopes.keySet()) {
+ stableAtoms.put(key, new dAtomDefinition(
+ new cElementalDefinitionStack(dHadronDefinition.hadron_p, key),
+ new cElementalDefinitionStack(dHadronDefinition.hadron_n, stableIsotopes.get(key).first()),
+ new cElementalDefinitionStack(eLeptonDefinition.lepton_e, key)));
+ if (TecTech.ModConfig.DEBUG_MODE)
+ TecTech.Logger.info("Added Stable Atom:" + key + " " + stableIsotopes.get(key).first() + " " + stableAtoms.get(key).getMass());
}
- for(int key:mostStableUnstableIsotopes.keySet()){
- unstableAtoms.put(key,new dAtomDefinition(
- new cElementalDefinitionStack(dHadronDefinition.hadron_p,key),
- new cElementalDefinitionStack(dHadronDefinition.hadron_n,mostStableUnstableIsotopes.get(key).lastEntry().getValue()),
- new cElementalDefinitionStack(eLeptonDefinition.lepton_e,key)));
- if(TecTech.ModConfig.DEBUG_MODE)
- TecTech.Logger.info("Added Unstable Atom:"+key+" "+mostStableUnstableIsotopes.get(key).lastEntry().getValue()+" "+unstableAtoms.get(key).getMass());
+ for (int key : mostStableUnstableIsotopes.keySet()) {
+ unstableAtoms.put(key, new dAtomDefinition(
+ new cElementalDefinitionStack(dHadronDefinition.hadron_p, key),
+ new cElementalDefinitionStack(dHadronDefinition.hadron_n, mostStableUnstableIsotopes.get(key).lastEntry().getValue()),
+ new cElementalDefinitionStack(eLeptonDefinition.lepton_e, key)));
+ if (TecTech.ModConfig.DEBUG_MODE)
+ TecTech.Logger.info("Added Unstable Atom:" + key + " " + mostStableUnstableIsotopes.get(key).lastEntry().getValue() + " " + unstableAtoms.get(key).getMass());
}
alfa = new cElementalDefinitionStack(
new dAtomDefinition(
new cElementalDefinitionStack(dHadronDefinition.hadron_p, 2),
new cElementalDefinitionStack(dHadronDefinition.hadron_n, 2))
- ,1);
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ , 1);
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
- public static dAtomDefinition getFirstStableIsotope(int element){
+ public static dAtomDefinition getFirstStableIsotope(int element) {
return stableAtoms.get(element);
}
- public static dAtomDefinition getBestUnstableIsotope(int element){
+ public static dAtomDefinition getBestUnstableIsotope(int element) {
return unstableAtoms.get(element);
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java
index f0a021d80d..e20ef0e0d9 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java
@@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
+import java.util.TreeMap;
import static com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStackTree.stackUpTree;
import static com.github.technus.tectech.elementalMatter.definitions.eBosonDefinition.boson_Y__;
@@ -16,10 +17,13 @@ import static com.github.technus.tectech.elementalMatter.definitions.eBosonDefin
* Created by danie_000 on 17.11.2016.
*/
public final class dHadronDefinition extends cElementalDefinition {
- private static final byte nbtType=(byte)'h';
+ public static final TreeMap<dHadronDefinition, ItemStack> itemBinds = new TreeMap<>();
+ public static final TreeMap<dHadronDefinition, FluidStack> fluidBinds = new TreeMap<>();
+
+ private static final byte nbtType = (byte) 'h';
//Helpers
public static dHadronDefinition hadron_p, hadron_n, hadron_p_, hadron_n_;
- public static cElementalDefinitionStack hadron_p1, hadron_n1,hadron_p2, hadron_n2;
+ public static cElementalDefinitionStack hadron_p1, hadron_n1, hadron_p2, hadron_n2;
private static float protonMass = 0F;
private static float neutronMass = 0F;
//float-mass in eV/c^2
@@ -48,7 +52,7 @@ public final class dHadronDefinition extends cElementalDefinition {
this(true, stackUpTree(quarks));
}
- private dHadronDefinition(boolean check,cElementalDefinitionStack... quarks) throws tElementalException {
+ private dHadronDefinition(boolean check, cElementalDefinitionStack... quarks) throws tElementalException {
this(check, stackUpTree(quarks));
}
@@ -130,7 +134,7 @@ public final class dHadronDefinition extends cElementalDefinition {
name = "Hadron:";
}
for (cElementalDefinitionStack quark : quarkStacks.values()) {
- name += " " + quark.definition.getSymbol()+quark.amount;
+ name += " " + quark.definition.getSymbol() + quark.amount;
}
return name;
}
@@ -174,7 +178,7 @@ public final class dHadronDefinition extends cElementalDefinition {
@Override
public cElementalDecay[] getEnergeticDecayInstant() {
- cElementalDefinitionStack[] quarkStacks=this.quarkStacks.values();
+ cElementalDefinitionStack[] quarkStacks = this.quarkStacks.values();
if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType())
return new cElementalDecay[]{eBosonDefinition.deadEnd};
return new cElementalDecay[]{new cElementalDecay(0.75F, quarkStacks), eBosonDefinition.deadEnd}; //decay into quarks
@@ -182,7 +186,7 @@ public final class dHadronDefinition extends cElementalDefinition {
@Override
public cElementalDecay[] getDecayArray() {
- cElementalDefinitionStack[] quarkStacks=this.quarkStacks.values();
+ cElementalDefinitionStack[] quarkStacks = this.quarkStacks.values();
if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType())
return new cElementalDecay[]{eBosonDefinition.deadEnd};
else if (amount != 3)
@@ -217,7 +221,7 @@ public final class dHadronDefinition extends cElementalDefinition {
new cElementalDecay(0.001F, new dHadronDefinition(false, contentOfBaryon), Particles[0], Particles[1], boson_Y__),
eBosonDefinition.deadEnd}; //decay into quarks
} catch (tElementalException e) {
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
return new cElementalDecay[]{eBosonDefinition.deadEnd};
}
}
@@ -245,13 +249,13 @@ public final class dHadronDefinition extends cElementalDefinition {
@Override
public iElementalDefinition getAnti() {
- cElementalDefinitionStackTree anti=new cElementalDefinitionStackTree();
- for(cElementalDefinitionStack stack:quarkStacks.values())
- anti.putReplace(new cElementalDefinitionStack(stack.definition.getAnti(),stack.amount));
+ cElementalDefinitionStackTree anti = new cElementalDefinitionStackTree();
+ for (cElementalDefinitionStack stack : quarkStacks.values())
+ anti.putReplace(new cElementalDefinitionStack(stack.definition.getAnti(), stack.amount));
try {
return new dHadronDefinition(anti);
- }catch (tElementalException e) {
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
return null;
}
}
@@ -268,23 +272,23 @@ public final class dHadronDefinition extends cElementalDefinition {
@Override
public NBTTagCompound toNBT() {
- NBTTagCompound nbt=new NBTTagCompound();
- nbt.setByte("t",nbtType);
- cElementalDefinitionStack[] quarkStacksValues=quarkStacks.values();
- nbt.setInteger("i",quarkStacksValues.length);
- for (int i=0;i<quarkStacksValues.length;i++)
- nbt.setTag(Integer.toString(i),quarkStacksValues[i].toNBT());
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setByte("t", nbtType);
+ cElementalDefinitionStack[] quarkStacksValues = quarkStacks.values();
+ nbt.setInteger("i", quarkStacksValues.length);
+ for (int i = 0; i < quarkStacksValues.length; i++)
+ nbt.setTag(Integer.toString(i), quarkStacksValues[i].toNBT());
return nbt;
}
- public static iElementalDefinition fromNBT(NBTTagCompound nbt){
- cElementalDefinitionStack[] stacks=new cElementalDefinitionStack[nbt.getInteger("i")];
- for(int i=0;i<stacks.length;i++)
- stacks[i]=cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i)));
+ public static iElementalDefinition fromNBT(NBTTagCompound nbt) {
+ cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[nbt.getInteger("i")];
+ for (int i = 0; i < stacks.length; i++)
+ stacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i)));
try {
return new dHadronDefinition(stacks);
- }catch (tElementalException e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
return null;
}
}
@@ -302,18 +306,18 @@ public final class dHadronDefinition extends cElementalDefinition {
hadron_n = new dHadronDefinition(false, eQuarkDefinition.quark_u, eQuarkDefinition.quark_d, eQuarkDefinition.quark_d);
hadron_n_ = (dHadronDefinition) (hadron_n.getAnti());
} catch (tElementalException e) {
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
protonMass = -1;
neutronMass = -1;
}
- hadron_p1=new cElementalDefinitionStack(hadron_p,1);
- hadron_n1=new cElementalDefinitionStack(hadron_n,1);
- hadron_p2=new cElementalDefinitionStack(hadron_p,2);
- hadron_n2=new cElementalDefinitionStack(hadron_n,2);
+ hadron_p1 = new cElementalDefinitionStack(hadron_p, 1);
+ hadron_n1 = new cElementalDefinitionStack(hadron_n, 1);
+ hadron_p2 = new cElementalDefinitionStack(hadron_p, 2);
+ hadron_n2 = new cElementalDefinitionStack(hadron_n, 2);
try {
cElementalDefinition.addCreatorFromNBT(nbtType, dHadronDefinition.class.getMethod("fromNBT", NBTTagCompound.class));
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eBosonDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eBosonDefinition.java
index 21f1ff9a20..a8778a09be 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eBosonDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eBosonDefinition.java
@@ -8,14 +8,14 @@ import com.github.technus.tectech.elementalMatter.classes.cElementalPrimitive;
* Created by danie_000 on 22.10.2016.
*/
public final class eBosonDefinition extends cElementalPrimitive {
- public static final eBosonDefinition boson_Y__ = new eBosonDefinition("Photon", "\u03b3", 0, 1e-18F, 0, -1,27);
- public static final eBosonDefinition boson_H__ = new eBosonDefinition("Higgs", "\u0397", 0, 126.09e9F, 0, -2,28);
+ public static final eBosonDefinition boson_Y__ = new eBosonDefinition("Photon", "\u03b3", 0, 1e-18F, 0, -1, 27);
+ public static final eBosonDefinition boson_H__ = new eBosonDefinition("Higgs", "\u0397", 0, 126.09e9F, 0, -2, 28);
//deadEnd
- public static final cElementalDecay deadEnd = new cElementalDecay(boson_Y__,boson_Y__);
+ public static final cElementalDecay deadEnd = new cElementalDecay(boson_Y__, boson_Y__);
public static final cElementalDecay deadEndHalf = new cElementalDecay(boson_Y__);
- private eBosonDefinition(String name, String symbol,int type, float mass, int charge, int color, int ID) {
- super(name, symbol,type, mass, charge, color,ID);
+ private eBosonDefinition(String name, String symbol, int type, float mass, int charge, int color, int ID) {
+ super(name, symbol, type, mass, charge, color, ID);
}
public static void run() {
@@ -23,7 +23,7 @@ public final class eBosonDefinition extends cElementalPrimitive {
new cElementalDecay(boson_Y__),
deadEnd);
boson_H__.init(null, 1.56e-22F, 0, 0,
- new cElementalDecay(0.96F, new cElementalDefinitionStack(boson_Y__,4)),
+ new cElementalDecay(0.96F, new cElementalDefinitionStack(boson_Y__, 4)),
new cElementalDecay(0.02F, eLeptonDefinition.lepton_t, eLeptonDefinition.lepton_t_),
new cElementalDecay(0.01F, eQuarkDefinition.quark_b, eQuarkDefinition.quark_b_),
deadEnd);
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eLeptonDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eLeptonDefinition.java
index 176f0e1950..42c82b5232 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eLeptonDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eLeptonDefinition.java
@@ -10,18 +10,18 @@ import static com.github.technus.tectech.elementalMatter.definitions.eNeutrinoDe
* Created by danie_000 on 22.10.2016.
*/
public final class eLeptonDefinition extends cElementalPrimitive {
- public static final eLeptonDefinition lepton_e = new eLeptonDefinition("Electron", "\u03b2-",1, 0.511e6F, -3, -1,15);
- public static final eLeptonDefinition lepton_m = new eLeptonDefinition("Muon", "\u03bc-",2, 105.658e6F, -3, -1,17);
- public static final eLeptonDefinition lepton_t = new eLeptonDefinition("Tauon", "\u03c4-",3, 1776.83e6F, -3, -1,19);
- public static final eLeptonDefinition lepton_e_ = new eLeptonDefinition("Positron", "\u03b2+",-1, 0.511e6F, 3, -1,16);
- public static final eLeptonDefinition lepton_m_ = new eLeptonDefinition("Antimuon", "\u03bc+",-2,105.658e6F, 3, -1,18);
- public static final eLeptonDefinition lepton_t_ = new eLeptonDefinition("Antitauon", "\u03c4+",-3, 1776.83e6F, 3, -1,20);
- public static final cElementalDefinitionStack lepton_e1=new cElementalDefinitionStack(lepton_e,1);
- public static final cElementalDefinitionStack lepton_e_1=new cElementalDefinitionStack(lepton_e_,1);
-
-
- private eLeptonDefinition(String name, String symbol,int type, float mass, int charge, int color,int ID) {
- super(name, symbol,type, mass, charge, color,ID);
+ public static final eLeptonDefinition lepton_e = new eLeptonDefinition("Electron", "\u03b2-", 1, 0.511e6F, -3, -1, 15);
+ public static final eLeptonDefinition lepton_m = new eLeptonDefinition("Muon", "\u03bc-", 2, 105.658e6F, -3, -1, 17);
+ public static final eLeptonDefinition lepton_t = new eLeptonDefinition("Tauon", "\u03c4-", 3, 1776.83e6F, -3, -1, 19);
+ public static final eLeptonDefinition lepton_e_ = new eLeptonDefinition("Positron", "\u03b2+", -1, 0.511e6F, 3, -1, 16);
+ public static final eLeptonDefinition lepton_m_ = new eLeptonDefinition("Antimuon", "\u03bc+", -2, 105.658e6F, 3, -1, 18);
+ public static final eLeptonDefinition lepton_t_ = new eLeptonDefinition("Antitauon", "\u03c4+", -3, 1776.83e6F, 3, -1, 20);
+ public static final cElementalDefinitionStack lepton_e1 = new cElementalDefinitionStack(lepton_e, 1);
+ public static final cElementalDefinitionStack lepton_e_1 = new cElementalDefinitionStack(lepton_e_, 1);
+
+
+ private eLeptonDefinition(String name, String symbol, int type, float mass, int charge, int color, int ID) {
+ super(name, symbol, type, mass, charge, color, ID);
//this.itemThing=null;
//this.fluidThing=null;
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eNeutrinoDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eNeutrinoDefinition.java
index 207d6696cf..19c5d36a5a 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eNeutrinoDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eNeutrinoDefinition.java
@@ -8,17 +8,17 @@ import com.github.technus.tectech.elementalMatter.classes.cElementalPrimitive;
* Created by danie_000 on 22.10.2016.
*/
public final class eNeutrinoDefinition extends cElementalPrimitive {
- public static final eNeutrinoDefinition lepton_Ve = new eNeutrinoDefinition("Electron neutrino", "\u03bd\u03b2",1, 2e0F, 0, -1,21);
- public static final eNeutrinoDefinition lepton_Vm = new eNeutrinoDefinition("Muon neutrino", "\u03bd\u03bc",2, 0.15e6F, 0, -1,23);
- public static final eNeutrinoDefinition lepton_Vt = new eNeutrinoDefinition("Tauon neutrino", "\u03bd\u03c4",3, 15e6F, 0, -1,25);
- public static final eNeutrinoDefinition lepton_Ve_ = new eNeutrinoDefinition("Positron neutrino", "~\u03bd\u03b2",-1, 2e0F, 0, -1,22);
- public static final eNeutrinoDefinition lepton_Vm_ = new eNeutrinoDefinition("Antimuon neutrino", "~\u03bd\u03bc",-2, 0.15e6F, 0, -1,24);
- public static final eNeutrinoDefinition lepton_Vt_ = new eNeutrinoDefinition("Antitauon neutrino", "~\u03bd\u03c4",-3, 15e6F, 0, -1,26);
- public static final cElementalDefinitionStack lepton_Ve1=new cElementalDefinitionStack(lepton_Ve,1);
- public static final cElementalDefinitionStack lepton_Ve_1=new cElementalDefinitionStack(lepton_Ve_,1);
+ public static final eNeutrinoDefinition lepton_Ve = new eNeutrinoDefinition("Electron neutrino", "\u03bd\u03b2", 1, 2e0F, 0, -1, 21);
+ public static final eNeutrinoDefinition lepton_Vm = new eNeutrinoDefinition("Muon neutrino", "\u03bd\u03bc", 2, 0.15e6F, 0, -1, 23);
+ public static final eNeutrinoDefinition lepton_Vt = new eNeutrinoDefinition("Tauon neutrino", "\u03bd\u03c4", 3, 15e6F, 0, -1, 25);
+ public static final eNeutrinoDefinition lepton_Ve_ = new eNeutrinoDefinition("Positron neutrino", "~\u03bd\u03b2", -1, 2e0F, 0, -1, 22);
+ public static final eNeutrinoDefinition lepton_Vm_ = new eNeutrinoDefinition("Antimuon neutrino", "~\u03bd\u03bc", -2, 0.15e6F, 0, -1, 24);
+ public static final eNeutrinoDefinition lepton_Vt_ = new eNeutrinoDefinition("Antitauon neutrino", "~\u03bd\u03c4", -3, 15e6F, 0, -1, 26);
+ public static final cElementalDefinitionStack lepton_Ve1 = new cElementalDefinitionStack(lepton_Ve, 1);
+ public static final cElementalDefinitionStack lepton_Ve_1 = new cElementalDefinitionStack(lepton_Ve_, 1);
- private eNeutrinoDefinition(String name, String symbol,int type, float mass, int charge, int color, int ID) {
- super(name, symbol,type, mass, charge, color,ID);
+ private eNeutrinoDefinition(String name, String symbol, int type, float mass, int charge, int color, int ID) {
+ super(name, symbol, type, mass, charge, color, ID);
}
public static void run() {
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eQuarkDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eQuarkDefinition.java
index 43514869c7..f7b311c201 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eQuarkDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/eQuarkDefinition.java
@@ -7,21 +7,21 @@ import com.github.technus.tectech.elementalMatter.classes.cElementalPrimitive;
* Created by danie_000 on 22.10.2016.
*/
public final class eQuarkDefinition extends cElementalPrimitive {
- public static final eQuarkDefinition quark_u = new eQuarkDefinition("Up", "u",1, 2.3e6F, 2, 0,3);
- public static final eQuarkDefinition quark_c = new eQuarkDefinition("Charm", "c",2, 1.29e9F, 2, 0,9);
- public static final eQuarkDefinition quark_t = new eQuarkDefinition("Top", "t",3, 172.44e9F, 2, 0,13);
- public static final eQuarkDefinition quark_d = new eQuarkDefinition("Down", "d",1, 4.8e6F, -1, 0,5);
- public static final eQuarkDefinition quark_s = new eQuarkDefinition("Strange", "s",2, 95e6F, -1, 0,7);
- public static final eQuarkDefinition quark_b = new eQuarkDefinition("Bottom", "b",3, 4.65e9F, -1, 0,11);
- public static final eQuarkDefinition quark_u_ = new eQuarkDefinition("AntiUp", "~u",-1, 2.3e6F, -2, 0,4);
- public static final eQuarkDefinition quark_c_ = new eQuarkDefinition("AntiCharm", "~c",-2, 1.29e9F, -2, 0,10);
- public static final eQuarkDefinition quark_t_ = new eQuarkDefinition("AntiTop", "~t",-3, 172.44e9F, -2, 0,14);
- public static final eQuarkDefinition quark_d_ = new eQuarkDefinition("AntiDown", "~d",-1, 4.8e6F, 1, 0,6);
- public static final eQuarkDefinition quark_s_ = new eQuarkDefinition("AntiStrange", "~s",-2, 95e6F, 1, 0,8);
- public static final eQuarkDefinition quark_b_ = new eQuarkDefinition("AntiBottom", "~b",-3, 4.65e9F, 1, 0,12);
+ public static final eQuarkDefinition quark_u = new eQuarkDefinition("Up", "u", 1, 2.3e6F, 2, 0, 3);
+ public static final eQuarkDefinition quark_c = new eQuarkDefinition("Charm", "c", 2, 1.29e9F, 2, 0, 9);
+ public static final eQuarkDefinition quark_t = new eQuarkDefinition("Top", "t", 3, 172.44e9F, 2, 0, 13);
+ public static final eQuarkDefinition quark_d = new eQuarkDefinition("Down", "d", 1, 4.8e6F, -1, 0, 5);
+ public static final eQuarkDefinition quark_s = new eQuarkDefinition("Strange", "s", 2, 95e6F, -1, 0, 7);
+ public static final eQuarkDefinition quark_b = new eQuarkDefinition("Bottom", "b", 3, 4.65e9F, -1, 0, 11);
+ public static final eQuarkDefinition quark_u_ = new eQuarkDefinition("AntiUp", "~u", -1, 2.3e6F, -2, 0, 4);
+ public static final eQuarkDefinition quark_c_ = new eQuarkDefinition("AntiCharm", "~c", -2, 1.29e9F, -2, 0, 10);
+ public static final eQuarkDefinition quark_t_ = new eQuarkDefinition("AntiTop", "~t", -3, 172.44e9F, -2, 0, 14);
+ public static final eQuarkDefinition quark_d_ = new eQuarkDefinition("AntiDown", "~d", -1, 4.8e6F, 1, 0, 6);
+ public static final eQuarkDefinition quark_s_ = new eQuarkDefinition("AntiStrange", "~s", -2, 95e6F, 1, 0, 8);
+ public static final eQuarkDefinition quark_b_ = new eQuarkDefinition("AntiBottom", "~b", -3, 4.65e9F, 1, 0, 12);
- private eQuarkDefinition(String name, String symbol,int type, float mass, int charge, int color,int ID) {
- super(name, symbol,type, mass, charge, color,ID);
+ private eQuarkDefinition(String name, String symbol, int type, float mass, int charge, int color, int ID) {
+ super(name, symbol, type, mass, charge, color, ID);
}
public static void run() {
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_Uncertainty.java b/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_Uncertainty.java
deleted file mode 100644
index c9184ff184..0000000000
--- a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_Uncertainty.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package com.github.technus.tectech.elementalMatter.gui;
-
-import com.github.technus.tectech.TecTech;
-import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.InventoryPlayer;
-import org.lwjgl.opengl.GL11;
-
-import static com.github.technus.tectech.TecTech.proxy;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
-public class GT_GUIContainer_Uncertainty extends GT_GUIContainerMetaTile_Machine {
- public GT_GUIContainer_Uncertainty(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(new GT_Container_Uncertainty(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Uncertainty.png");
- }
-
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- proxy.renderUnicodeString("Schrödinger", 46, 7,167, 0xffffff);
- if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).status==0)
- proxy.renderUnicodeString("Status: OK", 46, 16,167, 0xffffff);
- else
- proxy.renderUnicodeString("Status: NG", 46, 16,167, 0xffffff);
- }
-
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- int x = (this.width - this.xSize) / 2;
- int y = (this.height - this.ySize) / 2;
- drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).matrix!=null) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- final short bU=0,rU=70,fU=192,V=210,Vs=216; x+=52; y+=33;
- final int state=((GT_Container_Uncertainty) this.mContainer).status;
- switch(((GT_Container_Uncertainty) this.mContainer).mode){
- case 1://ooo oxo ooo
- drawTexturedModalRect(x + 12, y + 12,
- rU + (state==0?76:12),
- Vs + 12, 10, 10);
- break;
- case 2://ooo xox ooo
- drawTexturedModalRect(x, y + 12,
- rU + ((state&1)==0?64:0),
- Vs + 12, 10, 10);
- drawTexturedModalRect(x+24, y + 12,
- rU + ((state&2)==0?88:24),
- Vs + 12, 10, 10);
- break;
- case 3://oxo xox oxo
- drawTexturedModalRect(x+12, y,
- rU + ((state&1)==0?76:12),
- Vs, 10, 10);
- drawTexturedModalRect(x, y + 12,
- rU + ((state&2)==0?64:0),
- Vs + 12, 10, 10);
- drawTexturedModalRect(x+24, y + 12,
- rU + ((state&4)==0?88:24),
- Vs + 12, 10, 10);
- drawTexturedModalRect(x+12, y + 24,
- rU + ((state&8)==0?76:12),
- Vs + 24, 10, 10);
- break;
- case 4://xox ooo xox
- drawTexturedModalRect(x, y,
- rU + ((state&1)==0?64:0),
- Vs, 10, 10);
- drawTexturedModalRect(x+24, y,
- rU + ((state&2)==0?88:24),
- Vs, 10, 10);
- drawTexturedModalRect(x, y+24,
- rU + ((state&4)==0?64:0),
- Vs+24, 10, 10);
- drawTexturedModalRect(x+24, y + 24,
- rU + ((state&8)==0?88:24),
- Vs + 24, 10, 10);
- break;
- case 5://xox ooo xox
- drawTexturedModalRect(x, y,
- rU + ((state&1)==0?64:0),
- Vs, 10, 10);
- drawTexturedModalRect(x+24, y,
- rU + ((state&2)==0?88:24),
- Vs, 10, 10);
- drawTexturedModalRect(x + 12, y + 12,
- rU + ((state&4)==0?76:12),
- Vs + 12, 10, 10);
- drawTexturedModalRect(x, y+24,
- rU + ((state&8)==0?64:0),
- Vs+24, 10, 10);
- drawTexturedModalRect(x+24, y + 24,
- rU + ((state&16)==0?88:24),
- Vs + 24, 10, 10);
- break;
- }
- x-=6;y-=6;
- for(int i=0;i<16;i++)
- if(TecTech.Rnd.nextInt(1000)<((GT_Container_Uncertainty) this.mContainer).matrix[i])
- drawTexturedModalRect(x + 12*(i/4), y + 12*(i%4),
- fU + 12*(i/4), V + 12*(i%4), 10, 10);
- if(((GT_Container_Uncertainty) this.mContainer).selection>-1) {
- int sel=((GT_Container_Uncertainty) this.mContainer).selection;
- drawTexturedModalRect(x + 12*(sel/4), y + 12*(sel%4),
- bU + 12*(sel/4), V + 12*(sel%4), 10, 10);
- }
- }
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iElementalInstanceContainer.java b/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iElementalInstanceContainer.java
index 309a51a559..72f9c8e3f4 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iElementalInstanceContainer.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iElementalInstanceContainer.java
@@ -7,5 +7,6 @@ import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStac
*/
public interface iElementalInstanceContainer {
cElementalInstanceStackTree getContainerHandler();
+
float purgeOverflow();
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iHasElementalDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iHasElementalDefinition.java
index 94f8e7bb14..d7bd96f9a2 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iHasElementalDefinition.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/interfaces/iHasElementalDefinition.java
@@ -5,5 +5,6 @@ package com.github.technus.tectech.elementalMatter.interfaces;
*/
public interface iHasElementalDefinition extends Comparable<iHasElementalDefinition> {
iElementalDefinition getDefinition();
+
int getAmount();
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMjunction.java b/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMjunction.java
deleted file mode 100644
index bbf6081b50..0000000000
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMjunction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.github.technus.tectech.elementalMatter.machine;
-
-import com.github.technus.tectech.blocks.QuantumGlass;
-import com.github.technus.tectech.casing.GT_Container_CasingsTT;
-import com.github.technus.tectech.elementalMatter.commonValues;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import static gregtech.api.enums.GT_Values.V;
-
-/**
- * Created by danie_000 on 17.12.2016.
- */
-public class GT_MetaTileEntity_EMjunction extends GT_MetaTileEntity_MultiblockBase_Elemental {
- public GT_MetaTileEntity_EMjunction(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_EMjunction(String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMjunction(this.mName);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
- int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
- int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
- if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir)!= QuantumGlass.INSTANCE) return false;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((i!=0 || j!=0 || h!=0)/*exclude center*/&&(xDir+i!=0 || yDir+h!=0 || zDir+j!=0)/*exclude this*/) {
- IGregTechTileEntity tTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + i, yDir + h, zDir + j);
- if ( (!addMaintenanceToMachineList(tTileEntity, 99)) &&
- (!addElementalInputToMachineList(tTileEntity, 99)) &&
- (!addElementalOutputToMachineList(tTileEntity, 99)) &&
- (!addMufflerToMachineList(tTileEntity, 99)) &&
- (!addEnergyIOToMachineList(tTileEntity, 99))) {
- if ( iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != GT_Container_CasingsTT.sBlockCasingsTT ||
- iGregTechTileEntity.getMetaIDOffset(xDir + i, yDir + h, zDir + j) != 3) {
- return false;
- }
- }
- }
- }
- }
- }
- return true;
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- commonValues.tecMark,
- "Reroutes Matter",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"Axis aligned movement!"
- };
- }
-
- @Override
- public void EM_checkParams() {
- for(int i=0;i<10;i++){
- if((int)eParamsIn[i]<0)eParamsInStatus[i]=PARAM_TOO_LOW;
- else if((int)eParamsIn[i]==0)eParamsInStatus[i]=PARAM_UNUSED;
- else if((int)eParamsIn[i]>eInputHatches.size())eParamsInStatus[i]=PARAM_TOO_HIGH;
- else eParamsInStatus[i]=PARAM_OK;
- }
- for(int i=10;i<20;i++){
- if(eParamsInStatus[i-10]==PARAM_OK){
- if((int)eParamsIn[i]<0) eParamsInStatus[i] = PARAM_TOO_LOW;
- else if((int)eParamsIn[i]==0)eParamsInStatus[i]=PARAM_LOW;
- else if((int)eParamsIn[i]>eOutputHatches.size())eParamsInStatus[i]=PARAM_TOO_HIGH;
- else eParamsInStatus[i]=PARAM_OK;
- }else{
- eParamsInStatus[i]=PARAM_UNUSED;
- }
- }
- }
-
- @Override
- public boolean EM_checkRecipe(ItemStack itemStack) {
- for(GT_MetaTileEntity_Hatch_InputElemental in: eInputHatches)
- if(in.getContainerHandler().hasStacks()) {
- mEUt=-(int)V[8];
- eAmpereFlow =1+((eInputHatches.size()+eOutputHatches.size())>>1);
- mMaxProgresstime=20;
- mEfficiencyIncrease=10000;
- return true;
- }
- mMaxProgresstime=0;
- mEfficiencyIncrease=0;
- return false;
- }
-
- @Override
- public void EM_outputFunction() {
- for(int i=0;i<10;i++){
- final int inIndex=(int)(eParamsIn[i])-1;
- if(inIndex<0 || inIndex>eInputHatches.size()) continue;
- final int outIndex=(int)(eParamsIn[i+10])-1;
- GT_MetaTileEntity_Hatch_InputElemental in=eInputHatches.get(inIndex);
- if(outIndex==-1){
- cleanHatchContent(in);
- }else{
- GT_MetaTileEntity_Hatch_OutputElemental out=eOutputHatches.get(outIndex);
- out.getContainerHandler().putUnifyAll(in.getContainerHandler());
- in.getContainerHandler().clear();
- }
- }
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_Uncertainty.java b/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_Uncertainty.java
deleted file mode 100644
index 97605cabd0..0000000000
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_Uncertainty.java
+++ /dev/null
@@ -1,288 +0,0 @@
-package com.github.technus.tectech.elementalMatter.machine;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.elementalMatter.commonValues;
-import com.github.technus.tectech.elementalMatter.gui.GT_Container_Uncertainty;
-import com.github.technus.tectech.elementalMatter.gui.GT_GUIContainer_Uncertainty;
-import com.github.technus.tectech.elementalMatter.gui.GT_GUIContainer_UncertaintyAdv;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.objects.GT_RenderedTexture;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.fluids.FluidStack;
-
-/**
- * Created by danie_000 on 15.12.2016.
- */
-public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch {
- private static Textures.BlockIcons.CustomIcon ScreenON;
- private static Textures.BlockIcons.CustomIcon ScreenOFF;
- private static float errorMargin=0.05f;
- public short[] matrix=new short[]{500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500};
- public byte selection=-1,mode=0,status=-128;
-
- public GT_MetaTileEntity_Hatch_Uncertainty(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "Feeling certain, or not?");
- regenerate();
- }
-
- public GT_MetaTileEntity_Hatch_Uncertainty(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 0, aDescription, aTextures);
- regenerate();
- }
-
- @Override
- public void registerIcons(IIconRegister aBlockIconRegister) {
- super.registerIcons(aBlockIconRegister);
- ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/UC");
- ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/UC_ACTIVE");
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Uncertainty(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- if(mTier>6) return new GT_GUIContainer_UncertaintyAdv(aPlayerInventory,aBaseMetaTileEntity);
- return new GT_GUIContainer_Uncertainty(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenON)};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenOFF)};
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(aBaseMetaTileEntity.isServerSide() && (aTick&15)==0) {
- shift();
- compute();
- if(mode==0)aBaseMetaTileEntity.setActive(false);
- else aBaseMetaTileEntity.setActive(true);
- }
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
- return new GT_MetaTileEntity_Hatch_Uncertainty(mName, mTier, mDescription, mTextures);
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[]{
- "Status: "+EnumChatFormatting.GOLD+status
- };
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setByte("mSel",selection);
- aNBT.setByte("mMode",mode);
- aNBT.setByte("mStatus",status);
- NBTTagCompound mat=new NBTTagCompound();
- for(int i=0;i<16;i++)
- mat.setShort(Integer.toString(i),matrix[i]);
- aNBT.setTag("mMat",mat);
- }
-
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- selection=aNBT.getByte("mSel");
- mode=aNBT.getByte("mMode");
- status=aNBT.getByte("mStatus");
- NBTTagCompound mat=aNBT.getCompoundTag("mMat");
- for(int i=0;i<16;i++)
- matrix[i]=mat.getShort(Integer.toString(i));
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return false;
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- return false;
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return false;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- commonValues.tecMark,
- mDescription,
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"Schrödinger equation in a box"
- };
- }
-
- private float massOffset(int sideLenY, int sideLenX, short... masses){
- int mass=0;
- int massI=0,massJ=0;
- for (int i = 0; i < sideLenY; i++) {
- for (int j = 0; j < sideLenY*sideLenX; j+=sideLenY) {
- mass+=masses[i+j];
- massI+=((float)i-((float)sideLenY/2f)+.5f)*masses[i+j];
- massJ+=((float)(j/sideLenY)-((float)sideLenX/2f)+.5f)*masses[i+j];
- }
- }
- return ((Math.abs(massI/(float)mass)/(float) sideLenY)+(Math.abs(massJ/(float)mass))/(float) sideLenX);
- }
-
- public void regenerate(){
- for(int i=0;i<matrix.length;i++)
- matrix[i]=(short)TecTech.Rnd.nextInt(1000);
- }
-
- public byte compute(){
- int result=0;
- switch(mode){
- case 1://ooo oxo ooo
- result=(massOffset(4,4,matrix)<errorMargin)?0:1;
- break;
- case 2://ooo xox ooo
- result+=(massOffset(4,2,
- matrix[0],matrix[4],
- matrix[1],matrix[5],
- matrix[2],matrix[6],
- matrix[3],matrix[7])<errorMargin)?0:1;
- result+=(massOffset(4,2,
- matrix[8 ],matrix[12],
- matrix[9 ],matrix[13],
- matrix[10],matrix[14],
- matrix[11],matrix[15])<errorMargin)?0:2;
- break;
- case 3://oxo xox oxo
- result+=(massOffset(2,4,
- matrix[0],matrix[4], matrix[8],matrix[12],
- matrix[1],matrix[5], matrix[9],matrix[13])<errorMargin)?0:1;
- result+=(massOffset(4,2,
- matrix[0],matrix[4],
- matrix[1],matrix[5],
- matrix[2],matrix[6],
- matrix[3],matrix[7])<errorMargin)?0:2;
- result+=(massOffset(4,2,
- matrix[8 ],matrix[12],
- matrix[9 ],matrix[13],
- matrix[10],matrix[14],
- matrix[11],matrix[15])<errorMargin)?0:4;
- result+=(massOffset(2,4,
- matrix[2],matrix[6], matrix[10],matrix[14],
- matrix[3],matrix[7], matrix[11],matrix[15])<errorMargin)?0:8;
- break;
- case 4://xox ooo xox
- result+=(massOffset(2,2,
- matrix[0],matrix[4],
- matrix[1],matrix[5])<errorMargin)?0:1;
- result+=(massOffset(2,2,
- matrix[8],matrix[12],
- matrix[9],matrix[13])<errorMargin)?0:2;
- result+=(massOffset(2,2,
- matrix[2],matrix[6],
- matrix[3],matrix[7])<errorMargin)?0:4;
- result+=(massOffset(2,2,
- matrix[10],matrix[14],
- matrix[11],matrix[15])<errorMargin)?0:8;
- break;
- case 5://xox oxo xox
- result+=(massOffset(2,2,
- matrix[0],matrix[4],
- matrix[1],matrix[5])<errorMargin)?0:1;
- result+=(massOffset(2,2,
- matrix[8],matrix[12],
- matrix[9],matrix[13])<errorMargin)?0:2;
- result+=(massOffset(4,4,matrix)<errorMargin)?0:4;
- result+=(massOffset(2,2,
- matrix[2],matrix[6],
- matrix[3],matrix[7])<errorMargin)?0:8;
- result+=(massOffset(2,2,
- matrix[10],matrix[14],
- matrix[11],matrix[15])<errorMargin)?0:16;
- break;
- }
- return status=(byte)result;
- }
-
- private void shift(){//TODO MAKE IT MORE EVIL
- final int i=TecTech.Rnd.nextInt(16),j=TecTech.Rnd.nextInt(2);
- matrix[i]+=(((matrix[i]&1)==0)?2:-2)*j;
- switch(matrix[i]){
- case 1002: matrix[i]-=3; break;
- case 1001: matrix[i]-=1; break;
- case -1: matrix[i]+=1; break;
- case -2: matrix[i]+=3; break;
- }
- }
-
- public byte update(int newMode){
- if(newMode==mode)return mode;
- if(newMode<0 || newMode>5) newMode=0;
- mode=(byte)newMode;
- regenerate();
- compute();
- return status;
- }
-
- //@Override
- //public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- // if(aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- // changeMode(++mode);
- // GT_Utility.sendChatToPlayer(aPlayer, "Equation mode: "+mode);
- // }
- //}
-}
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 8e34639345..3bee3cdd77 100644
--- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.proxy;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.blocks.QuantumGlassRender;
+import com.github.technus.tectech.things.block.QuantumGlassRender;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -15,62 +15,62 @@ import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
public class ClientProxy extends CommonProxy {
- @Override
- public void registerRenderInfo() {
- QuantumGlassRender.renderID = RenderingRegistry.getNextAvailableRenderId();
- RenderingRegistry.registerBlockHandler(QuantumGlassRender.renderID, new QuantumGlassRender());
- }
+ @Override
+ public void registerRenderInfo() {
+ QuantumGlassRender.renderID = RenderingRegistry.getNextAvailableRenderId();
+ RenderingRegistry.registerBlockHandler(QuantumGlassRender.renderID, new QuantumGlassRender());
+ }
- @Override
- public void particles(IGregTechTileEntity aMuffler,byte facing){//CUTE!
- ForgeDirection aDir=ForgeDirection.getOrientation(facing);
- float xPos=aDir.offsetX*0.76F+aMuffler.getXCoord()+0.25F;
- float yPos=aDir.offsetY*0.76F+aMuffler.getYCoord()+0.25F;
- float zPos=aDir.offsetZ*0.76F+aMuffler.getZCoord()+0.25F;
+ @Override
+ public void particles(IGregTechTileEntity aMuffler, byte facing) {//CUTE!
+ ForgeDirection aDir = ForgeDirection.getOrientation(facing);
+ float xPos = aDir.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F;
+ float yPos = aDir.offsetY * 0.76F + aMuffler.getYCoord() + 0.25F;
+ float zPos = aDir.offsetZ * 0.76F + aMuffler.getZCoord() + 0.25F;
- float ySpd=0;
- //aDir.offsetY*0.1F+0.2F+0.1F*floatGen.nextFloat();
- float xSpd=0;
- float zSpd=0;
- EntityFX particle=new EntityExplodeFX(aMuffler.getWorld(), xPos + TecTech.Rnd.nextFloat()*0.5F, yPos + TecTech.Rnd.nextFloat()*0.5F, zPos + TecTech.Rnd.nextFloat()*0.5F, xSpd, ySpd, zSpd);
- particle.setRBGColorF(0,0.6F*TecTech.Rnd.nextFloat(),0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
+ float ySpd = 0;
+ //aDir.offsetY*0.1F+0.2F+0.1F*floatGen.nextFloat();
+ float xSpd = 0;
+ float zSpd = 0;
+ EntityFX particle = new EntityExplodeFX(aMuffler.getWorld(), xPos + TecTech.Rnd.nextFloat() * 0.5F, yPos + TecTech.Rnd.nextFloat() * 0.5F, zPos + TecTech.Rnd.nextFloat() * 0.5F, xSpd, ySpd, zSpd);
+ particle.setRBGColorF(0, 0.6F * TecTech.Rnd.nextFloat(), 0.8f);
+ Minecraft.getMinecraft().effectRenderer.addEffect(particle);
+ }
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- return null;
- }
+ @Override
+ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+ return null;
+ }
- @Override
- public World getClientWorld() {
- return FMLClientHandler.instance().getClient().theWorld;
- }
+ @Override
+ public World getClientWorld() {
+ return FMLClientHandler.instance().getClient().theWorld;
+ }
- @Override
- public void renderUnicodeString(String str, int x, int y, int maxWidth, int color) {
- Minecraft mc = Minecraft.getMinecraft();
- FontRenderer fontRenderer = mc.fontRenderer;
+ @Override
+ public void renderUnicodeString(String str, int x, int y, int maxWidth, int color) {
+ Minecraft mc = Minecraft.getMinecraft();
+ FontRenderer fontRenderer = mc.fontRenderer;
- boolean origFont = fontRenderer.getUnicodeFlag();
+ boolean origFont = fontRenderer.getUnicodeFlag();
- if ((mc.gameSettings.guiScale) == 3) {
- fontRenderer.setUnicodeFlag(true);
- float dist = 0.08F;
- y--;
- for (int cycle = 0; cycle < 2; cycle++) {
- GL11.glTranslatef(-dist, 0F, 0F);
- fontRenderer.drawSplitString(str, x, y, maxWidth, color);
- GL11.glTranslatef(dist, -dist, 0F);
- fontRenderer.drawSplitString(str, x, y, maxWidth, color);
- GL11.glTranslatef(dist, 0F, 0F);
- fontRenderer.drawSplitString(str, x, y, maxWidth, color);
- GL11.glTranslatef(-dist, dist, 0F);
+ if ((mc.gameSettings.guiScale) == 3) {
+ fontRenderer.setUnicodeFlag(true);
+ float dist = 0.08F;
+ y--;
+ for (int cycle = 0; cycle < 2; cycle++) {
+ GL11.glTranslatef(-dist, 0F, 0F);
+ fontRenderer.drawSplitString(str, x, y, maxWidth, color);
+ GL11.glTranslatef(dist, -dist, 0F);
+ fontRenderer.drawSplitString(str, x, y, maxWidth, color);
+ GL11.glTranslatef(dist, 0F, 0F);
+ fontRenderer.drawSplitString(str, x, y, maxWidth, color);
+ GL11.glTranslatef(-dist, dist, 0F);
- dist = -dist;
- }
- fontRenderer.setUnicodeFlag(origFont);
- } else
- fontRenderer.drawSplitString(str, x, y, maxWidth, color);
- }
+ dist = -dist;
+ }
+ fontRenderer.setUnicodeFlag(origFont);
+ } else
+ fontRenderer.drawSplitString(str, x, y, maxWidth, color);
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
index a4bb92b92c..5ee6f31c35 100644
--- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
@@ -8,31 +8,36 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class CommonProxy implements IGuiHandler {
- public void registerRenderInfo() {}
+ public void registerRenderInfo() {
+ }
- public void particles(IGregTechTileEntity aMuffler,byte facing){}//CUTE!
+ public void particles(IGregTechTileEntity aMuffler, byte facing) {
+ }//CUTE!
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- return null;
- }
+ @Override
+ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+ return null;
+ }
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- return null;
- }
+ @Override
+ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+ return null;
+ }
- public World getClientWorld() {
- return null;
- }
+ public World getClientWorld() {
+ return null;
+ }
- public void renderUnicodeString(String str, int x, int y, int maxWidth, int color) {}
+ public void renderUnicodeString(String str, int x, int y, int maxWidth, int color) {
+ }
- public void setCustomRenderer() {}
+ public void setCustomRenderer() {
+ }
- public void setCustomRenderers() {}
+ public void setCustomRenderers() {
+ }
- public void broadcast(String str){
- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(str));
- }
+ public void broadcast(String str) {
+ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(str));
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/blocks/QuantumGlass.java b/src/main/java/com/github/technus/tectech/things/block/QuantumGlass.java
index e126cfb892..676538d72f 100644
--- a/src/main/java/com/github/technus/tectech/blocks/QuantumGlass.java
+++ b/src/main/java/com/github/technus/tectech/things/block/QuantumGlass.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.blocks;
+package com.github.technus.tectech.things.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -14,20 +14,20 @@ import static com.github.technus.tectech.auxiliary.Reference.MODID;
/**
* Created by danie_000 on 17.12.2016.
*/
-public final class QuantumGlass extends BlockBase{
+public final class QuantumGlass extends BlockBase {
public static IIcon stuff;
- public static QuantumGlass INSTANCE=new QuantumGlass();
+ public static QuantumGlass INSTANCE = new QuantumGlass();
- public QuantumGlass(){
+ public QuantumGlass() {
super(Material.iron);
- this.setBlockBounds(0,0,0,1,1,1);
+ this.setBlockBounds(0, 0, 0, 1, 1, 1);
setBlockName("QuantumGlass");
- setHarvestLevel("wrench",3);
+ setHarvestLevel("wrench", 3);
setHardness(50);
setResistance(30);
setLightOpacity(0);
setStepSound(Block.soundTypeMetal);
- setBlockTextureName(MODID+":blockQuantumGlass");
+ setBlockTextureName(MODID + ":blockQuantumGlass");
}
@Override
@@ -56,19 +56,16 @@ public final class QuantumGlass extends BlockBase{
}
@SideOnly(Side.CLIENT)
- public int getRenderBlockPass()
- {
+ public int getRenderBlockPass() {
return 1;
}
- public boolean renderAsNormalBlock()
- {
+ public boolean renderAsNormalBlock() {
return false;
}
@SideOnly(Side.CLIENT)
- public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
- {
+ public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
return block != this;// && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
}
@@ -81,6 +78,6 @@ public final class QuantumGlass extends BlockBase{
@Override
public void registerBlockIcons(IIconRegister p_149651_1_) {
super.registerBlockIcons(p_149651_1_);
- stuff=this.blockIcon;
+ stuff = this.blockIcon;
}
}
diff --git a/src/main/java/com/github/technus/tectech/blocks/QuantumGlassRender.java b/src/main/java/com/github/technus/tectech/things/block/QuantumGlassRender.java
index 7cd17a767a..37eb98236f 100644
--- a/src/main/java/com/github/technus/tectech/blocks/QuantumGlassRender.java
+++ b/src/main/java/com/github/technus/tectech/things/block/QuantumGlassRender.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.blocks;
+package com.github.technus.tectech.things.block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
@@ -14,7 +14,8 @@ import org.lwjgl.opengl.GL11;
public final class QuantumGlassRender implements ISimpleBlockRenderingHandler {
public static int renderID;
- public QuantumGlassRender() {}
+ public QuantumGlassRender() {
+ }
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
@@ -59,48 +60,48 @@ public final class QuantumGlassRender implements ISimpleBlockRenderingHandler {
renderer.renderStandardBlock(block, x, y, z);
Tessellator tes = Tessellator.instance;
- tes.setNormal(0F,1F,0F);
+ tes.setNormal(0F, 1F, 0F);
tes.setBrightness(15728880);
tes.setColorOpaque_F(0F, 1F, 1F);
IIcon side = QuantumGlass.stuff;
//South
- if(world.getBlock(x,y,z+1).getClass() != QuantumGlass.class) {
+ if (world.getBlock(x, y, z + 1).getClass() != QuantumGlass.class) {
tes.addVertexWithUV(x, y, z + 0.999, side.getMinU(), side.getMaxV()); //0.999 instead of 1 for fighting (textures overlapping)
tes.addVertexWithUV(x, y + 1, z + 0.999, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 1, z + 0.999, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 1, y, z + 0.999, side.getMaxU(), side.getMaxV());
}
//East
- if(world.getBlock(x+1,y,z).getClass() != QuantumGlass.class) {
+ if (world.getBlock(x + 1, y, z).getClass() != QuantumGlass.class) {
tes.addVertexWithUV(x + 0.999, y, z + 1, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x + 0.999, y + 1, z + 1, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 0.999, y + 1, z, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 0.999, y, z, side.getMaxU(), side.getMaxV());
}
//North
- if(world.getBlock(x,y,z-1).getClass() != QuantumGlass.class) {
+ if (world.getBlock(x, y, z - 1).getClass() != QuantumGlass.class) {
tes.addVertexWithUV(x + 1, y, z + 0.001, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x + 1, y + 1, z + 0.001, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x, y + 1, z + 0.001, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x, y, z + 0.001, side.getMaxU(), side.getMaxV());
}
//West
- if(world.getBlock(x-1,y,z).getClass() != QuantumGlass.class) {
+ if (world.getBlock(x - 1, y, z).getClass() != QuantumGlass.class) {
tes.addVertexWithUV(x + 0.001, y, z, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x + 0.001, y + 1, z, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 0.001, y + 1, z + 1, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 0.001, y, z + 1, side.getMaxU(), side.getMaxV());
}
//Top
- if(world.getBlock(x,y+1,z).getClass() != QuantumGlass.class) {
+ if (world.getBlock(x, y + 1, z).getClass() != QuantumGlass.class) {
tes.addVertexWithUV(x, y + 0.999, z + 1, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x, y + 0.999, z, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 0.999, z, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 0.999, z + 1, side.getMaxU(), side.getMaxV());
}
//Bottom
- if(world.getBlock(x,y-1,z).getClass() != QuantumGlass.class) {
+ if (world.getBlock(x, y - 1, z).getClass() != QuantumGlass.class) {
tes.addVertexWithUV(x, y + 0.001, z, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x, y + 0.001, z + 1, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 0.001, z + 1, side.getMaxU(), side.getMinV());
diff --git a/src/main/java/com/github/technus/tectech/casing/GT_Block_CasingsTT.java b/src/main/java/com/github/technus/tectech/things/casing/GT_Block_CasingsTT.java
index 5e0ef2c4af..51ccb9fc7f 100644
--- a/src/main/java/com/github/technus/tectech/casing/GT_Block_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/things/casing/GT_Block_CasingsTT.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.casing;
+package com.github.technus.tectech.things.casing;
import com.github.technus.tectech.CustomItemList;
import cpw.mods.fml.relauncher.Side;
@@ -23,8 +23,8 @@ import java.util.List;
public class GT_Block_CasingsTT
extends GT_Block_Casings_Abstract {
- private static IIcon eM3,eM4,eM5,eM6,eM7,eM8,eM9;
- private static IIcon debug[]=new IIcon[6];
+ private static IIcon eM3, eM4, eM5, eM6, eM7, eM8, eM9;
+ private static IIcon debug[] = new IIcon[6];
public GT_Block_CasingsTT() {
@@ -56,21 +56,21 @@ public class GT_Block_CasingsTT
@Override
public void registerBlockIcons(IIconRegister aIconRegister) {
//super.registerBlockIcons(aIconRegister);
- eM3=aIconRegister.registerIcon("gregtech:iconsets/EM_CASING");
- eM4=aIconRegister.registerIcon("gregtech:iconsets/EM_FIELD");
- eM5=aIconRegister.registerIcon("gregtech:iconsets/EM_FIELD_CASING");
- eM6=aIconRegister.registerIcon("gregtech:iconsets/EM_COIL");
- eM7=aIconRegister.registerIcon("gregtech:iconsets/EM_COIL_NONSIDE");
- eM8=aIconRegister.registerIcon("gregtech:iconsets/EM_TELE");
- eM8=aIconRegister.registerIcon("gregtech:iconsets/EM_TELE");
- eM9=aIconRegister.registerIcon("gregtech:iconsets/EM_TIMESPACE");
-
- debug[0]=aIconRegister.registerIcon("gregtech:iconsets/DEBUG_0");
- debug[1]=aIconRegister.registerIcon("gregtech:iconsets/DEBUG_1");
- debug[2]=aIconRegister.registerIcon("gregtech:iconsets/DEBUG_2");
- debug[3]=aIconRegister.registerIcon("gregtech:iconsets/DEBUG_3");
- debug[4]=aIconRegister.registerIcon("gregtech:iconsets/DEBUG_4");
- debug[5]=aIconRegister.registerIcon("gregtech:iconsets/DEBUG_5");
+ eM3 = aIconRegister.registerIcon("gregtech:iconsets/EM_CASING");
+ eM4 = aIconRegister.registerIcon("gregtech:iconsets/EM_FIELD");
+ eM5 = aIconRegister.registerIcon("gregtech:iconsets/EM_FIELD_CASING");
+ eM6 = aIconRegister.registerIcon("gregtech:iconsets/EM_COIL");
+ eM7 = aIconRegister.registerIcon("gregtech:iconsets/EM_COIL_NONSIDE");
+ eM8 = aIconRegister.registerIcon("gregtech:iconsets/EM_TELE");
+ eM8 = aIconRegister.registerIcon("gregtech:iconsets/EM_TELE");
+ eM9 = aIconRegister.registerIcon("gregtech:iconsets/EM_TIMESPACE");
+
+ debug[0] = aIconRegister.registerIcon("gregtech:iconsets/DEBUG_0");
+ debug[1] = aIconRegister.registerIcon("gregtech:iconsets/DEBUG_1");
+ debug[2] = aIconRegister.registerIcon("gregtech:iconsets/DEBUG_2");
+ debug[3] = aIconRegister.registerIcon("gregtech:iconsets/DEBUG_3");
+ debug[4] = aIconRegister.registerIcon("gregtech:iconsets/DEBUG_4");
+ debug[5] = aIconRegister.registerIcon("gregtech:iconsets/DEBUG_5");
}
public IIcon getIcon(int aSide, int aMeta) {
@@ -82,7 +82,7 @@ public class GT_Block_CasingsTT
case 5:
return eM5;
case 6:
- if(aSide<2)return eM7;
+ if (aSide < 2) return eM7;
return eM6;
case 7:
return eM8;
@@ -98,7 +98,7 @@ public class GT_Block_CasingsTT
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- return getIcon(aSide,tMeta);
+ return getIcon(aSide, tMeta);
}
public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) {
@@ -107,8 +107,8 @@ public class GT_Block_CasingsTT
@Override
public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
- for(int i=3;i<=9;i++){
- aList.add(new ItemStack(aItem,1,i));
+ for (int i = 3; i <= 9; i++) {
+ aList.add(new ItemStack(aItem, 1, i));
}
}
}
diff --git a/src/main/java/com/github/technus/tectech/casing/GT_Container_CasingsTT.java b/src/main/java/com/github/technus/tectech/things/casing/GT_Container_CasingsTT.java
index ddda51ea33..b3cf5ee3e6 100644
--- a/src/main/java/com/github/technus/tectech/casing/GT_Container_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/things/casing/GT_Container_CasingsTT.java
@@ -1,10 +1,10 @@
-package com.github.technus.tectech.casing;
+package com.github.technus.tectech.things.casing;
import net.minecraft.block.Block;
/**
* Created by danie_000 on 03.10.2016.
*/
-public class GT_Container_CasingsTT{
+public class GT_Container_CasingsTT {
public static Block sBlockCasingsTT;
}
diff --git a/src/main/java/com/github/technus/tectech/casing/GT_Item_CasingsTT.java b/src/main/java/com/github/technus/tectech/things/casing/GT_Item_CasingsTT.java
index 0560b28896..199b899d78 100644
--- a/src/main/java/com/github/technus/tectech/casing/GT_Item_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/things/casing/GT_Item_CasingsTT.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.casing;
+package com.github.technus.tectech.things.casing;
import gregtech.common.blocks.GT_Item_Casings_Abstract;
import net.minecraft.block.Block;
diff --git a/src/main/java/com/github/technus/tectech/casing/GT_Loader_CasingsTT.java b/src/main/java/com/github/technus/tectech/things/casing/GT_Loader_CasingsTT.java
index 3094d5e8b3..a611dbd708 100644
--- a/src/main/java/com/github/technus/tectech/casing/GT_Loader_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/things/casing/GT_Loader_CasingsTT.java
@@ -1,10 +1,10 @@
-package com.github.technus.tectech.casing;
+package com.github.technus.tectech.things.casing;
/**
* Created by danie_000 on 03.10.2016.
*/
public class GT_Loader_CasingsTT implements Runnable {
- public void run(){
+ public void run() {
GT_Container_CasingsTT.sBlockCasingsTT = new GT_Block_CasingsTT();
}
}
diff --git a/src/main/java/com/github/technus/tectech/things/machineTT.java b/src/main/java/com/github/technus/tectech/things/machineTT.java
new file mode 100644
index 0000000000..942502ad13
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/things/machineTT.java
@@ -0,0 +1,7 @@
+package com.github.technus.tectech.things;
+
+/**
+ * Created by Tec on 15.03.2017.
+ */
+public interface machineTT {
+}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/GT_MetaTileEntity_Hatch_ElementalContainer.java
index 42fc27fbc0..68baa20cd4 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_ElementalContainer.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/GT_MetaTileEntity_Hatch_ElementalContainer.java
@@ -1,11 +1,13 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackTree;
import com.github.technus.tectech.elementalMatter.classes.tElementalException;
import com.github.technus.tectech.elementalMatter.commonValues;
import com.github.technus.tectech.elementalMatter.interfaces.iConnectsToEMpipe;
import com.github.technus.tectech.elementalMatter.interfaces.iElementalInstanceContainer;
+import com.github.technus.tectech.things.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_MufflerElemental;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -27,16 +29,16 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Mult
/**
* Created by danie_000 on 11.12.2016.
*/
-public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_MetaTileEntity_Hatch implements iElementalInstanceContainer,iConnectsToEMpipe {
+public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_MetaTileEntity_Hatch implements iElementalInstanceContainer, iConnectsToEMpipe, machineTT {
private static Textures.BlockIcons.CustomIcon EM_T_SIDES;
private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE;
- protected cElementalInstanceStackTree content=new cElementalInstanceStackTree();
+ protected cElementalInstanceStackTree content = new cElementalInstanceStackTree();
//float lifeTimeMult=1f;
- int postEnergize=0;
- float overflowMatter=0f;
- public short id=-1;
- private byte deathDelay=2;
+ int postEnergize = 0;
+ float overflowMatter = 0f;
+ public short id = -1;
+ private byte deathDelay = 2;
public GT_MetaTileEntity_Hatch_ElementalContainer(int aID, String aName, String aNameRegional, int aTier, String descr) {
super(aID, aName, aNameRegional, aTier, 0, descr);
@@ -66,44 +68,46 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setInteger("postEnergize",postEnergize);
+ aNBT.setInteger("postEnergize", postEnergize);
//aNBT.setFloat("lifeTimeMult",lifeTimeMult);
- aNBT.setFloat("overflowMatter",overflowMatter);
- aNBT.setTag("eM_Stacks",content.toNBT());
- aNBT.setShort("eID",id);
+ aNBT.setFloat("overflowMatter", overflowMatter);
+ aNBT.setTag("eM_Stacks", content.toNBT());
+ aNBT.setShort("eID", id);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- postEnergize=aNBT.getInteger("postEnergize");
+ postEnergize = aNBT.getInteger("postEnergize");
//lifeTimeMult=aNBT.getFloat("lifeTimeMult");
- overflowMatter=aNBT.getFloat("overflowMatter");
- id=aNBT.getShort("eID");
+ overflowMatter = aNBT.getFloat("overflowMatter");
+ id = aNBT.getShort("eID");
try {
content = cElementalInstanceStackTree.fromNBT(aNBT.getCompoundTag("eM_Stacks"));
- }catch (tElementalException e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
- if(content==null) content=new cElementalInstanceStackTree();
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
+ if (content == null) content = new cElementalInstanceStackTree();
}
}
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(aBaseMetaTileEntity.isServerSide()){
- byte Tick= (byte)(aTick%20);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ byte Tick = (byte) (aTick % 20);
if (decayAt == Tick) {
purgeOverflow();
content.tickContent(postEnergize);//Hatches don't life time mult things
purgeOverflow();
} else if (overflowAt == Tick) {
- if(overflowMatter<=0) {
- deathDelay=3;
- }else {
- if(deathDelay==2) {
- if (TecTech.ModConfig.BOOM_ENABLE && TecTech.Rnd.nextInt(10)==0) aBaseMetaTileEntity.setOnFire();
- else TecTech.proxy.broadcast("Container0 FIRE! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
- }else if(deathDelay==1) {
+ if (overflowMatter <= 0) {
+ deathDelay = 3;
+ } else {
+ if (deathDelay == 2) {
+ if (TecTech.ModConfig.BOOM_ENABLE && TecTech.Rnd.nextInt(10) == 0)
+ aBaseMetaTileEntity.setOnFire();
+ else
+ TecTech.proxy.broadcast("Container0 FIRE! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
+ } else if (deathDelay == 1) {
IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(aBaseMetaTileEntity.getBackFacing());
if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_MufflerElemental))
tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide((byte) 0);
@@ -113,24 +117,27 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta
GT_MetaTileEntity_Hatch_MufflerElemental aMetaTileEntity = (GT_MetaTileEntity_Hatch_MufflerElemental) tGTTileEntity.getMetaTileEntity();
aMetaTileEntity.overflowMatter += overflowMatter;
if (aMetaTileEntity.overflowMatter > aMetaTileEntity.overflowMax) {
- if(TecTech.ModConfig.BOOM_ENABLE)tGTTileEntity.doExplosion(V[14]);
- else TecTech.proxy.broadcast("Container1 BOOM! "+getBaseMetaTileEntity().getXCoord()+" "+getBaseMetaTileEntity().getYCoord()+" "+getBaseMetaTileEntity().getZCoord());
+ if (TecTech.ModConfig.BOOM_ENABLE) tGTTileEntity.doExplosion(V[14]);
+ else
+ TecTech.proxy.broadcast("Container1 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
} else overflowMatter = 0F;
}
- }else if(deathDelay<1) {
+ } else if (deathDelay < 1) {
if (TecTech.ModConfig.BOOM_ENABLE) getBaseMetaTileEntity().doExplosion(V[14]);
- else TecTech.proxy.broadcast("Container2 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
+ else
+ TecTech.proxy.broadcast("Container2 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
}
deathDelay--;
}
- } else if (moveAt==Tick){
+ } else if (moveAt == Tick) {
moveAround(aBaseMetaTileEntity);
getBaseMetaTileEntity().setActive(content.hasStacks());
}
}
}
- public void moveAround(IGregTechTileEntity aBaseMetaTileEntity){}
+ public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) {
+ }
@Override
public cElementalInstanceStackTree getContainerHandler() {
@@ -178,16 +185,16 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta
}
public int getMaxStacksCount() {
- return mTier*2;
+ return mTier * 2;
}
public int getMaxStackSize() {
- return mTier*(mTier-7)*1000;
+ return mTier * (mTier - 7) * 1000;
}
@Override
- public float purgeOverflow(){
- return overflowMatter+=content.removeOverflow(getMaxStacksCount(),getMaxStackSize());
+ public float purgeOverflow() {
+ return overflowMatter += content.removeOverflow(getMaxStacksCount(), getMaxStackSize());
}
@Override
@@ -197,21 +204,22 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta
@Override
public String[] getInfoData() {
- if (id>0){
- if(content==null || content.size()==0) return new String[]{"ID: "+EnumChatFormatting.AQUA+id,"No Stacks"};
+ if (id > 0) {
+ if (content == null || content.size() == 0)
+ return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "No Stacks"};
else {
- final String[] lines=content.getElementalInfo();
- final String[] output=new String[lines.length+1];
- output[0]="ID: "+EnumChatFormatting.AQUA+id;
+ final String[] lines = content.getElementalInfo();
+ final String[] output = new String[lines.length + 1];
+ output[0] = "ID: " + EnumChatFormatting.AQUA + id;
System.arraycopy(lines, 0, output, 1, lines.length);
return output;
}
}
- if(content==null || content.size()==0) return new String[]{"No Stacks"};
+ if (content == null || content.size() == 0) return new String[]{"No Stacks"};
return content.getElementalInfo();
}
- public float updateSlots(){
+ public float updateSlots() {
return purgeOverflow();
}
@@ -220,21 +228,22 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta
return new String[]{
commonValues.tecMark,
mDescription,
- "Max stacks amount: "+EnumChatFormatting.AQUA+ getMaxStacksCount(),
- "Stack capacity: "+EnumChatFormatting.AQUA+ getMaxStackSize(),
+ "Max stacks amount: " + EnumChatFormatting.AQUA + getMaxStacksCount(),
+ "Stack capacity: " + EnumChatFormatting.AQUA + getMaxStackSize(),
"Place Overflow Hatch behind,on top or below",
"to provide overflow protection while this block",
"is not attached to multi block.",
"Transport range can be extended in straight",
"line up to 15 blocks with quantum tunnels.",
- EnumChatFormatting.AQUA+"Must be painted to work"
+ EnumChatFormatting.AQUA + "Must be painted to work"
};
}
@Override
public void onRemoval() {
- if(isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive())
- if(TecTech.ModConfig.BOOM_ENABLE)getBaseMetaTileEntity().doExplosion(V[15]);
- else TecTech.proxy.broadcast("BOOM! "+getBaseMetaTileEntity().getXCoord()+" "+getBaseMetaTileEntity().getYCoord()+" "+getBaseMetaTileEntity().getZCoord());
+ if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive())
+ if (TecTech.ModConfig.BOOM_ENABLE) getBaseMetaTileEntity().doExplosion(V[15]);
+ else
+ TecTech.proxy.broadcast("BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_MultiblockBase_Elemental.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/GT_MetaTileEntity_MultiblockBase_EM.java
index 9bec0cfa75..352e55718f 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_MultiblockBase_Elemental.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/GT_MetaTileEntity_MultiblockBase_EM.java
@@ -1,13 +1,15 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack;
import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack;
import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackTree;
import com.github.technus.tectech.elementalMatter.classes.tElementalException;
import com.github.technus.tectech.elementalMatter.commonValues;
-import com.github.technus.tectech.elementalMatter.gui.GT_Container_MultiMachineEM;
-import com.github.technus.tectech.elementalMatter.gui.GT_GUIContainer_MultiMachineEM;
+import com.github.technus.tectech.things.metaTileEntity.hatch.*;
+import com.github.technus.tectech.things.metaTileEntity.multi.gui.GT_Container_MultiMachineEM;
+import com.github.technus.tectech.things.metaTileEntity.multi.gui.GT_GUIContainer_MultiMachineEM;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -38,11 +40,11 @@ import static gregtech.api.enums.GT_Values.VN;
/**
* Created by danie_000 on 27.10.2016.
*/
-public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_MetaTileEntity_MultiBlockBase {
- protected cElementalInstanceStackTree[] outputEM=new cElementalInstanceStackTree[0];
+public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEntity_MultiBlockBase implements machineTT {
+ protected cElementalInstanceStackTree[] outputEM = new cElementalInstanceStackTree[0];
- final static ItemStack[] nothingI=new ItemStack[0];
- final static FluidStack[] nothingF=new FluidStack[0];
+ final static ItemStack[] nothingI = new ItemStack[0];
+ final static FluidStack[] nothingF = new FluidStack[0];
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
@@ -55,19 +57,19 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
public ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> eEnergyMulti = new ArrayList<>();
public ArrayList<GT_MetaTileEntity_Hatch_DynamoMulti> eDynamoMulti = new ArrayList<>();
- public final float[] eParamsIn=new float[20];
- public final float[] eParamsOut=new float[20];
- public final byte[] eParamsInStatus =new byte[20];
- public final byte[] eParamsOutStatus=new byte[20];
- protected final static byte PARAM_UNUSED=0, PARAM_OK=1, PARAM_TOO_LOW=2, PARAM_LOW=3, PARAM_TOO_HIGH=4, PARAM_HIGH=5, PARAM_WRONG=6;
+ public final float[] eParamsIn = new float[20];
+ public final float[] eParamsOut = new float[20];
+ public final byte[] eParamsInStatus = new byte[20];
+ public final byte[] eParamsOutStatus = new byte[20];
+ protected final static byte PARAM_UNUSED = 0, PARAM_OK = 1, PARAM_TOO_LOW = 2, PARAM_LOW = 3, PARAM_TOO_HIGH = 4, PARAM_HIGH = 5, PARAM_WRONG = 6;
//TO ENABLE this change value in <init> to false and/or other than 0, can also be added in recipe check or whatever
- public boolean eParameters=true,ePowerPass=false,eSafeVoid=false,eDismatleBoom=false;
- public byte eCertainMode=0,eCertainStatus=0,minRepairStatus=3;
+ public boolean eParameters = true, ePowerPass = false, eSafeVoid = false, eDismatleBoom = false;
+ public byte eCertainMode = 0, eCertainStatus = 0, minRepairStatus = 3;
- private long eMaxAmpereFlow =0;
- private long maxEUinputMin=0,maxEUinputMax=0;
- public long eAmpereFlow =1;
+ private long eMaxAmpereFlow = 0;
+ private long maxEUinputMin = 0, maxEUinputMax = 0;
+ public long eAmpereFlow = 1;
//init param states in constructor, or implement it in checkrecipe/outputfunction
@@ -76,26 +78,28 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
//if you want to add checks that run periodically when machine works then make onRunningTick better
//if you want to add checks that run periodically when machine is built then use check params
- public boolean EM_checkRecipe(ItemStack itemStack){
+ public boolean EM_checkRecipe(ItemStack itemStack) {
return false;
}
//My code handles AMPS, if you want overclocking just modify mEUt and mMaxProgressTime, leave amps as usual!
- public void EM_checkParams(){}
+ public void EM_checkParams() {
+ }
//update status of parameters in guis and "machine state"
- public void EM_outputFunction(){}
+ public void EM_outputFunction() {
+ }
// based on "machine state" do output,
// this must move to output EM things and can also modify output items/fluids/EM, remaining EM is NOT overflowed.
//(Well it can be overflowed if machine didn't finished, soft-hammered/disabled/not enough EU)
//RATHER LEAVE ALONE Section
- public GT_MetaTileEntity_MultiblockBase_Elemental(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_MultiblockBase_Elemental(String aName) {
+ public GT_MetaTileEntity_MultiblockBase_EM(String aName) {
super(aName);
}
@@ -133,24 +137,24 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
super.saveNBTData(aNBT);
//Fix supermethod shit.
- if(mOutputItems!=null)
- aNBT.setInteger("eItemsOut",mOutputItems.length);
- if(mOutputFluids!=null)
- aNBT.setInteger("eFluidsOut",mOutputFluids.length);
+ if (mOutputItems != null)
+ aNBT.setInteger("eItemsOut", mOutputItems.length);
+ if (mOutputFluids != null)
+ aNBT.setInteger("eFluidsOut", mOutputFluids.length);
aNBT.setLong("eMaxEUmin", maxEUinputMin);
aNBT.setLong("eMaxEUmax", maxEUinputMax);
aNBT.setLong("eRating", eAmpereFlow);
aNBT.setLong("eMaxA", eMaxAmpereFlow);
- aNBT.setByte("eCertainM",eCertainMode);
- aNBT.setByte("eCertainS",eCertainStatus);
- aNBT.setByte("eMinRepair",minRepairStatus);
- aNBT.setBoolean("eParam",eParameters);
- aNBT.setBoolean("ePass",ePowerPass);
- aNBT.setBoolean("eVoid",eSafeVoid);
+ aNBT.setByte("eCertainM", eCertainMode);
+ aNBT.setByte("eCertainS", eCertainStatus);
+ aNBT.setByte("eMinRepair", minRepairStatus);
+ aNBT.setBoolean("eParam", eParameters);
+ aNBT.setBoolean("ePass", ePowerPass);
+ aNBT.setBoolean("eVoid", eSafeVoid);
aNBT.setBoolean("eBoom", eDismatleBoom);
- if (outputEM!=null) {
+ if (outputEM != null) {
aNBT.setInteger("outputStackCount", outputEM.length);
NBTTagCompound output = new NBTTagCompound();
for (int i = 0; i < outputEM.length; i++)
@@ -161,42 +165,42 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
aNBT.removeTag("outputEM");
}
- NBTTagCompound paramI=new NBTTagCompound();
- for(int i=0;i<20;i++)
- paramI.setFloat(Integer.toString(i),eParamsIn[i]);
- aNBT.setTag("eParamsIn",paramI);
-
- NBTTagCompound paramO=new NBTTagCompound();
- for(int i=0;i<20;i++)
- paramO.setFloat(Integer.toString(i),eParamsOut[i]);
- aNBT.setTag("eParamsOut",paramO);
-
- NBTTagCompound paramIs=new NBTTagCompound();
- for(int i=0;i<20;i++)
- paramIs.setByte(Integer.toString(i),eParamsInStatus[i]);
- aNBT.setTag("eParamsInS",paramIs);
-
- NBTTagCompound paramOs=new NBTTagCompound();
- for(int i=0;i<20;i++)
- paramOs.setByte(Integer.toString(i),eParamsOutStatus[i]);
- aNBT.setTag("eParamsOutS",paramOs);
+ NBTTagCompound paramI = new NBTTagCompound();
+ for (int i = 0; i < 20; i++)
+ paramI.setFloat(Integer.toString(i), eParamsIn[i]);
+ aNBT.setTag("eParamsIn", paramI);
+
+ NBTTagCompound paramO = new NBTTagCompound();
+ for (int i = 0; i < 20; i++)
+ paramO.setFloat(Integer.toString(i), eParamsOut[i]);
+ aNBT.setTag("eParamsOut", paramO);
+
+ NBTTagCompound paramIs = new NBTTagCompound();
+ for (int i = 0; i < 20; i++)
+ paramIs.setByte(Integer.toString(i), eParamsInStatus[i]);
+ aNBT.setTag("eParamsInS", paramIs);
+
+ NBTTagCompound paramOs = new NBTTagCompound();
+ for (int i = 0; i < 20; i++)
+ paramOs.setByte(Integer.toString(i), eParamsOutStatus[i]);
+ aNBT.setTag("eParamsOutS", paramOs);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- maxEUinputMin =aNBT.getLong("eMaxEUmin");
- maxEUinputMax =aNBT.getLong("eMaxEUmax");
- eAmpereFlow =aNBT.getLong("eRating");
- eMaxAmpereFlow =aNBT.getLong("eMaxA");
- eCertainMode=aNBT.getByte("eCertainM");
- eCertainStatus=aNBT.getByte("eCertainS");
- minRepairStatus=aNBT.getByte("eMinRepair");
- eParameters=aNBT.getBoolean("eParam");
- ePowerPass=aNBT.getBoolean("ePass");
- eSafeVoid=aNBT.getBoolean("eVoid");
- eDismatleBoom =aNBT.getBoolean("eBoom");
+ maxEUinputMin = aNBT.getLong("eMaxEUmin");
+ maxEUinputMax = aNBT.getLong("eMaxEUmax");
+ eAmpereFlow = aNBT.getLong("eRating");
+ eMaxAmpereFlow = aNBT.getLong("eMaxA");
+ eCertainMode = aNBT.getByte("eCertainM");
+ eCertainStatus = aNBT.getByte("eCertainS");
+ minRepairStatus = aNBT.getByte("eMinRepair");
+ eParameters = aNBT.getBoolean("eParam");
+ ePowerPass = aNBT.getBoolean("ePass");
+ eSafeVoid = aNBT.getBoolean("eVoid");
+ eDismatleBoom = aNBT.getBoolean("eBoom");
//Fix supermethod shit.
mOutputItems = new ItemStack[aNBT.getInteger("eItemsOut")];
@@ -206,44 +210,44 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
for (int i = 0; i < mOutputFluids.length; i++)
mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
- final int outputLen=aNBT.getInteger("outputStackCount");
- if(outputLen>0){
- outputEM=new cElementalInstanceStackTree[outputLen];
- for(int i=0;i<outputEM.length;i++)
+ final int outputLen = aNBT.getInteger("outputStackCount");
+ if (outputLen > 0) {
+ outputEM = new cElementalInstanceStackTree[outputLen];
+ for (int i = 0; i < outputEM.length; i++)
try {
outputEM[i] = cElementalInstanceStackTree.fromNBT(
aNBT.getCompoundTag("outputEM").getCompoundTag(Integer.toString(i)));
- }catch (tElementalException e){
- if(TecTech.ModConfig.DEBUG_MODE)e.printStackTrace();
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
outputEM[i] = new cElementalInstanceStackTree();
}
- }else outputEM=new cElementalInstanceStackTree[0];
+ } else outputEM = new cElementalInstanceStackTree[0];
- NBTTagCompound paramI=aNBT.getCompoundTag("eParamsIn");
- for(int i=0;i<eParamsIn.length;i++)
- eParamsIn[i]=paramI.getFloat(Integer.toString(i));
+ NBTTagCompound paramI = aNBT.getCompoundTag("eParamsIn");
+ for (int i = 0; i < eParamsIn.length; i++)
+ eParamsIn[i] = paramI.getFloat(Integer.toString(i));
- NBTTagCompound paramO=aNBT.getCompoundTag("eParamsOut");
- for(int i=0;i<eParamsOut.length;i++)
- eParamsOut[i]=paramO.getFloat(Integer.toString(i));
+ NBTTagCompound paramO = aNBT.getCompoundTag("eParamsOut");
+ for (int i = 0; i < eParamsOut.length; i++)
+ eParamsOut[i] = paramO.getFloat(Integer.toString(i));
- NBTTagCompound paramIs=aNBT.getCompoundTag("eParamsInS");
- for(int i=0;i<eParamsInStatus.length;i++)
- eParamsInStatus[i]=paramIs.getByte(Integer.toString(i));
+ NBTTagCompound paramIs = aNBT.getCompoundTag("eParamsInS");
+ for (int i = 0; i < eParamsInStatus.length; i++)
+ eParamsInStatus[i] = paramIs.getByte(Integer.toString(i));
- NBTTagCompound paramOs=aNBT.getCompoundTag("eParamsOutS");
- for(int i=0;i<eParamsOutStatus.length;i++)
- eParamsOutStatus[i]=paramOs.getByte(Integer.toString(i));
+ NBTTagCompound paramOs = aNBT.getCompoundTag("eParamsOutS");
+ for (int i = 0; i < eParamsOutStatus.length; i++)
+ eParamsOutStatus[i] = paramOs.getByte(Integer.toString(i));
}
@Override
public final long maxEUStore() {
- return (maxEUinputMin* eMaxAmpereFlow)<<3;
+ return (maxEUinputMin * eMaxAmpereFlow) << 3;
}
@Override
public final long getMinimumStoredEU() {
- return maxEUStore()>>1;
+ return maxEUStore() >> 1;
}
@Override
@@ -276,14 +280,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
mMufflerHatches.clear();
mMaintenanceHatches.clear();
- for(GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental:eOutputHatches)
- if(isValidMetaTileEntity(hatch_elemental))hatch_elemental.id=-1;
- for(GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental:eInputHatches)
- if(isValidMetaTileEntity(hatch_elemental))hatch_elemental.id=-1;
- for(GT_MetaTileEntity_Hatch_Uncertainty hatch:eUncertainHatches)
- if(isValidMetaTileEntity(hatch))hatch.getBaseMetaTileEntity().setActive(false);
- for(GT_MetaTileEntity_Hatch_Param hatch:eParamHatches)
- if(isValidMetaTileEntity(hatch))hatch.getBaseMetaTileEntity().setActive(false);
+ for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches)
+ if (isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = -1;
+ for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches)
+ if (isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = -1;
+ for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches)
+ if (isValidMetaTileEntity(hatch)) hatch.getBaseMetaTileEntity().setActive(false);
+ for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches)
+ if (isValidMetaTileEntity(hatch)) hatch.getBaseMetaTileEntity().setActive(false);
eUncertainHatches.clear();
eEnergyMulti.clear();
@@ -295,73 +299,74 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]);
- if(!mMachine)
- if(eDismatleBoom && mMaxProgresstime>0) explodeMultiblock();
- else if(outputEM!=null)
- for(cElementalInstanceStackTree tree:outputEM)
- if(tree.hasStacks()) {
+ if (!mMachine)
+ if (eDismatleBoom && mMaxProgresstime > 0) explodeMultiblock();
+ else if (outputEM != null)
+ for (cElementalInstanceStackTree tree : outputEM)
+ if (tree.hasStacks()) {
explodeMultiblock();
break;
}
- if(eUncertainHatches.size()>1) mMachine=false;
-
- if(mMachine) {
- short id=1;
- for(GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental:eOutputHatches)
- if(isValidMetaTileEntity(hatch_elemental))hatch_elemental.id=id++;
- id=1;
- for(GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental:eInputHatches)
- if(isValidMetaTileEntity(hatch_elemental))hatch_elemental.id=id++;
-
- if(mEnergyHatches.size()>0 || eEnergyMulti.size()>0) {
- maxEUinputMin=V[15];
- maxEUinputMax=V[0];
- for(GT_MetaTileEntity_Hatch_Energy hatch:mEnergyHatches)
- if(isValidMetaTileEntity(hatch)){
+ if (eUncertainHatches.size() > 1) mMachine = false;
+
+ if (mMachine) {
+ short id = 1;
+ for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches)
+ if (isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = id++;
+ id = 1;
+ for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches)
+ if (isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = id++;
+
+ if (mEnergyHatches.size() > 0 || eEnergyMulti.size() > 0) {
+ maxEUinputMin = V[15];
+ maxEUinputMax = V[0];
+ for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches)
+ if (isValidMetaTileEntity(hatch)) {
if (hatch.maxEUInput() < maxEUinputMin) maxEUinputMin = hatch.maxEUInput();
if (hatch.maxEUInput() > maxEUinputMax) maxEUinputMax = hatch.maxEUInput();
}
- for(GT_MetaTileEntity_Hatch_EnergyMulti hatch:eEnergyMulti)
- if(isValidMetaTileEntity(hatch)){
+ for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti)
+ if (isValidMetaTileEntity(hatch)) {
if (hatch.maxEUInput() < maxEUinputMin) maxEUinputMin = hatch.maxEUInput();
if (hatch.maxEUInput() > maxEUinputMax) maxEUinputMax = hatch.maxEUInput();
}
- eMaxAmpereFlow=0;
+ eMaxAmpereFlow = 0;
//counts only full amps
- for(GT_MetaTileEntity_Hatch_Energy hatch:mEnergyHatches)
- if(isValidMetaTileEntity(hatch)) eMaxAmpereFlow +=hatch.maxEUInput()/ maxEUinputMin;
- for(GT_MetaTileEntity_Hatch_EnergyMulti hatch:eEnergyMulti)
- if(isValidMetaTileEntity(hatch)) eMaxAmpereFlow +=(hatch.maxEUInput()/ maxEUinputMin)*hatch.Amperes;
- if(this.getEUVar()>maxEUStore())this.setEUVar(this.maxEUStore());
+ for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches)
+ if (isValidMetaTileEntity(hatch)) eMaxAmpereFlow += hatch.maxEUInput() / maxEUinputMin;
+ for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti)
+ if (isValidMetaTileEntity(hatch))
+ eMaxAmpereFlow += (hatch.maxEUInput() / maxEUinputMin) * hatch.Amperes;
+ if (this.getEUVar() > maxEUStore()) this.setEUVar(this.maxEUStore());
} else {
- maxEUinputMin=0;
- maxEUinputMax=0;
- eMaxAmpereFlow=0;
+ maxEUinputMin = 0;
+ maxEUinputMax = 0;
+ eMaxAmpereFlow = 0;
this.setEUVar(0);
}
for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches)
- if(isValidMetaTileEntity(hatch))hatch.getBaseMetaTileEntity().setActive(true);
+ if (isValidMetaTileEntity(hatch)) hatch.getBaseMetaTileEntity().setActive(true);
for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches)
- if(isValidMetaTileEntity(hatch))hatch.getBaseMetaTileEntity().setActive(true);
- }else{
- maxEUinputMin=0;
- maxEUinputMax=0;
- eMaxAmpereFlow=0;
+ if (isValidMetaTileEntity(hatch)) hatch.getBaseMetaTileEntity().setActive(true);
+ } else {
+ maxEUinputMin = 0;
+ maxEUinputMax = 0;
+ eMaxAmpereFlow = 0;
this.setEUVar(0);
}
}
- if (mStartUpCheck < 0 ) {//E
+ if (mStartUpCheck < 0) {//E
if (mMachine) {//S
- final byte Tick=(byte)(aTick%20);
- if (multiPurge1At==Tick || multiPurge2At==Tick)
+ final byte Tick = (byte) (aTick % 20);
+ if (multiPurge1At == Tick || multiPurge2At == Tick)
purgeAll();
- else if (multiCheckAt==Tick)
+ else if (multiCheckAt == Tick)
for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) {
if (isValidMetaTileEntity(tHatch)) {
- if (disableMaintenance){
+ if (disableMaintenance) {
mWrench = true;
mScrewdriver = true;
mSoftHammer = true;
@@ -369,7 +374,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
mSolderingTool = true;
mCrowbar = true;
} else {
- if (tHatch.mAuto && !(mWrench&&mScrewdriver&&mSoftHammer&&mHardHammer&&mSolderingTool&&mCrowbar))tHatch.isRecipeInputEqual(true);
+ if (tHatch.mAuto && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar))
+ tHatch.isRecipeInputEqual(true);
if (tHatch.mWrench) mWrench = true;
if (tHatch.mScrewdriver) mScrewdriver = true;
if (tHatch.mSoftHammer) mSoftHammer = true;
@@ -386,37 +392,37 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
}
}
- else if(moveAt==Tick && eSafeVoid) {
- for(GT_MetaTileEntity_Hatch_MufflerElemental voider:eMufflerHatches) {
- if(voider.overflowMax<voider.overflowMatter) continue;
- float remaining=voider.overflowMax-voider.overflowMatter;
- for(GT_MetaTileEntity_Hatch_InputElemental in:eInputHatches){
- for(cElementalInstanceStack instance:in.getContainerHandler().values()){
- int qty=(int)Math.floor(remaining/instance.definition.getMass());
- if(qty>0){
- qty=Math.min(qty,instance.amount);
- voider.overflowMatter+=instance.definition.getMass()*qty;
- in.getContainerHandler().removeAmount(false,new cElementalDefinitionStack(instance.definition,qty));
+ else if (moveAt == Tick && eSafeVoid) {
+ for (GT_MetaTileEntity_Hatch_MufflerElemental voider : eMufflerHatches) {
+ if (voider.overflowMax < voider.overflowMatter) continue;
+ float remaining = voider.overflowMax - voider.overflowMatter;
+ for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) {
+ for (cElementalInstanceStack instance : in.getContainerHandler().values()) {
+ int qty = (int) Math.floor(remaining / instance.definition.getMass());
+ if (qty > 0) {
+ qty = Math.min(qty, instance.amount);
+ voider.overflowMatter += instance.definition.getMass() * qty;
+ in.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty));
}
}
}
- for(GT_MetaTileEntity_Hatch_OutputElemental out:eOutputHatches){
- for(cElementalInstanceStack instance:out.getContainerHandler().values()){
- int qty=(int)Math.floor(remaining/instance.definition.getMass());
- if(qty>0){
- qty=Math.min(qty,instance.amount);
- voider.overflowMatter+=instance.definition.getMass()*qty;
- out.getContainerHandler().removeAmount(false,new cElementalDefinitionStack(instance.definition,qty));
+ for (GT_MetaTileEntity_Hatch_OutputElemental out : eOutputHatches) {
+ for (cElementalInstanceStack instance : out.getContainerHandler().values()) {
+ int qty = (int) Math.floor(remaining / instance.definition.getMass());
+ if (qty > 0) {
+ qty = Math.min(qty, instance.amount);
+ voider.overflowMatter += instance.definition.getMass() * qty;
+ out.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty));
}
}
}
//in case some weird shit happened here, it will still be safe
- if(voider.overflowMatter>voider.overflowMax)voider.overflowMatter=voider.overflowMax;
+ if (voider.overflowMatter > voider.overflowMax) voider.overflowMatter = voider.overflowMax;
}
}
if (getRepairStatus() >= minRepairStatus) {//S
- if (multiCheckAt==Tick)
+ if (multiCheckAt == Tick)
paramsUpdate();
if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {//Start
@@ -424,7 +430,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
if (!polluteEnvironment(getPollutionPerTick(mInventory[1])))
stopMachine();
- if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime && recipeAt==Tick ) {//progress increase and done
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime && recipeAt == Tick) {//progress increase and done
paramsUpdate();
EM_outputFunction();
if (mOutputItems != null) for (ItemStack tStack : mOutputItems)
@@ -435,17 +441,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
for (FluidStack tStack : mOutputFluids)
if (tStack != null)
addOutput(tStack);
- else if (mOutputFluids != null && mOutputFluids.length > 1)
- addFluidOutputs(mOutputFluids);
+ else if (mOutputFluids != null && mOutputFluids.length > 1)
+ addFluidOutputs(mOutputFluids);
updateSlots();
mOutputItems = null;
mOutputFluids = null;
- outputEM=new cElementalInstanceStackTree[0];
+ outputEM = new cElementalInstanceStackTree[0];
mProgresstime = 0;
mMaxProgresstime = 0;
mEfficiencyIncrease = 0;
if (aBaseMetaTileEntity.isAllowedToWork()) {
- if(checkRecipe(mInventory[1])) {
+ if (checkRecipe(mInventory[1])) {
mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
}
updateSlots();
@@ -453,9 +459,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
}
} else {
- if (recipeAt==Tick || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) {
+ if (recipeAt == Tick || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) {
if (aBaseMetaTileEntity.isAllowedToWork()) {
- if(checkRecipe(mInventory[1])) {
+ if (checkRecipe(mInventory[1])) {
mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
}
updateSlots();
@@ -467,17 +473,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
long euVar;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
if (this.getEUVar() > this.getMinimumStoredEU()) break;
- if (isValidMetaTileEntity(tHatch)){
- euVar=tHatch.maxEUInput();
- if(tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false))
+ if (isValidMetaTileEntity(tHatch)) {
+ euVar = tHatch.maxEUInput();
+ if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false))
this.setEUVar(this.getEUVar() + euVar);
}
}
for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) {
if (this.getEUVar() > this.getMinimumStoredEU()) break;
- if (isValidMetaTileEntity(tHatch)){
- euVar=tHatch.maxEUInput()*tHatch.Amperes;
- if(tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false))
+ if (isValidMetaTileEntity(tHatch)) {
+ euVar = tHatch.maxEUInput() * tHatch.Amperes;
+ if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false))
this.setEUVar(this.getEUVar() + euVar);
}
}
@@ -485,15 +491,15 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
if (isValidMetaTileEntity(tHatch)) {
euVar = tHatch.maxEUOutput();
- if( tHatch.getBaseMetaTileEntity().getStoredEU() <= (tHatch.maxEUStore() - euVar) &&
+ if (tHatch.getBaseMetaTileEntity().getStoredEU() <= (tHatch.maxEUStore() - euVar) &&
aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + (euVar >> 7), false))
tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar);
}
}
for (GT_MetaTileEntity_Hatch_DynamoMulti tHatch : eDynamoMulti) {
- if (isValidMetaTileEntity(tHatch)){
- euVar = tHatch.maxEUOutput()*tHatch.Amperes;
- if( tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar &&
+ if (isValidMetaTileEntity(tHatch)) {
+ euVar = tHatch.maxEUOutput() * tHatch.Amperes;
+ if (tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar &&
aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + (euVar >> 7), false))
tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar);
}
@@ -522,8 +528,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
private void addFluidOutputs(FluidStack[] mOutputFluids2) {
- for(int i = 0; i < mOutputFluids2.length; ++i) {
- if(this.mOutputHatches.size() > i && this.mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity((MetaTileEntity)this.mOutputHatches.get(i))) {
+ for (int i = 0; i < mOutputFluids2.length; ++i) {
+ if (this.mOutputHatches.size() > i && this.mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity((MetaTileEntity) this.mOutputHatches.get(i))) {
this.mOutputHatches.get(i).fill(mOutputFluids2[i], true);
}
}
@@ -536,20 +542,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
@Override
public int getIdealStatus() {
- return super.getIdealStatus()+2;
+ return super.getIdealStatus() + 2;
}
@Override
public int getRepairStatus() {
- return super.getRepairStatus() + ((eCertainStatus==0)?1:0) + (this.eParameters?1:0);
+ return super.getRepairStatus() + ((eCertainStatus == 0) ? 1 : 0) + (this.eParameters ? 1 : 0);
}
@Override
public boolean onRunningTick(ItemStack aStack) {
- if(this.mEUt > 0) {
- this.EMaddEnergyOutput((long)mEUt * (long)mEfficiency / getMaxEfficiency(aStack), eAmpereFlow);
+ if (this.mEUt > 0) {
+ this.EMaddEnergyOutput((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow);
return true;
- } else if(this.mEUt < 0 && !this.EMdrainEnergyInput((long)(-this.mEUt) * getMaxEfficiency(aStack) / (long)Math.max(1000, this.mEfficiency), eAmpereFlow)) {
+ } else if (this.mEUt < 0 && !this.EMdrainEnergyInput((long) (-this.mEUt) * getMaxEfficiency(aStack) / (long) Math.max(1000, this.mEfficiency), eAmpereFlow)) {
this.stopMachine();
return false;
} else return true;
@@ -558,24 +564,24 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
@Deprecated
@Override
public final boolean addEnergyOutput(long EU) {
- if(EU <= 0L) return true;
- for(GT_MetaTileEntity_Hatch tHatch:eDynamoMulti)
- if(isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU,false))
+ if (EU <= 0L) return true;
+ for (GT_MetaTileEntity_Hatch tHatch : eDynamoMulti)
+ if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false))
return true;
- for(GT_MetaTileEntity_Hatch tHatch:mDynamoHatches)
- if(isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU,false))
+ for (GT_MetaTileEntity_Hatch tHatch : mDynamoHatches)
+ if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false))
return true;
return false;
}
//new method
public final boolean EMaddEnergyOutput(long EU, long Amperes) {
- if(EU <= 0L || Amperes<=0) return true;
- long euVar=EU*Amperes;
+ if (EU <= 0L || Amperes <= 0) return true;
+ long euVar = EU * Amperes;
long diff;
for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
if (isValidMetaTileEntity(tHatch)) {
- if(tHatch.maxEUOutput()<EU) explodeMultiblock();
+ if (tHatch.maxEUOutput() < EU) explodeMultiblock();
diff = tHatch.maxEUStore() - tHatch.getBaseMetaTileEntity().getStoredEU();
if (diff > 0) {
if (euVar > diff) {
@@ -590,7 +596,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
for (GT_MetaTileEntity_Hatch_DynamoMulti tHatch : eDynamoMulti) {
if (isValidMetaTileEntity(tHatch)) {
- if(tHatch.maxEUOutput()<EU) explodeMultiblock();
+ if (tHatch.maxEUOutput() < EU) explodeMultiblock();
diff = tHatch.maxEUStore() - tHatch.getBaseMetaTileEntity().getStoredEU();
if (diff > 0) {
if (euVar > diff) {
@@ -609,24 +615,24 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
@Deprecated
@Override
public final boolean drainEnergyInput(long EU) {
- if(EU <= 0L) return true;
- for(GT_MetaTileEntity_Hatch tHatch:eEnergyMulti)
- if(isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU,false))
+ if (EU <= 0L) return true;
+ for (GT_MetaTileEntity_Hatch tHatch : eEnergyMulti)
+ if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false))
return true;
- for(GT_MetaTileEntity_Hatch tHatch:mEnergyHatches)
- if(isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU,false))
+ for (GT_MetaTileEntity_Hatch tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false))
return true;
return false;
}
//new method
public final boolean EMdrainEnergyInput(long EU, long Amperes) {
- if(EU <= 0L || Amperes <= 0) return true;
- long euVar=EU*Amperes;
- if( euVar > getEUVar() ||
- EU>maxEUinputMax ||
- (euVar-1)/maxEUinputMin+1>eMaxAmpereFlow){
- if(TecTech.ModConfig.DEBUG_MODE) {
+ if (EU <= 0L || Amperes <= 0) return true;
+ long euVar = EU * Amperes;
+ if (euVar > getEUVar() ||
+ EU > maxEUinputMax ||
+ (euVar - 1) / maxEUinputMin + 1 > eMaxAmpereFlow) {
+ if (TecTech.ModConfig.DEBUG_MODE) {
TecTech.Logger.debug("OMG1 " + euVar + " " + getEUVar() + " " + (euVar > getEUVar()));
TecTech.Logger.debug("OMG2 " + EU + " " + maxEUinputMax + " " + (EU > maxEUinputMax));
TecTech.Logger.debug("OMG3 " + euVar + " " + eMaxAmpereFlow);
@@ -635,31 +641,31 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
return false;
}
//sub eu
- setEUVar(getEUVar()-euVar);
+ setEUVar(getEUVar() - euVar);
return true;
}
//new method
- public final boolean EMoverclockAndPutValuesIn(long EU,int time){
- if(EU==0){
- mEUt=0;
- mMaxProgresstime=time;
+ public final boolean EMoverclockAndPutValuesIn(long EU, int time) {
+ if (EU == 0) {
+ mEUt = 0;
+ mMaxProgresstime = time;
return true;
}
- long tempEUt = EU<V[1] ? V[1] : EU;
- long tempTier=maxEUinputMax>>2;
- while(tempEUt<tempTier){
- tempEUt<<=2;
- time>>=1;
- EU = time==0 ? EU>>1 : EU<<2;//U know, if the time is less than 1 tick make the machine use less power
+ long tempEUt = EU < V[1] ? V[1] : EU;
+ long tempTier = maxEUinputMax >> 2;
+ while (tempEUt < tempTier) {
+ tempEUt <<= 2;
+ time >>= 1;
+ EU = time == 0 ? EU >> 1 : EU << 2;//U know, if the time is less than 1 tick make the machine use less power
}
- if(EU> Integer.MAX_VALUE || EU< Integer.MIN_VALUE){
- mEUt= Integer.MAX_VALUE-1;
- mMaxProgresstime= Integer.MAX_VALUE-1;
+ if (EU > Integer.MAX_VALUE || EU < Integer.MIN_VALUE) {
+ mEUt = Integer.MAX_VALUE - 1;
+ mMaxProgresstime = Integer.MAX_VALUE - 1;
return false;
}
- mEUt=(int)EU;
- mMaxProgresstime=time==0?1:time;
+ mEUt = (int) EU;
+ mMaxProgresstime = time == 0 ? 1 : time;
return true;
}//Use in EM check recipe return statement if you want overclocking
@@ -674,12 +680,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
//new Method
- public final int getMaxEnergyInputTier(){
+ public final int getMaxEnergyInputTier() {
return GT_Utility.getTier(maxEUinputMax);
}
//new Method
- public final int getMinEnergyInputTier(){
+ public final int getMinEnergyInputTier() {
return GT_Utility.getTier(maxEUinputMin);
}
@@ -694,12 +700,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
mEfficiencyIncrease = 0;
getBaseMetaTileEntity().disableWorking();
- float mass=0;
- if(outputEM==null) return;
- for(cElementalInstanceStackTree tree:outputEM)
- mass+=tree.getMass();
- if(mass>0) {
- if (eMufflerHatches.size()<1) explodeMultiblock();
+ float mass = 0;
+ if (outputEM == null) return;
+ for (cElementalInstanceStackTree tree : outputEM)
+ mass += tree.getMass();
+ if (mass > 0) {
+ if (eMufflerHatches.size() < 1) explodeMultiblock();
mass /= eMufflerHatches.size();
for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) {
dump.overflowMatter += mass;
@@ -720,20 +726,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
purgeAll();
}
- private void purgeAll(){
- float mass=0;
- for(GT_MetaTileEntity_Hatch_InputElemental tHatch: eInputHatches) {
+ private void purgeAll() {
+ float mass = 0;
+ for (GT_MetaTileEntity_Hatch_InputElemental tHatch : eInputHatches) {
if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
- mass+=tHatch.overflowMatter;
- tHatch.overflowMatter=0;
+ mass += tHatch.overflowMatter;
+ tHatch.overflowMatter = 0;
}
- for(GT_MetaTileEntity_Hatch_OutputElemental tHatch: eOutputHatches) {
+ for (GT_MetaTileEntity_Hatch_OutputElemental tHatch : eOutputHatches) {
if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
- mass+=tHatch.overflowMatter;
- tHatch.overflowMatter=0;
+ mass += tHatch.overflowMatter;
+ tHatch.overflowMatter = 0;
}
- if(mass>0) {
- if (eMufflerHatches.size()<1) {
+ if (mass > 0) {
+ if (eMufflerHatches.size() < 1) {
explodeMultiblock();
return;
}
@@ -745,10 +751,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
}
- public void cleanHatchContent(GT_MetaTileEntity_Hatch_ElementalContainer target){
- float mass=target.getContainerHandler().getMass();
- if(mass>0) {
- if (eMufflerHatches.size()<1) explodeMultiblock();
+ public void cleanHatchContent(GT_MetaTileEntity_Hatch_ElementalContainer target) {
+ float mass = target.getContainerHandler().getMass();
+ if (mass > 0) {
+ if (eMufflerHatches.size() < 1) explodeMultiblock();
mass /= eMufflerHatches.size();
for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) {
dump.overflowMatter += mass;
@@ -758,23 +764,23 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
@Override
- public final boolean checkRecipe(ItemStack itemStack){//do recipe checks, based on "machine content and state"
+ public final boolean checkRecipe(ItemStack itemStack) {//do recipe checks, based on "machine content and state"
paramsUpdate();
return EM_checkRecipe(itemStack);
}
- private void paramsUpdate(){
- for(GT_MetaTileEntity_Hatch_Param param:eParamHatches){
- int paramID=param.param;
- if(paramID<0)continue;
- eParamsIn[paramID]=param.value1f;
- eParamsIn[paramID+10]=param.value2f;
- param.input1f=eParamsOut[paramID];
- param.input2f=eParamsOut[paramID+10];
+ private void paramsUpdate() {
+ for (GT_MetaTileEntity_Hatch_Param param : eParamHatches) {
+ int paramID = param.param;
+ if (paramID < 0) continue;
+ eParamsIn[paramID] = param.value1f;
+ eParamsIn[paramID + 10] = param.value2f;
+ param.input1f = eParamsOut[paramID];
+ param.input2f = eParamsOut[paramID + 10];
}
EM_checkParams();
- for(GT_MetaTileEntity_Hatch_Uncertainty uncertainty:eUncertainHatches){
- eCertainStatus=uncertainty.update(eCertainMode);
+ for (GT_MetaTileEntity_Hatch_Uncertainty uncertainty : eUncertainHatches) {
+ eCertainStatus = uncertainty.update(eCertainMode);
}
}
@@ -795,29 +801,29 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
@Override
public void explodeMultiblock() {//BEST METHOD EVER!!!
- if(!TecTech.ModConfig.BOOM_ENABLE) {
- TecTech.proxy.broadcast("Multi Explode BOOM! "+getBaseMetaTileEntity().getXCoord()+" "+getBaseMetaTileEntity().getYCoord()+" "+getBaseMetaTileEntity().getZCoord());
- StackTraceElement[] ste=Thread.currentThread().getStackTrace();
- TecTech.proxy.broadcast("Multi Explode BOOM! "+ste[2].toString());
+ if (!TecTech.ModConfig.BOOM_ENABLE) {
+ TecTech.proxy.broadcast("Multi Explode BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
+ StackTraceElement[] ste = Thread.currentThread().getStackTrace();
+ TecTech.proxy.broadcast("Multi Explode BOOM! " + ste[2].toString());
return;
}
GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 600000);
mInventory[1] = null;
- for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : mInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : mOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : mDynamoHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
- for (MetaTileEntity tTileEntity : mMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : mEnergyHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
- for (MetaTileEntity tTileEntity : mMaintenanceHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : eParamHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : eInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
- for (MetaTileEntity tTileEntity : eOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
- for (MetaTileEntity tTileEntity : eMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
- for (MetaTileEntity tTileEntity : eEnergyMulti) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
- for (MetaTileEntity tTileEntity : eUncertainHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
- for (MetaTileEntity tTileEntity : eDynamoMulti) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
+ for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : mInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : mOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : mDynamoHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
+ for (MetaTileEntity tTileEntity : mMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : mEnergyHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
+ for (MetaTileEntity tTileEntity : mMaintenanceHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : eParamHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : eInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
+ for (MetaTileEntity tTileEntity : eOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
+ for (MetaTileEntity tTileEntity : eMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
+ for (MetaTileEntity tTileEntity : eEnergyMulti) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
+ for (MetaTileEntity tTileEntity : eUncertainHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
+ for (MetaTileEntity tTileEntity : eDynamoMulti) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]);
getBaseMetaTileEntity().doExplosion(V[15]);
}
@@ -1064,7 +1070,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
@Override
- public final boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex){
+ public final boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) return false;
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
@@ -1084,7 +1090,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
}
//NEW METHOD
- public final boolean addClassicMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex){
+ public final boolean addClassicMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) return false;
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
@@ -1097,37 +1103,37 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
@Override
public String[] getInfoData() {//TODO Do it
- long storedEnergy=0;
- long maxEnergy=0;
- for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
+ long storedEnergy = 0;
+ long maxEnergy = 0;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
if (isValidMetaTileEntity(tHatch)) {
- storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
}
}
- for(GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) {
+ for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) {
if (isValidMetaTileEntity(tHatch)) {
- storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
}
}
return new String[]{
"Progress:",
- EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
- EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s",
+ EnumChatFormatting.GREEN + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " +
+ EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s",
"Energy Hatches:",
- EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU",
- (mEUt<=0?"Probably uses: ":"Probably makes: ")+
- EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at "+
- EnumChatFormatting.RED + eAmpereFlow+ EnumChatFormatting.RESET +" A",
- "Tier Rating: "+EnumChatFormatting.YELLOW+VN[getMaxEnergyInputTier()]+EnumChatFormatting.RESET+" / "+EnumChatFormatting.GREEN+VN[getMinEnergyInputTier()]+EnumChatFormatting.RESET+
- " Amp Rating: "+EnumChatFormatting.GREEN+ eMaxAmpereFlow +EnumChatFormatting.RESET + " A",
- "Problems: "+EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+
- " Efficiency: "+EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %",
- "PowerPass: "+EnumChatFormatting.BLUE+ePowerPass+EnumChatFormatting.RESET+
- " SafeVoid: "+EnumChatFormatting.BLUE+eSafeVoid
+ EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
+ EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU",
+ (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") +
+ EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " +
+ EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A",
+ "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier()] + EnumChatFormatting.RESET +
+ " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A",
+ "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET +
+ " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %",
+ "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET +
+ " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid
};
}
@@ -1141,29 +1147,42 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
Block[] blockType,//use numbers 0-9 for casing types
byte[] blockMeta,//use numbers 0-9 for casing types
int horizontalOffset, int verticalOffset, int depthOffset,
- IGregTechTileEntity aBaseMetaTileEntity){
+ IGregTechTileEntity aBaseMetaTileEntity) {
//TE Rotation
- byte facing=aBaseMetaTileEntity.getFrontFacing();
+ byte facing = aBaseMetaTileEntity.getFrontFacing();
- int x,y,z,a,c;//b is y no matter what
+ int x, y, z, a, c;//b is y no matter what
//perform your duties
- c=-depthOffset;
- for (String[] _structure:structure) {//front to back
- y=verticalOffset;
+ c = -depthOffset;
+ for (String[] _structure : structure) {//front to back
+ y = verticalOffset;
for (String __structure : _structure) {//top to bottom
- a=-horizontalOffset;
+ a = -horizontalOffset;
for (char block : __structure.toCharArray()) {//left to right
- if(block>'`'){//small characters allow to skip check a-1 skip, b-2 skips etc.
- a+=block-'`';
+ if (block > '`') {//small characters allow to skip check a-1 skip, b-2 skips etc.
+ a += block - '`';
} else {
//get x y z from rotation
switch (facing) {//translation
- case 4: x = c; z = a; break;
- case 3: x = a; z = -c; break;
- case 5: x = -c; z = -a; break;
- case 2: x = -a; z = c; break;
- default: return false;
+ case 4:
+ x = c;
+ z = a;
+ break;
+ case 3:
+ x = a;
+ z = -c;
+ break;
+ case 5:
+ x = -c;
+ z = -a;
+ break;
+ case 2:
+ x = -a;
+ z = c;
+ break;
+ default:
+ return false;
}
//Check block
switch (block) {
@@ -1176,14 +1195,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
default: {//check for block (countable)
int pointer = block - '0';
//countable air -> net.minecraft.block.BlockAir
- if (aBaseMetaTileEntity.getBlockOffset(x, y, z) != blockType[pointer]){
- if(TecTech.ModConfig.DEBUG_MODE)
- TecTech.Logger.info("Struct-block-error "+x+" "+y+" "+z+"/"+a+" "+c+"/"+aBaseMetaTileEntity.getBlockOffset (x,y,z)+" "+blockType[pointer]);
+ if (aBaseMetaTileEntity.getBlockOffset(x, y, z) != blockType[pointer]) {
+ if (TecTech.ModConfig.DEBUG_MODE)
+ TecTech.Logger.info("Struct-block-error " + x + " " + y + " " + z + "/" + a + " " + c + "/" + aBaseMetaTileEntity.getBlockOffset(x, y, z) + " " + blockType[pointer]);
return false;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != blockMeta[pointer]){
- if(TecTech.ModConfig.DEBUG_MODE)
- TecTech.Logger.info("Struct-meta-id-error "+x+" "+y+" "+z+"/"+a+" "+c+"/"+aBaseMetaTileEntity.getMetaIDOffset(x,y,z)+" "+blockMeta[pointer]);
+ if (aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != blockMeta[pointer]) {
+ if (TecTech.ModConfig.DEBUG_MODE)
+ TecTech.Logger.info("Struct-meta-id-error " + x + " " + y + " " + z + "/" + a + " " + c + "/" + aBaseMetaTileEntity.getMetaIDOffset(x, y, z) + " " + blockMeta[pointer]);
return false;
}
}
@@ -1209,7 +1228,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
@Override
public void onRemoval() {
try {
- if(eOutputHatches!=null) {
+ if (eOutputHatches != null) {
for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches)
hatch_elemental.id = -1;
for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches)
@@ -1219,20 +1238,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches)
hatch.getBaseMetaTileEntity().setActive(false);
}
- if(eDismatleBoom && mMaxProgresstime>0) explodeMultiblock();
- else if(outputEM!=null)
+ if (eDismatleBoom && mMaxProgresstime > 0) explodeMultiblock();
+ else if (outputEM != null)
for (cElementalInstanceStackTree output : outputEM)
if (output.hasStacks()) {
explodeMultiblock();
return;
}
- }catch (Exception e){
- if(TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
+ } catch (Exception e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
protected boolean isInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] requiredFluidInputs, ItemStack[] requiredInputs, FluidStack[] givenFluidInputs, ItemStack... givenInputs) {
- if(!GregTech_API.sPostloadFinished)return false;
+ if (!GregTech_API.sPostloadFinished) return false;
if (requiredFluidInputs.length > 0 && givenFluidInputs == null) return false;
int amt;
for (FluidStack tFluid : requiredFluidInputs)
@@ -1240,13 +1259,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
boolean temp = true;
amt = tFluid.amount;
for (FluidStack aFluid : givenFluidInputs)
- if (aFluid != null && aFluid.isFluidEqual(tFluid)){
- if (aDontCheckStackSizes ){
+ if (aFluid != null && aFluid.isFluidEqual(tFluid)) {
+ if (aDontCheckStackSizes) {
temp = false;
break;
}
amt -= aFluid.amount;
- if (amt<1){
+ if (amt < 1) {
temp = false;
break;
}
@@ -1307,14 +1326,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_Elemental extends GT_Meta
amt = tStack.stackSize;
for (ItemStack aStack : givenInputs) {
if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
- if (aDontCheckStackSizes){
+ if (aDontCheckStackSizes) {
aStack.stackSize -= amt;
break;
}
- if (aStack.stackSize < amt){
+ if (aStack.stackSize < amt) {
amt -= aStack.stackSize;
aStack.stackSize = 0;
- }else{
+ } else {
aStack.stackSize -= amt;
amt = 0;
break;
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java
index 3d5b96e459..2ea5a0288d 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_DynamoMulti.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java
@@ -1,5 +1,6 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.hatch;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -14,17 +15,17 @@ import static gregtech.api.enums.GT_Values.V;
/**
* Created by danie_000 on 16.12.2016.
*/
-public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch {
+public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch implements machineTT {
public final int Amperes;
public GT_MetaTileEntity_Hatch_DynamoMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) {
super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Extractor for Multiblocks");
- Amperes =aAmp;
+ Amperes = aAmp;
}
public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 0, aDescription, aTextures);
- Amperes =aAmp;
+ Amperes = aAmp;
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_EnergyMulti.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java
index c0c4f0602c..9405b888df 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_EnergyMulti.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java
@@ -1,5 +1,6 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.hatch;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -15,17 +16,17 @@ import static gregtech.api.enums.GT_Values.V;
/**
* Created by danie_000 on 16.12.2016.
*/
-public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch {
+public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch implements machineTT {
public final int Amperes;
public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) {
super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Injector for Multiblocks");
- Amperes =aAmp;
+ Amperes = aAmp;
}
- public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int aAmp,String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 0, aDescription, aTextures);
- Amperes =aAmp;
+ Amperes = aAmp;
}
@Override
@@ -85,7 +86,7 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch
@Override
public long maxAmperesIn() {
- return Amperes+(Amperes>>2);
+ return Amperes + (Amperes >> 2);
}
@Override
@@ -108,7 +109,7 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch
return new String[]{
commonValues.tecMark,
mDescription,
- "Amperes In: "+ EnumChatFormatting.AQUA+maxAmperesIn()+" A"
+ "Amperes In: " + EnumChatFormatting.AQUA + maxAmperesIn() + " A"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
index 8071f114e9..7d99da18af 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_InputElemental.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
@@ -1,15 +1,16 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.hatch;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import com.github.technus.tectech.things.metaTileEntity.GT_MetaTileEntity_Hatch_ElementalContainer;
/**
* Created by danie_000 on 27.10.2016.
*/
public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer {
public GT_MetaTileEntity_Hatch_InputElemental(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, "Elemental Input for Multiblocks (" + 1000 * aTier*(aTier-7) + "U, " + aTier * 2 + " stacks)");
+ super(aID, aName, aNameRegional, aTier, "Elemental Input for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)");
}
public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -23,7 +24,7 @@ public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Ha
@Override
public boolean isInputFacing(byte aSide) {
- return aSide==getBaseMetaTileEntity().getFrontFacing();
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_MufflerElemental.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java
index 81c00acb22..c0be04c717 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_MufflerElemental.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java
@@ -1,6 +1,7 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.hatch;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
@@ -24,26 +25,26 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Mult
/**
* Created by danie_000 on 12.12.2016.
*/
-public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_Hatch {
+public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_Hatch implements machineTT {
private static Textures.BlockIcons.CustomIcon EM_T_SIDES;
private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE;
private static Textures.BlockIcons.CustomIcon MufflerEM;
- public float overflowMatter=0f;
+ public float overflowMatter = 0f;
public final float overflowMax;
public final float overflowDisperse;
- public GT_MetaTileEntity_Hatch_MufflerElemental(int aID, String aName, String aNameRegional, int aTier,float max) {
+ public GT_MetaTileEntity_Hatch_MufflerElemental(int aID, String aName, String aNameRegional, int aTier, float max) {
super(aID, aName, aNameRegional, aTier, 0, "Disposes excess elemental Matter");
- overflowMatter=max/2;
- overflowMax=max;
- overflowDisperse =overflowMax/(float)(30-aTier);
+ overflowMatter = max / 2;
+ overflowMax = max;
+ overflowDisperse = overflowMax / (float) (30 - aTier);
}
- public GT_MetaTileEntity_Hatch_MufflerElemental(String aName, int aTier,float max, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_MufflerElemental(String aName, int aTier, float max, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 0, aDescription, aTextures);
- overflowMatter=max/2;
- overflowMax=max;
- overflowDisperse =overflowMax/(float)(30-aTier);
+ overflowMatter = max / 2;
+ overflowMax = max;
+ overflowDisperse = overflowMax / (float) (30 - aTier);
}
@Override
@@ -69,10 +70,10 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_
return new String[]{
commonValues.tecMark,
mDescription,
- "Mass capacity: "+EnumChatFormatting.AQUA+String.format(java.util.Locale.ENGLISH,"%+.2E",overflowMax)+" eV/c^2",
- "Disposal Speed: "+EnumChatFormatting.AQUA+String.format(java.util.Locale.ENGLISH,"%+.2E",overflowDisperse)+" (eV/c^2)/s",
+ "Mass capacity: " + EnumChatFormatting.AQUA + String.format(java.util.Locale.ENGLISH, "%+.2E", overflowMax) + " eV/c^2",
+ "Disposal Speed: " + EnumChatFormatting.AQUA + String.format(java.util.Locale.ENGLISH, "%+.2E", overflowDisperse) + " (eV/c^2)/s",
"DO NOT OBSTRUCT THE OUTPUT!"
- };
+ };
}
@Override
@@ -97,19 +98,19 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_MufflerElemental(mName, mTier,overflowMax, mDescription, mTextures);
+ return new GT_MetaTileEntity_Hatch_MufflerElemental(mName, mTier, overflowMax, mDescription, mTextures);
}
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setFloat("overflowMatter",overflowMatter);
+ aNBT.setFloat("overflowMatter", overflowMatter);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- overflowMatter=aNBT.getFloat("overflowMatter");
+ overflowMatter = aNBT.getFloat("overflowMatter");
}
@Override
@@ -124,24 +125,24 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(aBaseMetaTileEntity.isServerSide() && (aTick%20)==disperseAt){
- if(aBaseMetaTileEntity.isActive()){
- overflowMatter-= overflowDisperse;
- if(overflowMatter<0){
- overflowMatter=0;
+ if (aBaseMetaTileEntity.isServerSide() && (aTick % 20) == disperseAt) {
+ if (aBaseMetaTileEntity.isActive()) {
+ overflowMatter -= overflowDisperse;
+ if (overflowMatter < 0) {
+ overflowMatter = 0;
aBaseMetaTileEntity.setActive(false);
- aBaseMetaTileEntity.setLightValue((byte)0);
- aBaseMetaTileEntity.getWorld().updateLightByType(EnumSkyBlock.Block,aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ aBaseMetaTileEntity.setLightValue((byte) 0);
+ aBaseMetaTileEntity.getWorld().updateLightByType(EnumSkyBlock.Block, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord());
}
- }else{
- if(overflowMatter>0) {
+ } else {
+ if (overflowMatter > 0) {
aBaseMetaTileEntity.setActive(true);
- aBaseMetaTileEntity.setLightValue((byte)15);
- aBaseMetaTileEntity.getWorld().updateLightByType(EnumSkyBlock.Block,aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ aBaseMetaTileEntity.setLightValue((byte) 15);
+ aBaseMetaTileEntity.getWorld().updateLightByType(EnumSkyBlock.Block, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord());
}
}
- }else if(aBaseMetaTileEntity.isClientSide() && getBaseMetaTileEntity().isActive()){
- TecTech.proxy.particles(getBaseMetaTileEntity(),getBaseMetaTileEntity().getFrontFacing());
+ } else if (aBaseMetaTileEntity.isClientSide() && getBaseMetaTileEntity().isActive()) {
+ TecTech.proxy.particles(getBaseMetaTileEntity(), getBaseMetaTileEntity().getFrontFacing());
}
super.onPostTick(aBaseMetaTileEntity, aTick);
//DOES NOT CHECK FOR TOO MUCH, it is done only while putting stuff in (OPTIMIZATION!!!)
@@ -156,16 +157,17 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_
public String[] getInfoData() {
return new String[]{
"Contained mass:",
- EnumChatFormatting.RED+Double.toString(overflowMatter)+EnumChatFormatting.RESET+" eV/c^2 /",
- EnumChatFormatting.GREEN+Double.toString(overflowMax)+EnumChatFormatting.RESET+" eV/c^2",
- "Mass Disposal speed: "+EnumChatFormatting.BLUE+Double.toString(overflowDisperse)+EnumChatFormatting.RESET+" (eV/c^2)/s"
+ EnumChatFormatting.RED + Double.toString(overflowMatter) + EnumChatFormatting.RESET + " eV/c^2 /",
+ EnumChatFormatting.GREEN + Double.toString(overflowMax) + EnumChatFormatting.RESET + " eV/c^2",
+ "Mass Disposal speed: " + EnumChatFormatting.BLUE + Double.toString(overflowDisperse) + EnumChatFormatting.RESET + " (eV/c^2)/s"
};
}
@Override
public void onRemoval() {
- if(isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive())
- if(TecTech.ModConfig.BOOM_ENABLE)getBaseMetaTileEntity().doExplosion(V[15]);
- else TecTech.proxy.broadcast("Muffler BOOM! "+getBaseMetaTileEntity().getXCoord()+" "+getBaseMetaTileEntity().getYCoord()+" "+getBaseMetaTileEntity().getZCoord());
+ if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive())
+ if (TecTech.ModConfig.BOOM_ENABLE) getBaseMetaTileEntity().doExplosion(V[15]);
+ else
+ TecTech.proxy.broadcast("Muffler BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord());
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java
index b925022b73..2fde75c76a 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_OutputElemental.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.hatch;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -9,9 +9,9 @@ import gregtech.api.util.GT_Utility;
/**
* Created by danie_000 on 27.10.2016.
*/
-public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer{
+public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer {
public GT_MetaTileEntity_Hatch_OutputElemental(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, "Elemental Output for Multiblocks (" + 1000 * aTier*(aTier-7) + "U, " + aTier * 2 + " stacks)");
+ super(aID, aName, aNameRegional, aTier, "Elemental Output for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)");
}
public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -25,7 +25,7 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H
@Override
public boolean isOutputFacing(byte aSide) {
- return aSide==getBaseMetaTileEntity().getFrontFacing();
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
}
@Override
@@ -40,26 +40,26 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H
@Override
public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) {
- byte color=getBaseMetaTileEntity().getColorization();
- if(color<0)return;
+ byte color = getBaseMetaTileEntity().getColorization();
+ if (color < 0) return;
byte front = aBaseMetaTileEntity.getFrontFacing();
byte opposite = GT_Utility.getOppositeSide(getBaseMetaTileEntity().getFrontFacing());
for (byte dist = 1; dist < 16; dist++) {
IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist);
- if (tGTTileEntity != null && tGTTileEntity.getColorization()==color) {
+ if (tGTTileEntity != null && tGTTileEntity.getColorization() == color) {
IMetaTileEntity aMetaTileEntity = tGTTileEntity.getMetaTileEntity();
- if (aMetaTileEntity != null){
- if(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputElemental &&
- opposite == aMetaTileEntity.getBaseMetaTileEntity().getFrontFacing()) {
+ if (aMetaTileEntity != null) {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputElemental &&
+ opposite == aMetaTileEntity.getBaseMetaTileEntity().getFrontFacing()) {
((GT_MetaTileEntity_Hatch_InputElemental) aMetaTileEntity).getContainerHandler().putUnifyAll(content);
((GT_MetaTileEntity_Hatch_InputElemental) aMetaTileEntity).updateSlots();
content.clear();
return;
- }else if(aMetaTileEntity instanceof GT_MetaTileEntity_EMpipe){
- if (((GT_MetaTileEntity_EMpipe) aMetaTileEntity).connectionCount>2) return;
- }else return;
- }else return;
- }else return;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_EM) {
+ if (((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).connectionCount > 2) return;
+ } else return;
+ } else return;
+ } else return;
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
index daca46c37b..9d24109e04 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Hatch_Param.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
@@ -1,8 +1,9 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.hatch;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.elementalMatter.commonValues;
-import com.github.technus.tectech.elementalMatter.gui.GT_Container_Param;
-import com.github.technus.tectech.elementalMatter.gui.GT_GUIContainer_Param;
+import com.github.technus.tectech.things.metaTileEntity.hatch.gui.GT_Container_Param;
+import com.github.technus.tectech.things.metaTileEntity.hatch.gui.GT_GUIContainer_Param;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -20,15 +21,15 @@ import net.minecraftforge.fluids.FluidStack;
/**
* Created by danie_000 on 15.12.2016.
*/
-public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
+public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch implements machineTT {
public int exponent = 0;
public int value2 = 0;
public int value1 = 0;
public int param = -1;
- public float value1f=0;
- public float value2f=0;
- public float input1f=0;
- public float input2f=0;
+ public float value1f = 0;
+ public float value2f = 0;
+ public float input1f = 0;
+ public float input2f = 0;
private static Textures.BlockIcons.CustomIcon ScreenON;
private static Textures.BlockIcons.CustomIcon ScreenOFF;
@@ -104,7 +105,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
@Override
public boolean isSimpleMachine() {
- return true;
+ return true;
}
@Override
@@ -133,8 +134,8 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
value2 = aNBT.getInteger("mV2");
value1 = aNBT.getInteger("mV1");
param = aNBT.getInteger("mParam");
- value1f=(float)(value1 * Math.pow(2, exponent));
- value2f=(float)(value2 * Math.pow(2, exponent));
+ value1f = (float) (value1 * Math.pow(2, exponent));
+ value2f = (float) (value2 * Math.pow(2, exponent));
//input1f=aNBT.getFloat("mI1");
//input2f=aNBT.getFloat("mI2");
}
@@ -176,7 +177,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch {
return new String[]{
commonValues.tecMark,
mDescription,
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"E=M*C^2"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "E=M*C^2"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java
new file mode 100644
index 0000000000..b2ff50ed37
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java
@@ -0,0 +1,297 @@
+package com.github.technus.tectech.things.metaTileEntity.hatch;
+
+import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.things.machineTT;
+import com.github.technus.tectech.elementalMatter.commonValues;
+import com.github.technus.tectech.things.metaTileEntity.hatch.gui.GT_Container_Uncertainty;
+import com.github.technus.tectech.things.metaTileEntity.hatch.gui.GT_GUIContainer_Uncertainty;
+import com.github.technus.tectech.things.metaTileEntity.hatch.gui.GT_GUIContainer_UncertaintyAdv;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.objects.GT_RenderedTexture;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.fluids.FluidStack;
+
+/**
+ * Created by danie_000 on 15.12.2016.
+ */
+public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch implements machineTT {
+ private static Textures.BlockIcons.CustomIcon ScreenON;
+ private static Textures.BlockIcons.CustomIcon ScreenOFF;
+ private static float errorMargin = 0.05f;
+ public short[] matrix = new short[]{500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500};
+ public byte selection = -1, mode = 0, status = -128;
+
+ public GT_MetaTileEntity_Hatch_Uncertainty(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 0, "Feeling certain, or not?");
+ regenerate();
+ }
+
+ public GT_MetaTileEntity_Hatch_Uncertainty(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 0, aDescription, aTextures);
+ regenerate();
+ }
+
+ @Override
+ public void registerIcons(IIconRegister aBlockIconRegister) {
+ super.registerIcons(aBlockIconRegister);
+ ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/UC");
+ ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/UC_ACTIVE");
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Uncertainty(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ if (mTier > 6) return new GT_GUIContainer_UncertaintyAdv(aPlayerInventory, aBaseMetaTileEntity);
+ return new GT_GUIContainer_Uncertainty(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenON)};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenOFF)};
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && (aTick & 15) == 0) {
+ shift();
+ compute();
+ if (mode == 0) aBaseMetaTileEntity.setActive(false);
+ else aBaseMetaTileEntity.setActive(true);
+ }
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new GT_MetaTileEntity_Hatch_Uncertainty(mName, mTier, mDescription, mTextures);
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{
+ "Status: " + EnumChatFormatting.GOLD + status
+ };
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setByte("mSel", selection);
+ aNBT.setByte("mMode", mode);
+ aNBT.setByte("mStatus", status);
+ NBTTagCompound mat = new NBTTagCompound();
+ for (int i = 0; i < 16; i++)
+ mat.setShort(Integer.toString(i), matrix[i]);
+ aNBT.setTag("mMat", mat);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ selection = aNBT.getByte("mSel");
+ mode = aNBT.getByte("mMode");
+ status = aNBT.getByte("mStatus");
+ NBTTagCompound mat = aNBT.getCompoundTag("mMat");
+ for (int i = 0; i < 16; i++)
+ matrix[i] = mat.getShort(Integer.toString(i));
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return false;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ commonValues.tecMark,
+ mDescription,
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Schrödinger equation in a box"
+ };
+ }
+
+ private float massOffset(int sideLenY, int sideLenX, short... masses) {
+ int mass = 0;
+ int massI = 0, massJ = 0;
+ for (int i = 0; i < sideLenY; i++) {
+ for (int j = 0; j < sideLenY * sideLenX; j += sideLenY) {
+ mass += masses[i + j];
+ massI += ((float) i - ((float) sideLenY / 2f) + .5f) * masses[i + j];
+ massJ += ((float) (j / sideLenY) - ((float) sideLenX / 2f) + .5f) * masses[i + j];
+ }
+ }
+ return ((Math.abs(massI / (float) mass) / (float) sideLenY) + (Math.abs(massJ / (float) mass)) / (float) sideLenX);
+ }
+
+ public void regenerate() {
+ for (int i = 0; i < matrix.length; i++)
+ matrix[i] = (short) TecTech.Rnd.nextInt(1000);
+ }
+
+ public byte compute() {
+ int result = 0;
+ switch (mode) {
+ case 1://ooo oxo ooo
+ result = (massOffset(4, 4, matrix) < errorMargin) ? 0 : 1;
+ break;
+ case 2://ooo xox ooo
+ result += (massOffset(4, 2,
+ matrix[0], matrix[4],
+ matrix[1], matrix[5],
+ matrix[2], matrix[6],
+ matrix[3], matrix[7]) < errorMargin) ? 0 : 1;
+ result += (massOffset(4, 2,
+ matrix[8], matrix[12],
+ matrix[9], matrix[13],
+ matrix[10], matrix[14],
+ matrix[11], matrix[15]) < errorMargin) ? 0 : 2;
+ break;
+ case 3://oxo xox oxo
+ result += (massOffset(2, 4,
+ matrix[0], matrix[4], matrix[8], matrix[12],
+ matrix[1], matrix[5], matrix[9], matrix[13]) < errorMargin) ? 0 : 1;
+ result += (massOffset(4, 2,
+ matrix[0], matrix[4],
+ matrix[1], matrix[5],
+ matrix[2], matrix[6],
+ matrix[3], matrix[7]) < errorMargin) ? 0 : 2;
+ result += (massOffset(4, 2,
+ matrix[8], matrix[12],
+ matrix[9], matrix[13],
+ matrix[10], matrix[14],
+ matrix[11], matrix[15]) < errorMargin) ? 0 : 4;
+ result += (massOffset(2, 4,
+ matrix[2], matrix[6], matrix[10], matrix[14],
+ matrix[3], matrix[7], matrix[11], matrix[15]) < errorMargin) ? 0 : 8;
+ break;
+ case 4://xox ooo xox
+ result += (massOffset(2, 2,
+ matrix[0], matrix[4],
+ matrix[1], matrix[5]) < errorMargin) ? 0 : 1;
+ result += (massOffset(2, 2,
+ matrix[8], matrix[12],
+ matrix[9], matrix[13]) < errorMargin) ? 0 : 2;
+ result += (massOffset(2, 2,
+ matrix[2], matrix[6],
+ matrix[3], matrix[7]) < errorMargin) ? 0 : 4;
+ result += (massOffset(2, 2,
+ matrix[10], matrix[14],
+ matrix[11], matrix[15]) < errorMargin) ? 0 : 8;
+ break;
+ case 5://xox oxo xox
+ result += (massOffset(2, 2,
+ matrix[0], matrix[4],
+ matrix[1], matrix[5]) < errorMargin) ? 0 : 1;
+ result += (massOffset(2, 2,
+ matrix[8], matrix[12],
+ matrix[9], matrix[13]) < errorMargin) ? 0 : 2;
+ result += (massOffset(4, 4, matrix) < errorMargin) ? 0 : 4;
+ result += (massOffset(2, 2,
+ matrix[2], matrix[6],
+ matrix[3], matrix[7]) < errorMargin) ? 0 : 8;
+ result += (massOffset(2, 2,
+ matrix[10], matrix[14],
+ matrix[11], matrix[15]) < errorMargin) ? 0 : 16;
+ break;
+ }
+ return status = (byte) result;
+ }
+
+ private void shift() {//TODO MAKE IT MORE EVIL
+ final int i = TecTech.Rnd.nextInt(16), j = TecTech.Rnd.nextInt(2);
+ matrix[i] += (((matrix[i] & 1) == 0) ? 2 : -2) * j;
+ switch (matrix[i]) {
+ case 1002:
+ matrix[i] -= 3;
+ break;
+ case 1001:
+ matrix[i] -= 1;
+ break;
+ case -1:
+ matrix[i] += 1;
+ break;
+ case -2:
+ matrix[i] += 3;
+ break;
+ }
+ }
+
+ public byte update(int newMode) {
+ if (newMode == mode) return mode;
+ if (newMode < 0 || newMode > 5) newMode = 0;
+ mode = (byte) newMode;
+ regenerate();
+ compute();
+ return status;
+ }
+
+ //@Override
+ //public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ // if(aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
+ // changeMode(++mode);
+ // GT_Utility.sendChatToPlayer(aPlayer, "Equation mode: "+mode);
+ // }
+ //}
+}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_Container_Param.java
index 29b37587f1..a5d22870a6 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_Param.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_Container_Param.java
@@ -1,6 +1,6 @@
-package com.github.technus.tectech.elementalMatter.gui;
+package com.github.technus.tectech.things.metaTileEntity.hatch.gui;
-import com.github.technus.tectech.elementalMatter.machine.GT_MetaTileEntity_Hatch_Param;
+import com.github.technus.tectech.things.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -21,8 +21,11 @@ public final class GT_Container_Param extends GT_ContainerMetaTile_Machine {
public int param = 0;
public float value2f = 0;
public float value1f = 0;
- public float input1f=0; private int input1Bits=0;
- public float input2f=0; private int input2Bits=0;
+ public float input1f = 0;
+ private int input1Bits = 0;
+ public float input2f = 0;
+ private int input2Bits = 0;
+
public GT_Container_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
@@ -56,9 +59,9 @@ public final class GT_Container_Param extends GT_ContainerMetaTile_Machine {
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
- boolean doStuff=true;
+ boolean doStuff = true;
if ((tSlot != null) && (this.mTileEntity.getMetaTileEntity() != null)) {
- GT_MetaTileEntity_Hatch_Param paramH=(GT_MetaTileEntity_Hatch_Param)this.mTileEntity.getMetaTileEntity();
+ GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity();
switch (aSlotIndex) {
case 0:
paramH.param -= (aShifthold == 1 ? 512 : 64);
@@ -109,13 +112,13 @@ public final class GT_Container_Param extends GT_ContainerMetaTile_Machine {
paramH.exponent += (aShifthold == 1 ? 4 : 1);
break;
default:
- doStuff=false;
+ doStuff = false;
}
- if(doStuff) {
- if(paramH.param> 9) paramH.param= 9;
- if(paramH.param<-1) paramH.param=-1;
- paramH.value1f = (float)(paramH.value1 * Math.pow(2, paramH.exponent));
- paramH.value2f = (float)(paramH.value2 * Math.pow(2, paramH.exponent));
+ if (doStuff) {
+ if (paramH.param > 9) paramH.param = 9;
+ if (paramH.param < -1) paramH.param = -1;
+ paramH.value1f = (float) (paramH.value1 * Math.pow(2, paramH.exponent));
+ paramH.value2f = (float) (paramH.value2 * Math.pow(2, paramH.exponent));
}
}
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
@@ -131,18 +134,18 @@ public final class GT_Container_Param extends GT_ContainerMetaTile_Machine {
this.value1 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).value1;
this.value2 = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).value2;
this.exponent = ((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).exponent;
- this.input1Bits= Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input1f);
- this.input2Bits= Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input2f);
+ this.input1Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input1f);
+ this.input2Bits = Float.floatToIntBits(((GT_MetaTileEntity_Hatch_Param) this.mTileEntity.getMetaTileEntity()).input2f);
Iterator var2 = this.crafters.iterator();
while (var2.hasNext()) {
ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.param & 0xFFFF);
- var1.sendProgressBarUpdate(this, 101, this.param >>> 16);
- var1.sendProgressBarUpdate(this, 102, this.value1 & 0xFFFF);
- var1.sendProgressBarUpdate(this, 103, this.value1 >>> 16);
- var1.sendProgressBarUpdate(this, 104, this.value2 & 0xFFFF);
- var1.sendProgressBarUpdate(this, 105, this.value2 >>> 16);
+ var1.sendProgressBarUpdate(this, 100, this.param & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 101, this.param >>> 16);
+ var1.sendProgressBarUpdate(this, 102, this.value1 & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 103, this.value1 >>> 16);
+ var1.sendProgressBarUpdate(this, 104, this.value2 & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 105, this.value2 >>> 16);
var1.sendProgressBarUpdate(this, 106, this.exponent & 0xFFFF);
var1.sendProgressBarUpdate(this, 107, this.exponent >>> 16);
var1.sendProgressBarUpdate(this, 108, this.input1Bits & 0xFFFF);
@@ -182,24 +185,24 @@ public final class GT_Container_Param extends GT_ContainerMetaTile_Machine {
break;
case 108:
this.input1Bits = (this.input1Bits & 0xFFFF0000 | par2);
- this.input1f=Float.intBitsToFloat(input1Bits);
+ this.input1f = Float.intBitsToFloat(input1Bits);
return;
case 109:
this.input1Bits = (this.input1Bits & 0xFFFF | par2 << 16);
- this.input1f=Float.intBitsToFloat(input1Bits);
+ this.input1f = Float.intBitsToFloat(input1Bits);
return;
case 110:
this.input2Bits = (this.input2Bits & 0xFFFF0000 | par2);
- this.input2f=Float.intBitsToFloat(input2Bits);
+ this.input2f = Float.intBitsToFloat(input2Bits);
return;
case 111:
this.input2Bits = (this.input2Bits & 0xFFFF | par2 << 16);
- this.input2f=Float.intBitsToFloat(input2Bits);
+ this.input2f = Float.intBitsToFloat(input2Bits);
return;
default:
return;
}
- this.value1f = (float)(this.value1 * Math.pow(2, this.exponent));
- this.value2f = (float)(this.value2 * Math.pow(2, this.exponent));
+ this.value1f = (float) (this.value1 * Math.pow(2, this.exponent));
+ this.value2f = (float) (this.value2 * Math.pow(2, this.exponent));
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_Uncertainty.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java
index 7d1c4e60cb..fc940d168e 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_Uncertainty.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java
@@ -1,6 +1,6 @@
-package com.github.technus.tectech.elementalMatter.gui;
+package com.github.technus.tectech.things.metaTileEntity.hatch.gui;
-import com.github.technus.tectech.elementalMatter.machine.GT_MetaTileEntity_Hatch_Uncertainty;
+import com.github.technus.tectech.things.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Uncertainty;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -15,8 +15,8 @@ import net.minecraft.item.ItemStack;
import java.util.Iterator;
public final class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine {
- public short[] matrix=new short[]{500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500};
- public byte selection=-1,mode=0,status=-128;
+ public short[] matrix = new short[]{500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500};
+ public byte selection = -1, mode = 0, status = -128;
public GT_Container_Uncertainty(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
@@ -52,15 +52,15 @@ public final class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine
}
Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
if ((tSlot != null) && (this.mTileEntity.getMetaTileEntity() != null)) {
- GT_MetaTileEntity_Hatch_Uncertainty catH=(GT_MetaTileEntity_Hatch_Uncertainty)this.mTileEntity.getMetaTileEntity();
- if(aSlotIndex<16 && catH.matrix!=null) {
+ GT_MetaTileEntity_Hatch_Uncertainty catH = (GT_MetaTileEntity_Hatch_Uncertainty) this.mTileEntity.getMetaTileEntity();
+ if (aSlotIndex < 16 && catH.matrix != null) {
if (catH.selection == -1) {
catH.selection = (byte) (aSlotIndex);
} else {
- short temp=catH.matrix[catH.selection];
- catH.matrix[catH.selection]=catH.matrix[aSlotIndex];
- catH.matrix[aSlotIndex]=temp;
- catH.selection= -1;
+ short temp = catH.matrix[catH.selection];
+ catH.matrix[catH.selection] = catH.matrix[aSlotIndex];
+ catH.matrix[aSlotIndex] = temp;
+ catH.selection = -1;
}
}
@@ -112,8 +112,8 @@ public final class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine
this.status = (byte) par2;
break;
default:
- if(matrix!=null && par1>=103 && par1<119) {
- this.matrix[par1-103]=(short) par2;
+ if (matrix != null && par1 >= 103 && par1 < 119) {
+ this.matrix[par1 - 103] = (short) par2;
break;
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
index 988088cb83..4564266040 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_Param.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.gui;
+package com.github.technus.tectech.things.metaTileEntity.hatch.gui;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -14,16 +14,16 @@ public final class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
if (this.mContainer != null) {
- proxy.renderUnicodeString("Parametrizer: " + ((GT_Container_Param) this.mContainer).param, 46, 7,167, 0xffffff);
- proxy.renderUnicodeString("\u2460\u2b07" + String.format(java.util.Locale.ENGLISH,"%+.5E",((GT_Container_Param) this.mContainer).input1f), 46, 16,167, 0x22ddff);
- proxy.renderUnicodeString("\u2461\u2b07" + String.format(java.util.Locale.ENGLISH,"%+.5E",((GT_Container_Param) this.mContainer).input2f), 46, 24,167, 0x00ffff);
- proxy.renderUnicodeString("\u2460\u2b06" + String.format(java.util.Locale.ENGLISH,"%+.5E",((GT_Container_Param) this.mContainer).value1f), 46, 33,167, 0x00bbff);
- proxy.renderUnicodeString("\u2461\u2b06" + String.format(java.util.Locale.ENGLISH,"%+.5E",((GT_Container_Param) this.mContainer).value2f), 46, 41,167, 0x0077ff);
- proxy.renderUnicodeString("M\u2460: " + ((GT_Container_Param) this.mContainer).value1, 46, 50,167,0x00bbff);
- proxy.renderUnicodeString("M\u2461: " + ((GT_Container_Param) this.mContainer).value2, 46, 58,167,0x0077ff);
- proxy.renderUnicodeString("E\u2460\u2461: " + ((GT_Container_Param) this.mContainer).exponent, 46, 66,167,0x0033ff);
- }else{
- proxy.renderUnicodeString("Parametrizer", 46, 7,167, 0xffffff);
+ proxy.renderUnicodeString("Parametrizer: " + ((GT_Container_Param) this.mContainer).param, 46, 7, 167, 0xffffff);
+ proxy.renderUnicodeString("\u2460\u2b07" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input1f), 46, 16, 167, 0x22ddff);
+ proxy.renderUnicodeString("\u2461\u2b07" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).input2f), 46, 24, 167, 0x00ffff);
+ proxy.renderUnicodeString("\u2460\u2b06" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value1f), 46, 33, 167, 0x00bbff);
+ proxy.renderUnicodeString("\u2461\u2b06" + String.format(java.util.Locale.ENGLISH, "%+.5E", ((GT_Container_Param) this.mContainer).value2f), 46, 41, 167, 0x0077ff);
+ proxy.renderUnicodeString("M\u2460: " + ((GT_Container_Param) this.mContainer).value1, 46, 50, 167, 0x00bbff);
+ proxy.renderUnicodeString("M\u2461: " + ((GT_Container_Param) this.mContainer).value2, 46, 58, 167, 0x0077ff);
+ proxy.renderUnicodeString("E\u2460\u2461: " + ((GT_Container_Param) this.mContainer).exponent, 46, 66, 167, 0x0033ff);
+ } else {
+ proxy.renderUnicodeString("Parametrizer", 46, 7, 167, 0xffffff);
}
//167
}
diff --git a/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java
new file mode 100644
index 0000000000..834ba9c6da
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java
@@ -0,0 +1,109 @@
+package com.github.technus.tectech.things.metaTileEntity.hatch.gui;
+
+import com.github.technus.tectech.TecTech;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import org.lwjgl.opengl.GL11;
+
+import static com.github.technus.tectech.TecTech.proxy;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+public class GT_GUIContainer_Uncertainty extends GT_GUIContainerMetaTile_Machine {
+ public GT_GUIContainer_Uncertainty(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(new GT_Container_Uncertainty(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Uncertainty.png");
+ }
+
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ proxy.renderUnicodeString("Schrödinger", 46, 7, 167, 0xffffff);
+ if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).status == 0)
+ proxy.renderUnicodeString("Status: OK", 46, 16, 167, 0xffffff);
+ else
+ proxy.renderUnicodeString("Status: NG", 46, 16, 167, 0xffffff);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).matrix != null) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ final short bU = 0, rU = 70, fU = 192, V = 210, Vs = 216;
+ x += 52;
+ y += 33;
+ final int state = ((GT_Container_Uncertainty) this.mContainer).status;
+ switch (((GT_Container_Uncertainty) this.mContainer).mode) {
+ case 1://ooo oxo ooo
+ drawTexturedModalRect(x + 12, y + 12,
+ rU + (state == 0 ? 76 : 12),
+ Vs + 12, 10, 10);
+ break;
+ case 2://ooo xox ooo
+ drawTexturedModalRect(x, y + 12,
+ rU + ((state & 1) == 0 ? 64 : 0),
+ Vs + 12, 10, 10);
+ drawTexturedModalRect(x + 24, y + 12,
+ rU + ((state & 2) == 0 ? 88 : 24),
+ Vs + 12, 10, 10);
+ break;
+ case 3://oxo xox oxo
+ drawTexturedModalRect(x + 12, y,
+ rU + ((state & 1) == 0 ? 76 : 12),
+ Vs, 10, 10);
+ drawTexturedModalRect(x, y + 12,
+ rU + ((state & 2) == 0 ? 64 : 0),
+ Vs + 12, 10, 10);
+ drawTexturedModalRect(x + 24, y + 12,
+ rU + ((state & 4) == 0 ? 88 : 24),
+ Vs + 12, 10, 10);
+ drawTexturedModalRect(x + 12, y + 24,
+ rU + ((state & 8) == 0 ? 76 : 12),
+ Vs + 24, 10, 10);
+ break;
+ case 4://xox ooo xox
+ drawTexturedModalRect(x, y,
+ rU + ((state & 1) == 0 ? 64 : 0),
+ Vs, 10, 10);
+ drawTexturedModalRect(x + 24, y,
+ rU + ((state & 2) == 0 ? 88 : 24),
+ Vs, 10, 10);
+ drawTexturedModalRect(x, y + 24,
+ rU + ((state & 4) == 0 ? 64 : 0),
+ Vs + 24, 10, 10);
+ drawTexturedModalRect(x + 24, y + 24,
+ rU + ((state & 8) == 0 ? 88 : 24),
+ Vs + 24, 10, 10);
+ break;
+ case 5://xox ooo xox
+ drawTexturedModalRect(x, y,
+ rU + ((state & 1) == 0 ? 64 : 0),
+ Vs, 10, 10);
+ drawTexturedModalRect(x + 24, y,
+ rU + ((state & 2) == 0 ? 88 : 24),
+ Vs, 10, 10);
+ drawTexturedModalRect(x + 12, y + 12,
+ rU + ((state & 4) == 0 ? 76 : 12),
+ Vs + 12, 10, 10);
+ drawTexturedModalRect(x, y + 24,
+ rU + ((state & 8) == 0 ? 64 : 0),
+ Vs + 24, 10, 10);
+ drawTexturedModalRect(x + 24, y + 24,
+ rU + ((state & 16) == 0 ? 88 : 24),
+ Vs + 24, 10, 10);
+ break;
+ }
+ x -= 6;
+ y -= 6;
+ for (int i = 0; i < 16; i++)
+ if (TecTech.Rnd.nextInt(1000) < ((GT_Container_Uncertainty) this.mContainer).matrix[i])
+ drawTexturedModalRect(x + 12 * (i / 4), y + 12 * (i % 4),
+ fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10);
+ if (((GT_Container_Uncertainty) this.mContainer).selection > -1) {
+ int sel = ((GT_Container_Uncertainty) this.mContainer).selection;
+ drawTexturedModalRect(x + 12 * (sel / 4), y + 12 * (sel % 4),
+ bU + 12 * (sel / 4), V + 12 * (sel % 4), 10, 10);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_UncertaintyAdv.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java
index 13ebf2e198..241630ddd4 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_UncertaintyAdv.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.gui;
+package com.github.technus.tectech.things.metaTileEntity.hatch.gui;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,18 +10,18 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import static org.lwjgl.opengl.GL11.*;
public final class GT_GUIContainer_UncertaintyAdv extends GT_GUIContainerMetaTile_Machine {
- protected static final short sX=52,sY=33,bU=0,rU=70,fU=192,V=210,Vs=216;
+ protected static final short sX = 52, sY = 33, bU = 0, rU = 70, fU = 192, V = 210, Vs = 216;
public GT_GUIContainer_UncertaintyAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(new GT_Container_Uncertainty(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Uncertainty.png");
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- proxy.renderUnicodeString("Schrödinger X", 46, 7,167, 0xffffff);
- if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).status==0)
- proxy.renderUnicodeString("Status: OK", 46, 16,167, 0xffffff);
+ proxy.renderUnicodeString("Schrödinger X", 46, 7, 167, 0xffffff);
+ if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).status == 0)
+ proxy.renderUnicodeString("Status: OK", 46, 16, 167, 0xffffff);
else
- proxy.renderUnicodeString("Status: NG", 46, 16,167, 0xffffff);
+ proxy.renderUnicodeString("Status: NG", 46, 16, 167, 0xffffff);
}
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
@@ -29,86 +29,88 @@ public final class GT_GUIContainer_UncertaintyAdv extends GT_GUIContainerMetaTil
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).matrix!=null) {
+ if (this.mContainer != null && ((GT_Container_Uncertainty) this.mContainer).matrix != null) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- x+=sX; y+=sY;
- final int state=((GT_Container_Uncertainty) this.mContainer).status;
- switch(((GT_Container_Uncertainty) this.mContainer).mode){
+ x += sX;
+ y += sY;
+ final int state = ((GT_Container_Uncertainty) this.mContainer).status;
+ switch (((GT_Container_Uncertainty) this.mContainer).mode) {
case 1://ooo oxo ooo
drawTexturedModalRect(x + 12, y + 12,
- rU + (state==0?76:12),
+ rU + (state == 0 ? 76 : 12),
Vs + 12, 10, 10);
break;
case 2://ooo xox ooo
drawTexturedModalRect(x, y + 12,
- rU + ((state&1)==0?64:0),
+ rU + ((state & 1) == 0 ? 64 : 0),
Vs + 12, 10, 10);
- drawTexturedModalRect(x+24, y + 12,
- rU + ((state&2)==0?88:24),
+ drawTexturedModalRect(x + 24, y + 12,
+ rU + ((state & 2) == 0 ? 88 : 24),
Vs + 12, 10, 10);
break;
case 3://oxo xox oxo
- drawTexturedModalRect(x+12, y,
- rU + ((state&1)==0?76:12),
+ drawTexturedModalRect(x + 12, y,
+ rU + ((state & 1) == 0 ? 76 : 12),
Vs, 10, 10);
drawTexturedModalRect(x, y + 12,
- rU + ((state&2)==0?64:0),
+ rU + ((state & 2) == 0 ? 64 : 0),
Vs + 12, 10, 10);
- drawTexturedModalRect(x+24, y + 12,
- rU + ((state&4)==0?88:24),
+ drawTexturedModalRect(x + 24, y + 12,
+ rU + ((state & 4) == 0 ? 88 : 24),
Vs + 12, 10, 10);
- drawTexturedModalRect(x+12, y + 24,
- rU + ((state&8)==0?76:12),
+ drawTexturedModalRect(x + 12, y + 24,
+ rU + ((state & 8) == 0 ? 76 : 12),
Vs + 24, 10, 10);
break;
case 4://xox ooo xox
drawTexturedModalRect(x, y,
- rU + ((state&1)==0?64:0),
+ rU + ((state & 1) == 0 ? 64 : 0),
Vs, 10, 10);
- drawTexturedModalRect(x+24, y,
- rU + ((state&2)==0?88:24),
+ drawTexturedModalRect(x + 24, y,
+ rU + ((state & 2) == 0 ? 88 : 24),
Vs, 10, 10);
- drawTexturedModalRect(x, y+24,
- rU + ((state&4)==0?64:0),
- Vs+24, 10, 10);
- drawTexturedModalRect(x+24, y + 24,
- rU + ((state&8)==0?88:24),
+ drawTexturedModalRect(x, y + 24,
+ rU + ((state & 4) == 0 ? 64 : 0),
+ Vs + 24, 10, 10);
+ drawTexturedModalRect(x + 24, y + 24,
+ rU + ((state & 8) == 0 ? 88 : 24),
Vs + 24, 10, 10);
break;
case 5://xox ooo xox
drawTexturedModalRect(x, y,
- rU + ((state&1)==0?64:0),
+ rU + ((state & 1) == 0 ? 64 : 0),
Vs, 10, 10);
- drawTexturedModalRect(x+24, y,
- rU + ((state&2)==0?88:24),
+ drawTexturedModalRect(x + 24, y,
+ rU + ((state & 2) == 0 ? 88 : 24),
Vs, 10, 10);
drawTexturedModalRect(x + 12, y + 12,
- rU + ((state&4)==0?76:12),
+ rU + ((state & 4) == 0 ? 76 : 12),
Vs + 12, 10, 10);
- drawTexturedModalRect(x, y+24,
- rU + ((state&8)==0?64:0),
- Vs+24, 10, 10);
- drawTexturedModalRect(x+24, y + 24,
- rU + ((state&16)==0?88:24),
+ drawTexturedModalRect(x, y + 24,
+ rU + ((state & 8) == 0 ? 64 : 0),
+ Vs + 24, 10, 10);
+ drawTexturedModalRect(x + 24, y + 24,
+ rU + ((state & 16) == 0 ? 88 : 24),
Vs + 24, 10, 10);
break;
}
- x-=6;y-=6;
+ x -= 6;
+ y -= 6;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- for(int i=0;i<16;i++){
- GL11.glColor4f(1f,1f,1f,(float)((GT_Container_Uncertainty) this.mContainer).matrix[i]/1000f);
+ for (int i = 0; i < 16; i++) {
+ GL11.glColor4f(1f, 1f, 1f, (float) ((GT_Container_Uncertainty) this.mContainer).matrix[i] / 1000f);
drawTexturedModalRect(x + 12 * (i / 4), y + 12 * (i % 4),
fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10);
}
glDisable(GL_BLEND);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- if(((GT_Container_Uncertainty) this.mContainer).selection>-1) {
- int sel=((GT_Container_Uncertainty) this.mContainer).selection;
- drawTexturedModalRect(x + 12*(sel/4), y + 12*(sel%4),
- bU + 12*(sel/4), V + 12*(sel%4), 10, 10);
+ if (((GT_Container_Uncertainty) this.mContainer).selection > -1) {
+ int sel = ((GT_Container_Uncertainty) this.mContainer).selection;
+ drawTexturedModalRect(x + 12 * (sel / 4), y + 12 * (sel % 4),
+ bU + 12 * (sel / 4), V + 12 * (sel % 4), 10, 10);
}
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMbhg.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java
index 0b4543e371..e9742363f1 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMbhg.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java
@@ -1,7 +1,7 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
-import com.github.technus.tectech.blocks.QuantumGlass;
-import com.github.technus.tectech.casing.GT_Container_CasingsTT;
+import com.github.technus.tectech.things.block.QuantumGlass;
+import com.github.technus.tectech.things.casing.GT_Container_CasingsTT;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -18,49 +18,49 @@ import static gregtech.api.enums.GT_Values.E;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMbhg extends GT_MetaTileEntity_MultiblockBase_Elemental {
+public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_EM {
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
//Time dillatation - to slow down the explosion thing but REALLY REDUCE POWER OUTPUT
//Startcodes to startup
//per dim disable thingies
- private static final String[] s =new String[]{
- "f202","f020","g0","c5g5","d55c55","f0a0","e21212",
- "d00c00","c0g0","b0i0","a20i02","a02i20","d0024200",
- "c022c220","b02g20","02k20","a03i30","21k12"
+ private static final String[] s = new String[]{
+ "f202", "f020", "g0", "c5g5", "d55c55", "f0a0", "e21212",
+ "d00c00", "c0g0", "b0i0", "a20i02", "a02i20", "d0024200",
+ "c022c220", "b02g20", "02k20", "a03i30", "21k12"
};
- private static final String[][] S =new String[][]{
- {E,E,E,E,E,E,s[0],s[5],s[0]},//front
- {E,E,E,E,s[2],s[0],s[6],"d0033300",s[6],s[0],s[2]},
- {E,E,E,s[2],s[1],s[1],s[7],"c033c330",s[7],s[1],s[1],s[2]},
- {E,E,s[2],s[1],s[4],s[4],s[8],"b03g30",s[8],s[4],s[4],s[1],s[2]},
- {E,s[2],s[1],s[4],s[3],s[3],s[9],s[16],s[9],s[3],s[3],s[4],s[1],s[2]},
- {E,s[0],s[1],s[4],s[3],s[3],s[10],s[16],s[10],s[3],s[3],s[4],s[1],s[0]},
- {s[0],s[6],s[7],s[8],s[9],s[10],s[17],"03k30",s[17],s[10],s[9],s[8],s[7],s[6],s[0]},
- {s[5],s[12],s[13],s[14],s[11],s[11],s[15],"a3k3",s[15],s[11],s[11],s[14],s[13],s[12],s[5]}
+ private static final String[][] S = new String[][]{
+ {E, E, E, E, E, E, s[0], s[5], s[0]},//front
+ {E, E, E, E, s[2], s[0], s[6], "d0033300", s[6], s[0], s[2]},
+ {E, E, E, s[2], s[1], s[1], s[7], "c033c330", s[7], s[1], s[1], s[2]},
+ {E, E, s[2], s[1], s[4], s[4], s[8], "b03g30", s[8], s[4], s[4], s[1], s[2]},
+ {E, s[2], s[1], s[4], s[3], s[3], s[9], s[16], s[9], s[3], s[3], s[4], s[1], s[2]},
+ {E, s[0], s[1], s[4], s[3], s[3], s[10], s[16], s[10], s[3], s[3], s[4], s[1], s[0]},
+ {s[0], s[6], s[7], s[8], s[9], s[10], s[17], "03k30", s[17], s[10], s[9], s[8], s[7], s[6], s[0]},
+ {s[5], s[12], s[13], s[14], s[11], s[11], s[15], "a3k3", s[15], s[11], s[11], s[14], s[13], s[12], s[5]}
};
- private static final String[][] shape=new String[][]{
- S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[6],S[5],S[4],S[3],S[2],S[1],S[0]
+ private static final String[][] shape = new String[][]{
+ S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[6], S[5], S[4], S[3], S[2], S[1], S[0]
};
- private static final Block[] blockType=new Block[]{
+ private static final Block[] blockType = new Block[]{
GT_Container_CasingsTT.sBlockCasingsTT,
GT_Container_CasingsTT.sBlockCasingsTT,
GT_Container_CasingsTT.sBlockCasingsTT,
GT_Container_CasingsTT.sBlockCasingsTT,
GT_Container_CasingsTT.sBlockCasingsTT,
QuantumGlass.INSTANCE};
- private static final byte[] blockMeta=new byte[]{3,4,5,6,7,0};
+ private static final byte[] blockMeta = new byte[]{3, 4, 5, 6, 7, 0};
- public GT_MetaTileEntity_EMbhg(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_bhg(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMbhg(String aName) {
+ public GT_MetaTileEntity_EM_bhg(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMbhg(this.mName);
+ return new GT_MetaTileEntity_EM_bhg(this.mName);
}
@Override
@@ -80,7 +80,7 @@ public class GT_MetaTileEntity_EMbhg extends GT_MetaTileEntity_MultiblockBase_El
@Override
public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return stuctureCheck(shape,blockType,blockMeta,7,7,0,iGregTechTileEntity);
+ return stuctureCheck(shape, blockType, blockMeta, 7, 7, 0, iGregTechTileEntity);
}
@Override
@@ -88,7 +88,7 @@ public class GT_MetaTileEntity_EMbhg extends GT_MetaTileEntity_MultiblockBase_El
return new String[]{
commonValues.tecMark,
"Singularity decay based power generation.",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"Super unstable!!!"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Super unstable!!!"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMcollider.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java
index 4c11358759..f6ab3bd375 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMcollider.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.enums.Textures;
@@ -14,32 +14,32 @@ import net.minecraft.util.EnumChatFormatting;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMcollider extends GT_MetaTileEntity_MultiblockBase_Elemental {
+public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockBase_EM {
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape=new String[][]{
+ private static final String[][] shape = new String[][]{
{"",//left to right top
"",
- "" },//front
+ ""},//front
{},//behind front
{} //behind
};
- private static final int[] casingRequirements=new int[]{};
- private static final Block[] blockType=new Block[]{};
- private static final byte[] blockMeta=new byte[]{};
+ private static final int[] casingRequirements = new int[]{};
+ private static final Block[] blockType = new Block[]{};
+ private static final byte[] blockMeta = new byte[]{};
- public GT_MetaTileEntity_EMcollider(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_collider(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMcollider(String aName) {
+ public GT_MetaTileEntity_EM_collider(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMcollider(this.mName);
+ return new GT_MetaTileEntity_EM_collider(this.mName);
}
@Override
@@ -67,7 +67,7 @@ public class GT_MetaTileEntity_EMcollider extends GT_MetaTileEntity_MultiblockBa
return new String[]{
commonValues.tecMark,
"Collide matter at extreme velocities.",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"Faster than light!!!"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Faster than light!!!"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Computer.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
index c3ecc12a0f..71fa9a0600 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_Computer.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -10,28 +10,28 @@ import net.minecraft.util.EnumChatFormatting;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_Computer extends GT_MetaTileEntity_MultiblockBase_Elemental {
- private static final String[][] shape=new String[][]{
+public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockBase_EM {
+ private static final String[][] shape = new String[][]{
{"",//left to right top
"",
- "" },//front
+ ""},//front
{},//behind front
{} //behind
};
- private static final int[] casingRequirements=new int[]{};
- private static final Block[] blockType=new Block[]{};
- private static final byte[] blockMeta=new byte[]{};
+ private static final int[] casingRequirements = new int[]{};
+ private static final Block[] blockType = new Block[]{};
+ private static final byte[] blockMeta = new byte[]{};
- public GT_MetaTileEntity_Computer(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_computer(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_Computer(String aName) {
+ public GT_MetaTileEntity_EM_computer(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Computer(this.mName);
+ return new GT_MetaTileEntity_EM_computer(this.mName);
}
@Override
@@ -44,7 +44,7 @@ public class GT_MetaTileEntity_Computer extends GT_MetaTileEntity_MultiblockBase
return new String[]{
commonValues.tecMark,
"Processing quantum matter since...",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"the time u started using it."
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "the time u started using it."
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMcrafter.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java
index f1106e2277..e19291f538 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMcrafter.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -10,28 +10,28 @@ import net.minecraft.util.EnumChatFormatting;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMcrafter extends GT_MetaTileEntity_MultiblockBase_Elemental {
- private static final String[][] shape=new String[][]{
+public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBase_EM {
+ private static final String[][] shape = new String[][]{
{"",//left to right top
"",
- "" },//front
+ ""},//front
{},//behind front
{} //behind
};
- private static final int[] casingRequirements=new int[]{};
- private static final Block[] blockType=new Block[]{};
- private static final byte[] blockMeta=new byte[]{};
+ private static final int[] casingRequirements = new int[]{};
+ private static final Block[] blockType = new Block[]{};
+ private static final byte[] blockMeta = new byte[]{};
- public GT_MetaTileEntity_EMcrafter(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_crafter(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMcrafter(String aName) {
+ public GT_MetaTileEntity_EM_crafter(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMcrafter(this.mName);
+ return new GT_MetaTileEntity_EM_crafter(this.mName);
}
@Override
@@ -44,7 +44,7 @@ public class GT_MetaTileEntity_EMcrafter extends GT_MetaTileEntity_MultiblockBas
return new String[]{
commonValues.tecMark,
"The most precise way of making stuff.",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"(Trans-Planck process)"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "(Trans-Planck process)"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMdequantifier.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantifier.java
index a8589a5eb5..e94673e5c7 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMdequantifier.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantifier.java
@@ -1,7 +1,7 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
-import com.github.technus.tectech.blocks.QuantumGlass;
-import com.github.technus.tectech.casing.GT_Container_CasingsTT;
+import com.github.technus.tectech.things.block.QuantumGlass;
+import com.github.technus.tectech.things.casing.GT_Container_CasingsTT;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -12,18 +12,18 @@ import net.minecraftforge.common.util.ForgeDirection;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMdequantifier extends GT_MetaTileEntity_MultiblockBase_Elemental {
+public class GT_MetaTileEntity_EM_dequantifier extends GT_MetaTileEntity_MultiblockBase_EM {
- public GT_MetaTileEntity_EMdequantifier(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_dequantifier(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMdequantifier(String aName) {
+ public GT_MetaTileEntity_EM_dequantifier(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMdequantifier(this.mName);
+ return new GT_MetaTileEntity_EM_dequantifier(this.mName);
}
@Override
@@ -31,18 +31,18 @@ public class GT_MetaTileEntity_EMdequantifier extends GT_MetaTileEntity_Multiblo
int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
- if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir)!= QuantumGlass.INSTANCE) return false;
+ if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir) != QuantumGlass.INSTANCE) return false;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
for (int h = -1; h < 2; h++) {
- if ((i!=0 || j!=0 || h!=0)/*exclude center*/&&(xDir+i!=0 || yDir+h!=0 || zDir+j!=0)/*exclude this*/) {
+ if ((i != 0 || j != 0 || h != 0)/*exclude center*/ && (xDir + i != 0 || yDir + h != 0 || zDir + j != 0)/*exclude this*/) {
IGregTechTileEntity tTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + i, yDir + h, zDir + j);
- if ( (!addMaintenanceToMachineList(tTileEntity, 99)) &&
+ if ((!addMaintenanceToMachineList(tTileEntity, 99)) &&
(!addElementalInputToMachineList(tTileEntity, 99)) &&
(!addClassicOutputToMachineList(tTileEntity, 99)) &&
(!addMufflerToMachineList(tTileEntity, 99)) &&
(!addEnergyIOToMachineList(tTileEntity, 99))) {
- if ( iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != GT_Container_CasingsTT.sBlockCasingsTT ||
+ if (iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != GT_Container_CasingsTT.sBlockCasingsTT ||
iGregTechTileEntity.getMetaIDOffset(xDir + i, yDir + h, zDir + j) != 3) {
return false;
}
@@ -59,7 +59,7 @@ public class GT_MetaTileEntity_EMdequantifier extends GT_MetaTileEntity_Multiblo
return new String[]{
commonValues.tecMark,
"Transform quantum form back to regular one...",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"but why?"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "but why?"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java
new file mode 100644
index 0000000000..4d1524aed5
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java
@@ -0,0 +1,118 @@
+package com.github.technus.tectech.things.metaTileEntity.multi;
+
+import com.github.technus.tectech.things.block.QuantumGlass;
+import com.github.technus.tectech.things.casing.GT_Container_CasingsTT;
+import com.github.technus.tectech.elementalMatter.commonValues;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import static gregtech.api.enums.GT_Values.V;
+
+/**
+ * Created by danie_000 on 17.12.2016.
+ */
+public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockBase_EM {
+ public GT_MetaTileEntity_EM_junction(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_EM_junction(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_EM_junction(this.mName);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
+ int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
+ int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
+ int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
+ if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir) != QuantumGlass.INSTANCE) return false;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((i != 0 || j != 0 || h != 0)/*exclude center*/ && (xDir + i != 0 || yDir + h != 0 || zDir + j != 0)/*exclude this*/) {
+ IGregTechTileEntity tTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + i, yDir + h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 99)) &&
+ (!addElementalInputToMachineList(tTileEntity, 99)) &&
+ (!addElementalOutputToMachineList(tTileEntity, 99)) &&
+ (!addMufflerToMachineList(tTileEntity, 99)) &&
+ (!addEnergyIOToMachineList(tTileEntity, 99))) {
+ if (iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != GT_Container_CasingsTT.sBlockCasingsTT ||
+ iGregTechTileEntity.getMetaIDOffset(xDir + i, yDir + h, zDir + j) != 3) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ commonValues.tecMark,
+ "Reroutes Matter",
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Axis aligned movement!"
+ };
+ }
+
+ @Override
+ public void EM_checkParams() {
+ for (int i = 0; i < 10; i++) {
+ if ((int) eParamsIn[i] < 0) eParamsInStatus[i] = PARAM_TOO_LOW;
+ else if ((int) eParamsIn[i] == 0) eParamsInStatus[i] = PARAM_UNUSED;
+ else if ((int) eParamsIn[i] > eInputHatches.size()) eParamsInStatus[i] = PARAM_TOO_HIGH;
+ else eParamsInStatus[i] = PARAM_OK;
+ }
+ for (int i = 10; i < 20; i++) {
+ if (eParamsInStatus[i - 10] == PARAM_OK) {
+ if ((int) eParamsIn[i] < 0) eParamsInStatus[i] = PARAM_TOO_LOW;
+ else if ((int) eParamsIn[i] == 0) eParamsInStatus[i] = PARAM_LOW;
+ else if ((int) eParamsIn[i] > eOutputHatches.size()) eParamsInStatus[i] = PARAM_TOO_HIGH;
+ else eParamsInStatus[i] = PARAM_OK;
+ } else {
+ eParamsInStatus[i] = PARAM_UNUSED;
+ }
+ }
+ }
+
+ @Override
+ public boolean EM_checkRecipe(ItemStack itemStack) {
+ for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches)
+ if (in.getContainerHandler().hasStacks()) {
+ mEUt = -(int) V[8];
+ eAmpereFlow = 1 + ((eInputHatches.size() + eOutputHatches.size()) >> 1);
+ mMaxProgresstime = 20;
+ mEfficiencyIncrease = 10000;
+ return true;
+ }
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ return false;
+ }
+
+ @Override
+ public void EM_outputFunction() {
+ for (int i = 0; i < 10; i++) {
+ final int inIndex = (int) (eParamsIn[i]) - 1;
+ if (inIndex < 0 || inIndex > eInputHatches.size()) continue;
+ final int outIndex = (int) (eParamsIn[i + 10]) - 1;
+ GT_MetaTileEntity_Hatch_InputElemental in = eInputHatches.get(inIndex);
+ if (outIndex == -1) {
+ cleanHatchContent(in);
+ } else {
+ GT_MetaTileEntity_Hatch_OutputElemental out = eOutputHatches.get(outIndex);
+ out.getContainerHandler().putUnifyAll(in.getContainerHandler());
+ in.getContainerHandler().clear();
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMmachine.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java
index cbb91501af..9a25c057f1 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMmachine.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -10,28 +10,28 @@ import net.minecraft.util.EnumChatFormatting;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMmachine extends GT_MetaTileEntity_MultiblockBase_Elemental {
- private static final String[][] shape=new String[][]{
+public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBase_EM {
+ private static final String[][] shape = new String[][]{
{"",//left to right top
"",
- "" },//front
+ ""},//front
{},//behind front
{} //behind
};
- private static final int[] casingRequirements=new int[]{};
- private static final Block[] blockType=new Block[]{};
- private static final byte[] blockMeta=new byte[]{};
+ private static final int[] casingRequirements = new int[]{};
+ private static final Block[] blockType = new Block[]{};
+ private static final byte[] blockMeta = new byte[]{};
- public GT_MetaTileEntity_EMmachine(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_machine(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMmachine(String aName) {
+ public GT_MetaTileEntity_EM_machine(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMmachine(this.mName);
+ return new GT_MetaTileEntity_EM_machine(this.mName);
}
@Override
@@ -44,7 +44,7 @@ public class GT_MetaTileEntity_EMmachine extends GT_MetaTileEntity_MultiblockBas
return new String[]{
commonValues.tecMark,
"Processing quantum matter since...",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"the time u started using it."
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "the time u started using it."
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMquantifier.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_quantifier.java
index 87fd1cc88f..719bb221ec 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMquantifier.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_quantifier.java
@@ -1,8 +1,8 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.blocks.QuantumGlass;
-import com.github.technus.tectech.casing.GT_Container_CasingsTT;
+import com.github.technus.tectech.things.block.QuantumGlass;
+import com.github.technus.tectech.things.casing.GT_Container_CasingsTT;
import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack;
import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack;
import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackTree;
@@ -31,21 +31,21 @@ import static gregtech.api.enums.GT_Values.V;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_MultiblockBase_Elemental {
- public static HashMap<Integer,cElementalDefinitionStack> itemBinds=new HashMap<>(32);
- public static HashMap<Integer,cElementalDefinitionStack> fluidBind=new HashMap<>(8);
- private static float refMass,refUnstableMass;
+public class GT_MetaTileEntity_EM_quantifier extends GT_MetaTileEntity_MultiblockBase_EM {
+ public static HashMap<Integer, cElementalDefinitionStack> itemBinds = new HashMap<>(32);
+ public static HashMap<Integer, cElementalDefinitionStack> fluidBind = new HashMap<>(8);
+ private static float refMass, refUnstableMass;
- public GT_MetaTileEntity_EMquantifier(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_quantifier(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMquantifier(String aName) {
+ public GT_MetaTileEntity_EM_quantifier(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMquantifier(this.mName);
+ return new GT_MetaTileEntity_EM_quantifier(this.mName);
}
@Override
@@ -53,18 +53,18 @@ public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_Multiblock
int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
- if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir)!= QuantumGlass.INSTANCE) return false;
+ if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir) != QuantumGlass.INSTANCE) return false;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
for (int h = -1; h < 2; h++) {
- if ((i!=0 || j!=0 || h!=0)/*exclude center*/&&(xDir+i!=0 || yDir+h!=0 || zDir+j!=0)/*exclude this*/) {
+ if ((i != 0 || j != 0 || h != 0)/*exclude center*/ && (xDir + i != 0 || yDir + h != 0 || zDir + j != 0)/*exclude this*/) {
IGregTechTileEntity tTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + i, yDir + h, zDir + j);
- if ( (!addMaintenanceToMachineList(tTileEntity, 99)) &&
+ if ((!addMaintenanceToMachineList(tTileEntity, 99)) &&
(!addClassicInputToMachineList(tTileEntity, 99)) &&
(!addElementalOutputToMachineList(tTileEntity, 99)) &&
(!addMufflerToMachineList(tTileEntity, 99)) &&
(!addEnergyIOToMachineList(tTileEntity, 99))) {
- if ( iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != GT_Container_CasingsTT.sBlockCasingsTT ||
+ if (iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != GT_Container_CasingsTT.sBlockCasingsTT ||
iGregTechTileEntity.getMetaIDOffset(xDir + i, yDir + h, zDir + j) != 3) {
return false;
}
@@ -81,22 +81,22 @@ public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_Multiblock
return new String[]{
commonValues.tecMark,
"Conveniently convert regular stuff into quantum form.",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"To make it more inconvenient."
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "To make it more inconvenient."
};
}
@Override
public boolean EM_checkRecipe(ItemStack itemStack) {
- if(GregTech_API.sPostloadFinished) {
- ItemStack[] inI =getStoredInputs().toArray(new ItemStack[0]);
+ if (GregTech_API.sPostloadFinished) {
+ ItemStack[] inI = getStoredInputs().toArray(new ItemStack[0]);
if (inI.length > 0) {
for (ItemStack is : inI) {
- int[] oreIDs=OreDictionary.getOreIDs(is);
+ int[] oreIDs = OreDictionary.getOreIDs(is);
if (TecTech.ModConfig.DEBUG_MODE)
- TecTech.Logger.info("Quantifier-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage()+" "+is.getDisplayName());
- for(int ID:oreIDs) {
+ TecTech.Logger.info("Quantifier-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage() + " " + is.getDisplayName());
+ for (int ID : oreIDs) {
if (TecTech.ModConfig.DEBUG_MODE)
- TecTech.Logger.info("Quantifier-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage()+" "+OreDictionary.getOreName(ID));
+ TecTech.Logger.info("Quantifier-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage() + " " + OreDictionary.getOreName(ID));
cElementalDefinitionStack into = itemBinds.get(ID);
if (into != null && isInputEqual(true, false,
nothingF, new ItemStack[]{new ItemStack(is.getItem(), 1, is.getItemDamage())}, null, inI)) {
@@ -117,14 +117,14 @@ public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_Multiblock
}
}
}
- FluidStack[] inF=getStoredFluids().toArray(new FluidStack[0]);
+ FluidStack[] inF = getStoredFluids().toArray(new FluidStack[0]);
if (inF.length > 0) {
for (FluidStack fs : inF) {
cElementalDefinitionStack into = fluidBind.get(fs.getFluid().getID());
if (into != null && fs.amount >= 144 && isInputEqual(true, false,
new FluidStack[]{new FluidStack(fs.getFluid(), 144)}, nothingI, inF, (ItemStack[]) null)) {
mMaxProgresstime = 20;
- mEfficiencyIncrease=10000;
+ mEfficiencyIncrease = 10000;
float mass = into.getMass();
float euMult = mass / refMass;
eAmpereFlow = (int) Math.ceil(euMult);
@@ -140,86 +140,86 @@ public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_Multiblock
}
}
}
- mEfficiencyIncrease=0;
+ mEfficiencyIncrease = 0;
mMaxProgresstime = 0;
return false;
}
@Override
public void EM_outputFunction() {
- if(eOutputHatches.size()<1){
+ if (eOutputHatches.size() < 1) {
stopMachine();
return;
}
eOutputHatches.get(0).getContainerHandler().putUnifyAll(outputEM[0]);
}
- private static int getID(OrePrefixes prefix, Materials material){
- return OreDictionary.getOreID(prefix.name()+material.name());
+ private static int getID(OrePrefixes prefix, Materials material) {
+ return OreDictionary.getOreID(prefix.name() + material.name());
}
- public static void run(){
- refMass=getFirstStableIsotope(1).getMass()*144F;
- fluidBind.put(Materials.Hydrogen.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(1),144));
- fluidBind.put(Materials.Helium.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(2),144));
+ public static void run() {
+ refMass = getFirstStableIsotope(1).getMass() * 144F;
+ fluidBind.put(Materials.Hydrogen.mGas.getID(), new cElementalDefinitionStack(getFirstStableIsotope(1), 144));
+ fluidBind.put(Materials.Helium.mGas.getID(), new cElementalDefinitionStack(getFirstStableIsotope(2), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Lithium),
- new cElementalDefinitionStack(getFirstStableIsotope(3),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(3), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Beryllium),
- new cElementalDefinitionStack(getFirstStableIsotope(4),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(4), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Boron),
- new cElementalDefinitionStack(getFirstStableIsotope(5),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(5), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Carbon),
- new cElementalDefinitionStack(getFirstStableIsotope(6),144));
- fluidBind.put(Materials.Nitrogen.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(7),144));
- fluidBind.put(Materials.Oxygen.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(8),144));
- fluidBind.put(Materials.Fluorine.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(9),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(6), 144));
+ fluidBind.put(Materials.Nitrogen.mGas.getID(), new cElementalDefinitionStack(getFirstStableIsotope(7), 144));
+ fluidBind.put(Materials.Oxygen.mGas.getID(), new cElementalDefinitionStack(getFirstStableIsotope(8), 144));
+ fluidBind.put(Materials.Fluorine.mGas.getID(), new cElementalDefinitionStack(getFirstStableIsotope(9), 144));
//fluidBind.put(Materials.Neon.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(10),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Sodium),
- new cElementalDefinitionStack(getFirstStableIsotope(11),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(11), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Magnesium),
- new cElementalDefinitionStack(getFirstStableIsotope(12),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(12), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Aluminium),
- new cElementalDefinitionStack(getFirstStableIsotope(13),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(13), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Silicon),
- new cElementalDefinitionStack(getFirstStableIsotope(14),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(14), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Phosphorus),
- new cElementalDefinitionStack(getFirstStableIsotope(15),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(15), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Sulfur),
- new cElementalDefinitionStack(getFirstStableIsotope(16),144));
- fluidBind.put(Materials.Chlorine.mFluid.getID(),new cElementalDefinitionStack(getFirstStableIsotope(17),144));
- fluidBind.put(Materials.Argon.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(18),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(16), 144));
+ fluidBind.put(Materials.Chlorine.mFluid.getID(), new cElementalDefinitionStack(getFirstStableIsotope(17), 144));
+ fluidBind.put(Materials.Argon.mGas.getID(), new cElementalDefinitionStack(getFirstStableIsotope(18), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Potassium),
- new cElementalDefinitionStack(getFirstStableIsotope(19),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(19), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Calcium),
- new cElementalDefinitionStack(getFirstStableIsotope(20),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(20), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Scandium),
- new cElementalDefinitionStack(getFirstStableIsotope(21),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(21), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Titanium),
- new cElementalDefinitionStack(getFirstStableIsotope(22),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(22), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Vanadium),
- new cElementalDefinitionStack(getFirstStableIsotope(23),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(23), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Chrome),
- new cElementalDefinitionStack(getFirstStableIsotope(24),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(24), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Manganese),
- new cElementalDefinitionStack(getFirstStableIsotope(25),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(25), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Iron),
- new cElementalDefinitionStack(getFirstStableIsotope(26),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(26), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.IronMagnetic),
- new cElementalDefinitionStack(getFirstStableIsotope(26),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(26), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Cobalt),
- new cElementalDefinitionStack(getFirstStableIsotope(27),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(27), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Nickel),
- new cElementalDefinitionStack(getFirstStableIsotope(28),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(28), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Copper),
- new cElementalDefinitionStack(getFirstStableIsotope(29),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(29), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Zinc),
- new cElementalDefinitionStack(getFirstStableIsotope(30),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(30), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Gallium),
- new cElementalDefinitionStack(getFirstStableIsotope(31),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(31), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Germanium),
// new cElementalDefinitionStack(getFirstStableIsotope(32),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Arsenic),
- new cElementalDefinitionStack(getFirstStableIsotope(33),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(33), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Selenium),
// new cElementalDefinitionStack(getFirstStableIsotope(34),144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Bromine),
@@ -227,17 +227,17 @@ public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_Multiblock
//itemBinds.put(getID(OrePrefixes.dust, Materials.Krypton),
// new cElementalDefinitionStack(getFirstStableIsotope(36),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Rubidium),
- new cElementalDefinitionStack(getFirstStableIsotope(37),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(37), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Strontium),
- new cElementalDefinitionStack(getFirstStableIsotope(38),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(38), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Yttrium),
- new cElementalDefinitionStack(getFirstStableIsotope(39),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(39), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Zirconium),
// new cElementalDefinitionStack(getFirstStableIsotope(40),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Niobium),
- new cElementalDefinitionStack(getFirstStableIsotope(41),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(41), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Molybdenum),
- new cElementalDefinitionStack(getFirstStableIsotope(42),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(42), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Technetium),
// new cElementalDefinitionStack(getFirstStableIsotope(43),144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Ruthenium),
@@ -245,89 +245,89 @@ public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_Multiblock
//itemBinds.put(getID(OrePrefixes.dust, Materials.Rhodium),
// new cElementalDefinitionStack(getFirstStableIsotope(45),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Palladium),
- new cElementalDefinitionStack(getFirstStableIsotope(46),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(46), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Silver),
- new cElementalDefinitionStack(getFirstStableIsotope(47),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(47), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Cadmium),
- new cElementalDefinitionStack(getFirstStableIsotope(48),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(48), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Indium),
- new cElementalDefinitionStack(getFirstStableIsotope(49),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(49), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Tin),
- new cElementalDefinitionStack(getFirstStableIsotope(50),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(50), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Antimony),
- new cElementalDefinitionStack(getFirstStableIsotope(51),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(51), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Tellurium),
- new cElementalDefinitionStack(getFirstStableIsotope(52),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(52), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Iodine),
// new cElementalDefinitionStack(getFirstStableIsotope(53),144));
//fluidBind.put(Materials.Xenon.mGas.getID(),new cElementalDefinitionStack(getFirstStableIsotope(54),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Caesium),
- new cElementalDefinitionStack(getFirstStableIsotope(55),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(55), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Barium),
- new cElementalDefinitionStack(getFirstStableIsotope(56),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(56), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Lanthanum),
- new cElementalDefinitionStack(getFirstStableIsotope(57),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(57), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Cerium),
- new cElementalDefinitionStack(getFirstStableIsotope(58),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(58), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Praseodymium),
- new cElementalDefinitionStack(getFirstStableIsotope(59),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(59), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Neodymium),
- new cElementalDefinitionStack(getFirstStableIsotope(60),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(60), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.NeodymiumMagnetic),
- new cElementalDefinitionStack(getFirstStableIsotope(60),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(60), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Promethium),
- new cElementalDefinitionStack(getFirstStableIsotope(61),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(61), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Samarium),
- new cElementalDefinitionStack(getFirstStableIsotope(62),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(62), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.SamariumMagnetic),
// new cElementalDefinitionStack(getFirstStableIsotope(62),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Europium),
- new cElementalDefinitionStack(getFirstStableIsotope(63),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(63), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Gadolinium),
- new cElementalDefinitionStack(getFirstStableIsotope(64),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(64), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Terbium),
- new cElementalDefinitionStack(getFirstStableIsotope(65),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(65), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Dysprosium),
- new cElementalDefinitionStack(getFirstStableIsotope(66),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(66), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Holmium),
- new cElementalDefinitionStack(getFirstStableIsotope(67),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(67), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Erbium),
- new cElementalDefinitionStack(getFirstStableIsotope(68),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(68), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Thulium),
- new cElementalDefinitionStack(getFirstStableIsotope(69),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(69), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Ytterbium),
- new cElementalDefinitionStack(getFirstStableIsotope(70),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(70), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Lutetium),
- new cElementalDefinitionStack(getFirstStableIsotope(71),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(71), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Hafnum),
// new cElementalDefinitionStack(getFirstStableIsotope(72),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Tantalum),
- new cElementalDefinitionStack(getFirstStableIsotope(73),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(73), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Tungsten),
- new cElementalDefinitionStack(getFirstStableIsotope(74),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(74), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Rhenium),
// new cElementalDefinitionStack(getFirstStableIsotope(75),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Osmium),
- new cElementalDefinitionStack(getFirstStableIsotope(76),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(76), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Iridium),
- new cElementalDefinitionStack(getFirstStableIsotope(77),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(77), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Platinum),
- new cElementalDefinitionStack(getFirstStableIsotope(78),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(78), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Gold),
- new cElementalDefinitionStack(getFirstStableIsotope(79),144));
- fluidBind.put(Materials.Mercury.mFluid.getID(),new cElementalDefinitionStack(getFirstStableIsotope(80),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(79), 144));
+ fluidBind.put(Materials.Mercury.mFluid.getID(), new cElementalDefinitionStack(getFirstStableIsotope(80), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Thalium),
// new cElementalDefinitionStack(getFirstStableIsotope(81),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Lead),
- new cElementalDefinitionStack(getFirstStableIsotope(82),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(82), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Bismuth),
- new cElementalDefinitionStack(getFirstStableIsotope(83),144));
+ new cElementalDefinitionStack(getFirstStableIsotope(83), 144));
//UNSTABLE ATOMS
- refUnstableMass=getFirstStableIsotope(83).getMass()*144F;
+ refUnstableMass = getFirstStableIsotope(83).getMass() * 144F;
//itemBinds.put(getID(OrePrefixes.dust, Materials.Polonium),
// new cElementalDefinitionStack(getBestUnstableIsotope(84),144));
//fluidBind.put(Materials.Astatine.mPlasma.getID(),new cElementalDefinitionStack(getBestUnstableIsotope(85),144));
- fluidBind.put(Materials.Radon.mGas.getID(),new cElementalDefinitionStack(getBestUnstableIsotope(86),144));
+ fluidBind.put(Materials.Radon.mGas.getID(), new cElementalDefinitionStack(getBestUnstableIsotope(86), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Francium),
// new cElementalDefinitionStack(getBestUnstableIsotope(87),144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Radium),
@@ -335,54 +335,54 @@ public class GT_MetaTileEntity_EMquantifier extends GT_MetaTileEntity_Multiblock
//itemBinds.put(getID(OrePrefixes.dust, Materials.Actinium),
// new cElementalDefinitionStack(getBestUnstableIsotope(89),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Thorium),
- new cElementalDefinitionStack(getBestUnstableIsotope(90),144));
+ new cElementalDefinitionStack(getBestUnstableIsotope(90), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Protactinium),
// new cElementalDefinitionStack(getBestUnstableIsotope(91),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Uranium),
- new cElementalDefinitionStack(getBestUnstableIsotope(92),144));
+ new cElementalDefinitionStack(getBestUnstableIsotope(92), 144));
//itemBinds.put(getID(OrePrefixes.dust, Materials.Neptunium),
// new cElementalDefinitionStack(getBestUnstableIsotope(93),144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Plutonium),
- new cElementalDefinitionStack(getBestUnstableIsotope(94),144));
+ new cElementalDefinitionStack(getBestUnstableIsotope(94), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Americium),
- new cElementalDefinitionStack(getBestUnstableIsotope(95),144));
+ new cElementalDefinitionStack(getBestUnstableIsotope(95), 144));
/* ... */
itemBinds.put(getID(OrePrefixes.ingotHot, Materials.Neutronium),
- new cElementalDefinitionStack(dHadronDefinition.hadron_n,100000));
+ new cElementalDefinitionStack(dHadronDefinition.hadron_n, 100000));
- try{
+ try {
fluidBind.put(Materials.Deuterium.mGas.getID(), new cElementalDefinitionStack(
new dAtomDefinition(
eLeptonDefinition.lepton_e1,
dHadronDefinition.hadron_p1,
dHadronDefinition.hadron_n1
- ),144));
+ ), 144));
fluidBind.put(Materials.Tritium.mGas.getID(), new cElementalDefinitionStack(
new dAtomDefinition(
eLeptonDefinition.lepton_e1,
dHadronDefinition.hadron_p1,
dHadronDefinition.hadron_n2
- ),144));
+ ), 144));
fluidBind.put(Materials.Helium_3.mGas.getID(), new cElementalDefinitionStack(
new dAtomDefinition(
- new cElementalDefinitionStack(eLeptonDefinition.lepton_e,2),
+ new cElementalDefinitionStack(eLeptonDefinition.lepton_e, 2),
dHadronDefinition.hadron_p2,
- new cElementalDefinitionStack(dHadronDefinition.hadron_n,3)
- ),144));
+ new cElementalDefinitionStack(dHadronDefinition.hadron_n, 3)
+ ), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Uranium235),
new cElementalDefinitionStack(new dAtomDefinition(
- new cElementalDefinitionStack(eLeptonDefinition.lepton_e,92),
- new cElementalDefinitionStack(dHadronDefinition.hadron_p,92),
- new cElementalDefinitionStack(dHadronDefinition.hadron_n,143)
- ),144));
+ new cElementalDefinitionStack(eLeptonDefinition.lepton_e, 92),
+ new cElementalDefinitionStack(dHadronDefinition.hadron_p, 92),
+ new cElementalDefinitionStack(dHadronDefinition.hadron_n, 143)
+ ), 144));
itemBinds.put(getID(OrePrefixes.dust, Materials.Plutonium241),
new cElementalDefinitionStack(new dAtomDefinition(
- new cElementalDefinitionStack(eLeptonDefinition.lepton_e,94),
- new cElementalDefinitionStack(dHadronDefinition.hadron_p,94),
- new cElementalDefinitionStack(dHadronDefinition.hadron_n,149)
- ),144));
- }catch (tElementalException e){
- if(TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
+ new cElementalDefinitionStack(eLeptonDefinition.lepton_e, 94),
+ new cElementalDefinitionStack(dHadronDefinition.hadron_p, 94),
+ new cElementalDefinitionStack(dHadronDefinition.hadron_n, 149)
+ ), 144));
+ } catch (tElementalException e) {
+ if (TecTech.ModConfig.DEBUG_MODE) e.printStackTrace();
}
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMscanner.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
index 550e1f832b..7de3f1db0b 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMscanner.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -10,28 +10,28 @@ import net.minecraft.util.EnumChatFormatting;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMscanner extends GT_MetaTileEntity_MultiblockBase_Elemental {
- private static final String[][] shape=new String[][]{
+public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM {
+ private static final String[][] shape = new String[][]{
{"",//left to right top
"",
- "" },//front
+ ""},//front
{},//behind front
{} //behind
};
- private static final int[] casingRequirements=new int[]{};
- private static final Block[] blockType=new Block[]{};
- private static final byte[] blockMeta=new byte[]{};
+ private static final int[] casingRequirements = new int[]{};
+ private static final Block[] blockType = new Block[]{};
+ private static final byte[] blockMeta = new byte[]{};
- public GT_MetaTileEntity_EMscanner(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_scanner(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMscanner(String aName) {
+ public GT_MetaTileEntity_EM_scanner(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMscanner(this.mName);
+ return new GT_MetaTileEntity_EM_scanner(this.mName);
}
@Override
@@ -44,7 +44,7 @@ public class GT_MetaTileEntity_EMscanner extends GT_MetaTileEntity_MultiblockBas
return new String[]{
commonValues.tecMark,
"What is existing here?",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"I HAVE NO IDEA (yet)!"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "I HAVE NO IDEA (yet)!"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMtransformer.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java
index ce65ea205a..2886e782e2 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMtransformer.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -7,14 +7,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
-import static com.github.technus.tectech.casing.GT_Container_CasingsTT.sBlockCasingsTT;
+import static com.github.technus.tectech.things.casing.GT_Container_CasingsTT.sBlockCasingsTT;
import static com.github.technus.tectech.elementalMatter.commonValues.multiCheckAt;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMtransformer extends GT_MetaTileEntity_MultiblockBase_Elemental {
- public GT_MetaTileEntity_EMtransformer(int aID, String aName, String aNameRegional) {
+public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_MultiblockBase_EM {
+ public GT_MetaTileEntity_EM_transformer(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
mWrench = true;
mScrewdriver = true;
@@ -24,7 +24,7 @@ public class GT_MetaTileEntity_EMtransformer extends GT_MetaTileEntity_Multibloc
mCrowbar = true;
}
- public GT_MetaTileEntity_EMtransformer(String aName) {
+ public GT_MetaTileEntity_EM_transformer(String aName) {
super(aName);
mWrench = true;
mScrewdriver = true;
@@ -35,7 +35,7 @@ public class GT_MetaTileEntity_EMtransformer extends GT_MetaTileEntity_Multibloc
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMtransformer(this.mName);
+ return new GT_MetaTileEntity_EM_transformer(this.mName);
}
@Override
@@ -43,14 +43,15 @@ public class GT_MetaTileEntity_EMtransformer extends GT_MetaTileEntity_Multibloc
int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
- if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir)!=sBlockCasingsTT || iGregTechTileEntity.getMetaIDOffset(xDir, yDir, zDir)!=6) return false;
+ if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir) != sBlockCasingsTT || iGregTechTileEntity.getMetaIDOffset(xDir, yDir, zDir) != 6)
+ return false;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
for (int h = -1; h < 2; h++) {
- if ((i!=0 || j!=0 || h!=0)/*exclude center*/&&(xDir+i!=0 || yDir+h!=0 || zDir+j!=0)/*exclude this*/) {
+ if ((i != 0 || j != 0 || h != 0)/*exclude center*/ && (xDir + i != 0 || yDir + h != 0 || zDir + j != 0)/*exclude this*/) {
IGregTechTileEntity tTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + i, yDir + h, zDir + j);
if (!addEnergyIOToMachineList(tTileEntity, 99)) {
- if ( iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != sBlockCasingsTT ||
+ if (iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != sBlockCasingsTT ||
iGregTechTileEntity.getMetaIDOffset(xDir + i, yDir + h, zDir + j) != 3) {
return false;
}
@@ -67,33 +68,33 @@ public class GT_MetaTileEntity_EMtransformer extends GT_MetaTileEntity_Multibloc
return new String[]{
commonValues.tecMark,
"Power substation",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"All the transformation!",
- EnumChatFormatting.AQUA+"SafeVoid button = Soft Hammer!",
- EnumChatFormatting.BLUE+"Only 0.78125% power loss, HAYO!",
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "All the transformation!",
+ EnumChatFormatting.AQUA + "SafeVoid button = Soft Hammer!",
+ EnumChatFormatting.BLUE + "Only 0.78125% power loss, HAYO!",
};
}
@Override
public boolean EM_checkRecipe(ItemStack itemStack) {
- if(ePowerPass){
- mEfficiencyIncrease=10000;
- mMaxProgresstime=20;
- }else {
- mEfficiencyIncrease=0;
- mMaxProgresstime=0;
+ if (ePowerPass) {
+ mEfficiencyIncrease = 10000;
+ mMaxProgresstime = 20;
+ } else {
+ mEfficiencyIncrease = 0;
+ mMaxProgresstime = 0;
}
- eAmpereFlow =0;
- mEUt=0;
- eDismatleBoom=ePowerPass;
+ eAmpereFlow = 0;
+ mEUt = 0;
+ eDismatleBoom = ePowerPass;
return ePowerPass;
}
@Override
public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if((aTick%20)==multiCheckAt) {
- if(eSafeVoid){
- eSafeVoid=false;
- if(aBaseMetaTileEntity.isAllowedToWork())
+ if ((aTick % 20) == multiCheckAt) {
+ if (eSafeVoid) {
+ eSafeVoid = false;
+ if (aBaseMetaTileEntity.isAllowedToWork())
aBaseMetaTileEntity.disableWorking();
else aBaseMetaTileEntity.enableWorking();
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMwormhole.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
index 6b53b0a542..e5e5db4caf 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMwormhole.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.multi;
import com.github.technus.tectech.elementalMatter.commonValues;
import gregtech.api.enums.Textures;
@@ -14,32 +14,32 @@ import net.minecraft.util.EnumChatFormatting;
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EMwormhole extends GT_MetaTileEntity_MultiblockBase_Elemental {
+public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM {
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape=new String[][]{
+ private static final String[][] shape = new String[][]{
{"",//left to right top
"",
- "" },//front
+ ""},//front
{},//behind front
{} //behind
};
- private static final int[] casingRequirements=new int[]{};
- private static final Block[] blockType=new Block[]{};
- private static final byte[] blockMeta=new byte[]{};
+ private static final int[] casingRequirements = new int[]{};
+ private static final Block[] blockType = new Block[]{};
+ private static final byte[] blockMeta = new byte[]{};
- public GT_MetaTileEntity_EMwormhole(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_EM_wormhole(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_EMwormhole(String aName) {
+ public GT_MetaTileEntity_EM_wormhole(String aName) {
super(aName);
}
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_EMwormhole(this.mName);
+ return new GT_MetaTileEntity_EM_wormhole(this.mName);
}
@Override
@@ -67,7 +67,7 @@ public class GT_MetaTileEntity_EMwormhole extends GT_MetaTileEntity_MultiblockBa
return new String[]{
commonValues.tecMark,
"It is not full of worms.",
- EnumChatFormatting.AQUA.toString()+EnumChatFormatting.BOLD+"It is full of anti-worms!!!"
+ EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "It is full of anti-worms!!!"
};
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/gui/GT_Container_MultiMachineEM.java
index ef6b073aee..3b4ec72338 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_Container_MultiMachineEM.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/gui/GT_Container_MultiMachineEM.java
@@ -1,6 +1,6 @@
-package com.github.technus.tectech.elementalMatter.gui;
+package com.github.technus.tectech.things.metaTileEntity.multi.gui;
-import com.github.technus.tectech.elementalMatter.machine.GT_MetaTileEntity_MultiblockBase_Elemental;
+import com.github.technus.tectech.things.metaTileEntity.GT_MetaTileEntity_MultiblockBase_EM;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,10 +11,10 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine {
- public byte[] eParamsInStatus=new byte[20];//unused 0,G ok 1, B too low 2, R too high 3, Y blink dangerous 4,5
- public byte[] eParamsOutStatus=new byte[20];
- public byte eCertainMode=5,eCertainStatus=127;
- public boolean ePowerPass=false,eSafeVoid=false;
+ public byte[] eParamsInStatus = new byte[20];//unused 0,G ok 1, B too low 2, R too high 3, Y blink dangerous 4,5
+ public byte[] eParamsOutStatus = new byte[20];
+ public byte eCertainMode = 5, eCertainStatus = 127;
+ public boolean ePowerPass = false, eSafeVoid = false;
public GT_Container_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
@@ -37,10 +37,14 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine {
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
if ((tSlot != null) && (this.mTileEntity.getMetaTileEntity() != null)) {
- GT_MetaTileEntity_MultiblockBase_Elemental base=(GT_MetaTileEntity_MultiblockBase_Elemental)this.mTileEntity.getMetaTileEntity();
- switch (aSlotIndex){
- case 1:base.ePowerPass^=true;break;
- case 2:base.eSafeVoid^=true;break;
+ GT_MetaTileEntity_MultiblockBase_EM base = (GT_MetaTileEntity_MultiblockBase_EM) this.mTileEntity.getMetaTileEntity();
+ switch (aSlotIndex) {
+ case 1:
+ base.ePowerPass ^= true;
+ break;
+ case 2:
+ base.eSafeVoid ^= true;
+ break;
}
}
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
@@ -49,14 +53,14 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine {
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
- if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null) || (this.eParamsInStatus ==null))
+ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null) || (this.eParamsInStatus == null))
return;//INTELLIJ IS TALKING BULLSHIT HERE IT CAN BE NULL!!!
- this.eParamsInStatus = ((GT_MetaTileEntity_MultiblockBase_Elemental) this.mTileEntity.getMetaTileEntity()).eParamsInStatus;
- this.eParamsOutStatus = ((GT_MetaTileEntity_MultiblockBase_Elemental) this.mTileEntity.getMetaTileEntity()).eParamsOutStatus;
- this.eCertainMode = ((GT_MetaTileEntity_MultiblockBase_Elemental) this.mTileEntity.getMetaTileEntity()).eCertainMode;
- this.eCertainStatus = ((GT_MetaTileEntity_MultiblockBase_Elemental) this.mTileEntity.getMetaTileEntity()).eCertainStatus;
- this.ePowerPass = ((GT_MetaTileEntity_MultiblockBase_Elemental) this.mTileEntity.getMetaTileEntity()).ePowerPass;
- this.eSafeVoid = ((GT_MetaTileEntity_MultiblockBase_Elemental) this.mTileEntity.getMetaTileEntity()).eSafeVoid;
+ this.eParamsInStatus = ((GT_MetaTileEntity_MultiblockBase_EM) this.mTileEntity.getMetaTileEntity()).eParamsInStatus;
+ this.eParamsOutStatus = ((GT_MetaTileEntity_MultiblockBase_EM) this.mTileEntity.getMetaTileEntity()).eParamsOutStatus;
+ this.eCertainMode = ((GT_MetaTileEntity_MultiblockBase_EM) this.mTileEntity.getMetaTileEntity()).eCertainMode;
+ this.eCertainStatus = ((GT_MetaTileEntity_MultiblockBase_EM) this.mTileEntity.getMetaTileEntity()).eCertainStatus;
+ this.ePowerPass = ((GT_MetaTileEntity_MultiblockBase_EM) this.mTileEntity.getMetaTileEntity()).ePowerPass;
+ this.eSafeVoid = ((GT_MetaTileEntity_MultiblockBase_EM) this.mTileEntity.getMetaTileEntity()).eSafeVoid;
for (Object crafter : this.crafters) {
ICrafting var1 = (ICrafting) crafter;
@@ -71,16 +75,16 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine {
@Override
public void updateProgressBar(int par1, int par2) {
super.updateProgressBar(par1, par2);
- if(this.eParamsInStatus ==null)return;
- if(par1>=100 && par1< 120){
- this.eParamsInStatus[par1-100]=(byte)(par2&0xff);
- this.eParamsOutStatus[par1-100]=(byte)(par2>>>8);
- }else if(par1==120){
- this.eCertainMode=(byte)(par2&0xff);
- this.eCertainStatus=(byte)(par2>>>8);
- }else if(par1==121){
- this.ePowerPass=(par2&1)==1;
- this.eSafeVoid=(par2&2)==2;
+ if (this.eParamsInStatus == null) return;
+ if (par1 >= 100 && par1 < 120) {
+ this.eParamsInStatus[par1 - 100] = (byte) (par2 & 0xff);
+ this.eParamsOutStatus[par1 - 100] = (byte) (par2 >>> 8);
+ } else if (par1 == 120) {
+ this.eCertainMode = (byte) (par2 & 0xff);
+ this.eCertainStatus = (byte) (par2 >>> 8);
+ } else if (par1 == 121) {
+ this.ePowerPass = (par2 & 1) == 1;
+ this.eSafeVoid = (par2 & 2) == 2;
}
}
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/gui/GT_GUIContainer_MultiMachineEM.java
index 9200f5d02a..b246239cc1 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/gui/GT_GUIContainer_MultiMachineEM.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/multi/gui/GT_GUIContainer_MultiMachineEM.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.elementalMatter.gui;
+package com.github.technus.tectech.things.metaTileEntity.multi.gui;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -13,7 +13,7 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Machine {
String mName = "";
- private static byte cntr=0;
+ private static byte cntr = 0;
public GT_GUIContainer_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
super(new GT_Container_MultiMachineEM(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
@@ -61,123 +61,125 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
- y-=26;
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize+26);
- if (this.mContainer != null && ((GT_Container_MultiMachineEM) this.mContainer).eParamsInStatus!=null) {
- cntr=(byte)((1+cntr)%6);
+ y -= 26;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize + 26);
+ if (this.mContainer != null && ((GT_Container_MultiMachineEM) this.mContainer).eParamsInStatus != null) {
+ cntr = (byte) ((1 + cntr) % 6);
GL11.glColor4f(1f, 1f, 1f, 1f);
- if(((GT_Container_MultiMachineEM) mContainer).ePowerPass)
+ if (((GT_Container_MultiMachineEM) mContainer).ePowerPass)
drawTexturedModalRect(x + 151, y + 25, 183, 25, 18, 18);
- if(((GT_Container_MultiMachineEM) mContainer).eSafeVoid)
+ if (((GT_Container_MultiMachineEM) mContainer).eSafeVoid)
drawTexturedModalRect(x + 151, y + 46, 183, 46, 18, 18);
- x+=11;y+=96;
- for(int i=0;i<20;){
- byte j=(byte)(i>>>1);
- LEDdrawP(x,y,i ,0,((GT_Container_MultiMachineEM) this.mContainer).eParamsInStatus[j]);
- LEDdrawP(x,y,i++,1,((GT_Container_MultiMachineEM) this.mContainer).eParamsOutStatus[j]);
- LEDdrawP(x,y,i ,0,((GT_Container_MultiMachineEM) this.mContainer).eParamsInStatus[j+10]);
- LEDdrawP(x,y,i++,1,((GT_Container_MultiMachineEM) this.mContainer).eParamsOutStatus[j+10]);
+ x += 11;
+ y += 96;
+ for (int i = 0; i < 20; ) {
+ byte j = (byte) (i >>> 1);
+ LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) this.mContainer).eParamsInStatus[j]);
+ LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) this.mContainer).eParamsOutStatus[j]);
+ LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) this.mContainer).eParamsInStatus[j + 10]);
+ LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) this.mContainer).eParamsOutStatus[j + 10]);
}
- final short rU=183,Vs=77;
- x+=140;y-=19;
- final byte state=((GT_Container_MultiMachineEM) this.mContainer).eCertainStatus;
- switch(((GT_Container_MultiMachineEM) this.mContainer).eCertainMode){
+ final short rU = 183, Vs = 77;
+ x += 140;
+ y -= 19;
+ final byte state = ((GT_Container_MultiMachineEM) this.mContainer).eCertainStatus;
+ switch (((GT_Container_MultiMachineEM) this.mContainer).eCertainMode) {
case 1://ooo oxo ooo
drawTexturedModalRect(x + 6, y + 6,
- rU + (state==0?38:6),
+ rU + (state == 0 ? 38 : 6),
Vs + 6, 6, 6);
break;
case 2://ooo xox ooo
drawTexturedModalRect(x, y + 6,
- rU + ((state&1)==0?32:0),
+ rU + ((state & 1) == 0 ? 32 : 0),
Vs + 6, 6, 6);
- drawTexturedModalRect(x+12, y + 6,
- rU + ((state&2)==0?44:12),
+ drawTexturedModalRect(x + 12, y + 6,
+ rU + ((state & 2) == 0 ? 44 : 12),
Vs + 6, 6, 6);
break;
case 3://oxo xox oxo
- drawTexturedModalRect(x+6, y,
- rU + ((state&1)==0?38:6),
+ drawTexturedModalRect(x + 6, y,
+ rU + ((state & 1) == 0 ? 38 : 6),
Vs, 6, 6);
drawTexturedModalRect(x, y + 6,
- rU + ((state&2)==0?32:0),
+ rU + ((state & 2) == 0 ? 32 : 0),
Vs + 6, 6, 6);
- drawTexturedModalRect(x+12, y + 6,
- rU + ((state&4)==0?44:12),
+ drawTexturedModalRect(x + 12, y + 6,
+ rU + ((state & 4) == 0 ? 44 : 12),
Vs + 6, 6, 6);
- drawTexturedModalRect(x+6, y + 12,
- rU + ((state&8)==0?38:6),
+ drawTexturedModalRect(x + 6, y + 12,
+ rU + ((state & 8) == 0 ? 38 : 6),
Vs + 12, 6, 6);
break;
case 4://xox ooo xox
drawTexturedModalRect(x, y,
- rU + ((state&1)==0?32:0),
+ rU + ((state & 1) == 0 ? 32 : 0),
Vs, 6, 6);
- drawTexturedModalRect(x+12, y,
- rU + ((state&2)==0?44:12),
+ drawTexturedModalRect(x + 12, y,
+ rU + ((state & 2) == 0 ? 44 : 12),
Vs, 6, 6);
- drawTexturedModalRect(x, y+12,
- rU + ((state&4)==0?32:0),
- Vs+12, 6, 6);
- drawTexturedModalRect(x+12, y + 12,
- rU + ((state&8)==0?44:12),
+ drawTexturedModalRect(x, y + 12,
+ rU + ((state & 4) == 0 ? 32 : 0),
+ Vs + 12, 6, 6);
+ drawTexturedModalRect(x + 12, y + 12,
+ rU + ((state & 8) == 0 ? 44 : 12),
Vs + 12, 6, 6);
break;
case 5://xox ooo xox
drawTexturedModalRect(x, y,
- rU + ((state&1)==0?32:0),
+ rU + ((state & 1) == 0 ? 32 : 0),
Vs, 6, 6);
- drawTexturedModalRect(x+12, y,
- rU + ((state&2)==0?44:12),
+ drawTexturedModalRect(x + 12, y,
+ rU + ((state & 2) == 0 ? 44 : 12),
Vs, 6, 6);
drawTexturedModalRect(x + 6, y + 6,
- rU + ((state&4)==0?38:6),
+ rU + ((state & 4) == 0 ? 38 : 6),
Vs + 6, 6, 6);
- drawTexturedModalRect(x, y+12,
- rU + ((state&8)==0?32:0),
- Vs+12, 6, 6);
- drawTexturedModalRect(x+12, y + 12,
- rU + ((state&16)==0?44:12),
+ drawTexturedModalRect(x, y + 12,
+ rU + ((state & 8) == 0 ? 32 : 0),
+ Vs + 12, 6, 6);
+ drawTexturedModalRect(x + 12, y + 12,
+ rU + ((state & 16) == 0 ? 44 : 12),
Vs + 12, 6, 6);
break;
}
}
}
- private void LEDdrawP(int x,int y,int i,int j,byte status){
- final int v=192,su=8,sv=6,u=11;
- switch(status){
+ private void LEDdrawP(int x, int y, int i, int j, byte status) {
+ final int v = 192, su = 8, sv = 6, u = 11;
+ switch (status) {
case 6:
- if (cntr<2){
+ if (cntr < 2) {
drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv);
break;
- } else if (cntr<4){
+ } else if (cntr < 4) {
drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv);
break;
}
case 1://ok
- drawTexturedModalRect(x+su*i,y+sv*j,u+su*i,v+sv*(4+j),su,sv);
- break;
+ drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (4 + j), su, sv);
+ break;
case 2://too low blink
- if(cntr<3){
- drawTexturedModalRect(x+su*i,y+sv*j,u+su*i,v+sv*j,su,sv);
+ if (cntr < 3) {
+ drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv);
break;
}
case 3:// too low
- drawTexturedModalRect(x+su*i,y+sv*j,u+su*i,v+sv*(2+j),su,sv);
- break;
+ drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (2 + j), su, sv);
+ break;
case 4://too high blink
- if(cntr<3) {
- drawTexturedModalRect(x+su*i,y+sv*j,u+su*i,v+sv*(8+j),su,sv);
+ if (cntr < 3) {
+ drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv);
break;
}
case 5:// too high
- drawTexturedModalRect(x+su*i,y+sv*j,u+su*i,v+sv*(6+j),su,sv);
- break;
+ drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (6 + j), su, sv);
+ break;
}
}
} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMpipe.java b/src/main/java/com/github/technus/tectech/things/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java
index d46ae64393..05cd562460 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/machine/GT_MetaTileEntity_EMpipe.java
+++ b/src/main/java/com/github/technus/tectech/things/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java
@@ -1,5 +1,6 @@
-package com.github.technus.tectech.elementalMatter.machine;
+package com.github.technus.tectech.things.metaTileEntity.pipe;
+import com.github.technus.tectech.things.machineTT;
import com.github.technus.tectech.elementalMatter.commonValues;
import com.github.technus.tectech.elementalMatter.interfaces.iConnectsToEMpipe;
import gregtech.api.enums.Dyes;
@@ -25,22 +26,22 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL;
/**
* Created by Tec on 26.02.2017.
*/
-public class GT_MetaTileEntity_EMpipe extends MetaPipeEntity implements iConnectsToEMpipe {
+public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements iConnectsToEMpipe, machineTT {
private static Textures.BlockIcons.CustomIcon EMpipe;
private static Textures.BlockIcons.CustomIcon EMcandy;
- public byte connectionCount=0;
+ public byte connectionCount = 0;
- public GT_MetaTileEntity_EMpipe(int aID, String aName, String aNameRegional) {
+ public GT_MetaTileEntity_Pipe_EM(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 0);
}
- public GT_MetaTileEntity_EMpipe(String aName) {
+ public GT_MetaTileEntity_Pipe_EM(String aName) {
super(aName, 0);
}
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
- return new GT_MetaTileEntity_EMpipe(mName);
+ return new GT_MetaTileEntity_Pipe_EM(mName);
}
@Override
@@ -57,7 +58,7 @@ public class GT_MetaTileEntity_EMpipe extends MetaPipeEntity implements iConnect
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- return new ITexture[]{new GT_RenderedTexture(EMpipe),new GT_RenderedTexture(EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))};
+ return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))};
}
@Override
@@ -71,10 +72,12 @@ public class GT_MetaTileEntity_EMpipe extends MetaPipeEntity implements iConnect
}
@Override
- public void loadNBTData(NBTTagCompound nbtTagCompound) {}
+ public void loadNBTData(NBTTagCompound nbtTagCompound) {
+ }
@Override
- public void saveNBTData(NBTTagCompound nbtTagCompound) {}
+ public void saveNBTData(NBTTagCompound nbtTagCompound) {
+ }
@Override
public boolean renderInside(byte b) {
@@ -89,12 +92,12 @@ public class GT_MetaTileEntity_EMpipe extends MetaPipeEntity implements iConnect
@Override
public String[] getDescription() {
String tecMark;
- return new String[]{
+ return new String[]{
commonValues.tecMark,
"Quantum tunneling device.",
EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Not a portal!!!",
- EnumChatFormatting.AQUA+"Must be painted to work",
- EnumChatFormatting.AQUA+"Do not cross,split or turn"
+ EnumChatFormatting.AQUA + "Must be painted to work",
+ EnumChatFormatting.AQUA + "Do not cross,split or turn"
};
}
@@ -107,50 +110,50 @@ public class GT_MetaTileEntity_EMpipe extends MetaPipeEntity implements iConnect
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
if ((aTick & 31) == 0) {
- byte mOld=0;
+ byte mOld = 0;
mConnections = 0;
- connectionCount=0;
- if(aBaseMetaTileEntity.getColorization()<0) return;
+ connectionCount = 0;
+ if (aBaseMetaTileEntity.getColorization() < 0) return;
for (byte i = 0, j; i < 6; i++) {
j = GT_Utility.getOppositeSide(i);
if (!aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
if (tTileEntity instanceof IColoredTileEntity) {
//if (aBaseMetaTileEntity.getColorization() >= 0) {
- byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
- if (tColor != aBaseMetaTileEntity.getColorization()) continue;
+ byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
+ if (tColor != aBaseMetaTileEntity.getColorization()) continue;
//}
}
if (tTileEntity instanceof iConnectsToEMpipe && (((iConnectsToEMpipe) tTileEntity).canConnect(j))) {
mConnections |= (1 << i);
- if(mOld!=mConnections){
+ if (mOld != mConnections) {
connectionCount++;
- mOld=mConnections;
+ mOld = mConnections;
}
continue;
}
if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof iConnectsToEMpipe) {
if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity)) ||
- ((iConnectsToEMpipe)((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(j)) {
+ ((iConnectsToEMpipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(j)) {
mConnections |= (1 << i);
- if(mOld!=mConnections){
+ if (mOld != mConnections) {
connectionCount++;
- mOld=mConnections;
+ mOld = mConnections;
}
}
}
- }else{
+ } else {
mConnections |= (1 << i);
- if(mOld!=mConnections){
+ if (mOld != mConnections) {
connectionCount++;
- mOld=mConnections;
+ mOld = mConnections;
}
}
}
}
- } else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) {
+ } else if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) {
aBaseMetaTileEntity.issueTextureUpdate();
}
}