diff options
Diffstat (limited to 'src/main/java/com')
63 files changed, 1299 insertions, 1750 deletions
diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turret/TileTurretHeadEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turret/TileTurretHeadEM.java index fd039a0630..e027c83107 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turret/TileTurretHeadEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turret/TileTurretHeadEM.java @@ -1,9 +1,8 @@ package com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turret; -import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles.projectileEM; import com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turretbase.TileTurretBaseEM; -import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.maps.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; import net.minecraft.entity.Entity; @@ -16,7 +15,6 @@ import openmodularturrets.tileentity.turrets.TurretHead; import openmodularturrets.util.TurretHeadUtil; import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.AVOGADRO_CONSTANT; -import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.AVOGADRO_CONSTANT_DIMINISHED; /** * Created by Bass on 27/07/2017. @@ -54,7 +52,7 @@ public class TileTurretHeadEM extends TurretHead{ @Override public boolean requiresAmmo() { - return hatchContentPointer == null || !hatchContentPointer.hasStacks(); + return hatchContentPointer == null || hatchContentPointer.isEmpty(); } @Override @@ -69,20 +67,15 @@ public class TileTurretHeadEM extends TurretHead{ @Override public final TurretProjectile createProjectile(World world, Entity target, ItemStack ammo) { - while(hatchContentPointer!=null && hatchContentPointer.hasStacks()) { - cElementalInstanceStack stack = hatchContentPointer.get(TecTech.RANDOM.nextInt(hatchContentPointer.size())); - if(stack.amount<AVOGADRO_CONSTANT_DIMINISHED){ - TecTech.anomalyHandler.addAnomaly(this,hatchContentPointer.remove(stack.definition).getMass());//todo reduce - continue; - } - hatchContentPointer.removeAmount(false, stack.definition.getStackForm(AVOGADRO_CONSTANT)); - stack=stack.clone(); - stack.amount = AVOGADRO_CONSTANT; - return new projectileEM(world, TurretHeadUtil.getTurretBase(worldObj, xCoord, yCoord, zCoord), stack); + if (hatchContentPointer == null || hatchContentPointer.isEmpty()) { + return new projectileEM(world, TurretHeadUtil.getTurretBase(worldObj, xCoord, yCoord, zCoord), null); } - return new projectileEM(world, TurretHeadUtil.getTurretBase(worldObj, xCoord, yCoord, zCoord), null); - - //todo make the recipe require some overflow hatches + cElementalInstanceStack stack = hatchContentPointer.getRandom(); + double amount = Math.min(AVOGADRO_CONSTANT,stack.amount); + hatchContentPointer.removeAmount(false, stack.definition.getStackForm(AVOGADRO_CONSTANT)); + stack=stack.clone(); + stack.amount = amount; + return new projectileEM(world, TurretHeadUtil.getTurretBase(worldObj, xCoord, yCoord, zCoord), stack); } @Override diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java index a31ba4ef2c..a5d64fb886 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turretbase; -import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.maps.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import cpw.mods.fml.common.Optional; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -63,6 +63,6 @@ public class TileTurretBaseEM extends TurretBaseTierFiveTileEntity { private cElementalInstanceStackMap getFromHatch(GT_MetaTileEntity_Hatch_InputElemental hatch) { hatch.updateTexture((byte) 8,(byte) 4); - return hatch.getContainerHandler(); + return hatch.getContentHandler(); } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java index 8f570c1247..98ad5bbf63 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java @@ -3,8 +3,8 @@ package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.defi import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.transformations.AspectDefinitionCompat; import com.github.technus.tectech.util.Util; -import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.decay.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.maps.cElementalConstantStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; @@ -18,7 +18,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay.noDecay; +import static com.github.technus.tectech.mechanics.elementalMatter.core.decay.cElementalDecay.noDecay; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; import static net.minecraft.util.StatCollector.translateToLocal; @@ -31,37 +31,27 @@ public final class dComplexAspectDefinition extends cElementalDefinition { private static final byte nbtType = (byte) 'c'; - private final cElementalDefinitionStackMap aspectStacks; - - @Deprecated - public dComplexAspectDefinition(cElementalDefinition... aspects) throws tElementalException { - this(true, new cElementalDefinitionStackMap(aspects)); - } - - @Deprecated - private dComplexAspectDefinition(boolean check, cElementalDefinition... aspects) throws tElementalException { - this(check, new cElementalDefinitionStackMap(aspects)); - } + private final cElementalConstantStackMap aspectStacks; public dComplexAspectDefinition(cElementalDefinitionStack... aspects) throws tElementalException { - this(true, new cElementalDefinitionStackMap(aspects)); + this(true, new cElementalConstantStackMap(aspects)); } private dComplexAspectDefinition(boolean check, cElementalDefinitionStack... aspects) throws tElementalException { - this(check, new cElementalDefinitionStackMap(aspects)); + this(check, new cElementalConstantStackMap(aspects)); } - public dComplexAspectDefinition(cElementalDefinitionStackMap aspects) throws tElementalException { + public dComplexAspectDefinition(cElementalConstantStackMap aspects) throws tElementalException { this(true, aspects); } - private dComplexAspectDefinition(boolean check, cElementalDefinitionStackMap aspects) throws tElementalException { + private dComplexAspectDefinition(boolean check, cElementalConstantStackMap aspects) throws tElementalException { if (check && !canTheyBeTogether(aspects)) { throw new tElementalException("Hadron Definition error"); } aspectStacks = aspects; float mass = 0; - for (cElementalDefinitionStack stack : aspects.values()) { + for (cElementalDefinitionStack stack : aspects.valuesToArray()) { mass += stack.getMass(); } this.mass = mass; @@ -69,9 +59,9 @@ public final class dComplexAspectDefinition extends cElementalDefinition { } //public but u can just try{}catch(){} the constructor it still calls this method - private static boolean canTheyBeTogether(cElementalDefinitionStackMap stacks) { + private static boolean canTheyBeTogether(cElementalConstantStackMap stacks) { long amount = 0; - for (cElementalDefinitionStack aspects : stacks.values()) { + for (cElementalDefinitionStack aspects : stacks.valuesToArray()) { if (!(aspects.definition instanceof dComplexAspectDefinition) && !(aspects.definition instanceof ePrimalAspectDefinition)) { return false; } @@ -97,7 +87,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition { @Override public String getSymbol() { StringBuilder symbol = new StringBuilder(8); - for (cElementalDefinitionStack aspect : aspectStacks.values()) { + for (cElementalDefinitionStack aspect : aspectStacks.valuesToArray()) { if (aspect.definition instanceof ePrimalAspectDefinition) { for (int i = 0; i < aspect.amount; i++) { symbol.append(aspect.definition.getSymbol()); @@ -116,7 +106,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition { @Override public String getShortSymbol() { StringBuilder symbol = new StringBuilder(8); - for (cElementalDefinitionStack aspect : aspectStacks.values()) { + for (cElementalDefinitionStack aspect : aspectStacks.valuesToArray()) { if (aspect.definition instanceof ePrimalAspectDefinition) { for (int i = 0; i < aspect.amount; i++) { symbol.append(aspect.definition.getShortSymbol()); @@ -137,10 +127,10 @@ public final class dComplexAspectDefinition extends cElementalDefinition { return getNbtTagCompound(nbtType, aspectStacks); } - public static NBTTagCompound getNbtTagCompound(byte nbtType, cElementalDefinitionStackMap aspectStacks) { + public static NBTTagCompound getNbtTagCompound(byte nbtType, cElementalConstantStackMap aspectStacks) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setByte("t", nbtType); - cElementalDefinitionStack[] quarkStacksValues = aspectStacks.values(); + cElementalDefinitionStack[] quarkStacksValues = aspectStacks.valuesToArray(); nbt.setInteger("i", quarkStacksValues.length); for (int i = 0; i < quarkStacksValues.length; i++) { nbt.setTag(Integer.toString(i), quarkStacksValues[i].toNBT()); @@ -189,7 +179,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition { } @Override - public cElementalDefinitionStackMap getSubParticles() { + public cElementalConstantStackMap getSubParticles() { return aspectStacks; } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java index 9c6d107bff..5db067a552 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.defi import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; -import static com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay.noDecay; +import static com.github.technus.tectech.mechanics.elementalMatter.core.decay.cElementalDecay.noDecay; import static net.minecraft.util.StatCollector.translateToLocal; /** diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index c11a68b5d0..c939f10d6b 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.maps.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; @@ -94,12 +94,12 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ return false; } - cElementalInstanceStackMap inputHatchContainer = eInputHatches.get(0).getContainerHandler(); + cElementalInstanceStackMap inputHatchContainer = eInputHatches.get(0).getContentHandler(); if (inputHatchContainer == null || !inputHatchContainer.hasStacks()) { return false; } - cElementalInstanceStack stack = inputHatchContainer.get(TecTech.RANDOM.nextInt(inputHatchContainer.size())); + cElementalInstanceStack stack = inputHatchContainer.getRandom(); if (stack.amount < AVOGADRO_CONSTANT_DIMINISHED) { cleanStackEM_EM(inputHatchContainer.remove(stack.definition)); mEUt = (int) -V[6]; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEnti |
