From 336fda7cecd67607046df01c7c6aa6f73fc97ac2 Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 1 Nov 2019 13:40:37 +0100 Subject: TEMP WORK --- .../tectech/mechanics/anomaly/AnomalyHandler.java | 45 ++++++++++++++++++---- 1 file changed, 38 insertions(+), 7 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 2a770ea332..ad80c40be2 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -33,13 +33,17 @@ public class AnomalyHandler implements IChunkMetaDataHandler { public static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; public static final int COUNT_DIV=32; public static final double PER_PARTICLE=SWAP_THRESHOLD/COUNT_DIV; - public static final String INTENSITY = "intensity",SPACE_CANCER="space_cancer", SPACE_CHARGE ="space_charge"; + public static final String INTENSITY = "intensity"; + public static final String SPACE_CANCER="space_cancer"; + public static final String SPACE_CHARGE ="space_charge"; + public static final double GRAVITY_EFFECTIVENESS =1; + public static final String SPACE_MASS ="space_mass"; public static final int MEAN_DELAY =50; private static final float CHARGE_EFFECTIVENESS = 10; private static final float CHARGE_EXPLOSIVENESS = 5; private boolean fixMe=false; - private final ArrayList playersWithCharge = new ArrayList<>(); + private final List playersWithCharge = new ArrayList<>(); private final ArrayList worldDataArrayList = new ArrayList<>(512); @Override @@ -94,16 +98,16 @@ public class AnomalyHandler implements IChunkMetaDataHandler { if (playersWithCharge.size() > 0) { outer: for (EntityPlayer other : playersWithCharge) { - float fieldOther = TecTech.playerPersistence.getDataOrSetToNewTag(other).getFloat(SPACE_CHARGE); + float chargeOther = TecTech.playerPersistence.getDataOrSetToNewTag(other).getFloat(SPACE_CHARGE); for (EntityPlayer player : playersWithCharge) { if (other == player) { continue outer; } - float field = TecTech.playerPersistence.getDataOrSetToNewTag(player).getFloat(SPACE_CHARGE); - float difference = Math.abs(field - fieldOther); + float charge = TecTech.playerPersistence.getDataOrSetToNewTag(player).getFloat(SPACE_CHARGE); + float difference = Math.abs(charge - chargeOther); if (difference != 0) { if (player.getDistanceSqToEntity(other) < 1) { - float avg = (fieldOther + field) / 2; + float avg = (chargeOther + charge) / 2; addAnomaly(other.worldObj.provider.dimensionId, new ChunkCoordIntPair(other.chunkCoordX, other.chunkCoordZ), Math.min(SWAP_THRESHOLD, PER_PARTICLE * difference)); other.worldObj.createExplosion(other, other.posX, other.posY, other.posZ, Math.min(CHARGE_EXPLOSIVENESS * difference, 25), true); player.worldObj.createExplosion(player, player.posX, player.posY, player.posZ, Math.min(CHARGE_EXPLOSIVENESS * difference, 25), true); @@ -287,13 +291,40 @@ public class AnomalyHandler implements IChunkMetaDataHandler { double dY = player.posY - otherPlayer.posY; double dZ = player.posZ - otherPlayer.posZ; player.addVelocity(effect * dX, effect * dY, effect * dZ); - otherPlayer.addVelocity(-effect * dX, -effect * dY, -effect * dZ); + effect=-effect; + otherPlayer.addVelocity(effect * dX, effect * dY, effect * dZ); } } } } } } + + float mass=TecTech.playerPersistence.getDataOrSetToNewTag(player).getFloat(SPACE_MASS); + if(mass!=0) { + for (Object o : player.worldObj.playerEntities) { + if (o instanceof EntityPlayer && !((EntityPlayer) o).capabilities.isCreativeMode) { + EntityPlayer otherPlayer=(EntityPlayer)o; + float massOther = TecTech.playerPersistence.getDataOrSetToNewTag(otherPlayer).getFloat(SPACE_MASS); + if (massOther != 0 && player != o) { + float reaction = massOther * mass; + if (reaction !=0) { + double distanceSq = otherPlayer.getDistanceSqToEntity(player); + if (distanceSq >= 1) { + double effect = GRAVITY_EFFECTIVENESS * reaction / (distanceSq * distanceSq * distanceSq); + double dX = player.posX - otherPlayer.posX; + double dY = player.posY - otherPlayer.posY; + double dZ = player.posZ - otherPlayer.posZ; + otherPlayer.addVelocity(effect * dX, effect * dY, effect * dZ); + effect=-effect; + player.addVelocity(effect * dX, effect * dY, effect * dZ); + } + } + } + } + } + + } } if (fixMe){ player.setInvisible(false); -- cgit From dd9b39c21339b591724a44c68c8b0c68fe1cafbe Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 10 Sep 2021 13:17:08 -0700 Subject: tesla tower will accept any frame again --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index cbc20143b3..0778feb1fd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -46,7 +46,8 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; import static com.github.technus.tectech.util.CommonValues.V; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static java.lang.Math.min; import static net.minecraft.util.StatCollector.translateToLocal; @@ -102,6 +103,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.0"),//1 - Classic Hatches, Capacitor Hatches or Tesla Base Casing + translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.1"),//2 - Titanium Frames }; private static final IStructureDefinition STRUCTURE_DEFINITION = @@ -130,7 +132,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock .addElement('C', ofBlock(sBlockCasingsBA0, 8)) .addElement('D', defer(t -> ofBlock(sBlockCasingsBA0, t.getCoilWindingMeta()))) .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_TM_teslaCoil::addCapacitorToMachineList, textureOffset + 16 + 6, 1, sBlockCasingsBA0, 6)) - .addElement('F', ofFrame(Materials.get("Titanium"))) + .addElement('F', ofHatchAdder(GT_MetaTileEntity_TM_teslaCoil::addFrameToMachineList, 0, 2)) .build(); public int getCoilWindingMeta() { -- cgit From 08b8723025ea530d929cfad738e659b13d7f2f91 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 10 Sep 2021 13:24:55 -0700 Subject: updated adders method --- .../java/com/github/technus/tectech/mechanics/structure/Structure.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java index b37ae0bbda..44cad98791 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -22,7 +22,7 @@ public class Structure { @Deprecated @SafeVarargs - public static IHatchAdder[] adders(IHatchAdder... iHatchAdder) { + public static IGT_HatchAdder[] adders(IGT_HatchAdder... iHatchAdder) { return iHatchAdder; } -- cgit From ebd719987402bb4a60bf01a10f5b8e1480184f69 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 5 Dec 2021 09:03:50 +0100 Subject: Fix Junctions --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index b63079d2dc..29ba91d4b7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -69,7 +69,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB v = (int) v; if (v < 0) return STATUS_TOO_LOW; if (v == 0) return STATUS_NEUTRAL; - if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; + if (v > base.eOutputHatches.size()) return STATUS_TOO_HIGH; return STATUS_OK; }; private static final IStatusFunction DST_STATUS = @@ -80,7 +80,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB v = (int) v; if (v < 0) return STATUS_TOO_LOW; if (v == 0) return STATUS_LOW; - if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; + if (v > base.eInputHatches.size()) return STATUS_TOO_HIGH; return STATUS_OK; } return STATUS_NEUTRAL; -- cgit From bb064e24a37791838c49f5db2537acfe3cfbc36f Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jan 2022 21:16:46 +0100 Subject: Add aspect EM containers to creative tab --- .../thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java | 2 +- .../elementalMatter/definitions/AspectDefinitionCompatEnabled.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java index 2d531858d0..c3231e6132 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java @@ -11,7 +11,7 @@ import java.util.HashMap; */ public class AspectDefinitionCompat { public static AspectDefinitionCompat aspectDefinitionCompat; - static final HashMap defToAspect = new HashMap<>(); + public static final HashMap defToAspect = new HashMap<>(); public static final HashMap aspectToDef = new HashMap<>(); public void run(){} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java index da930a1d79..3cb2eafccd 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java @@ -8,6 +8,7 @@ import thaumcraft.api.aspects.Aspect; import java.util.ArrayList; import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition.*; +import static com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM.STACKS_REGISTERED; /** * Created by Tec on 21.05.2017. @@ -58,6 +59,8 @@ public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat } } } + + STACKS_REGISTERED.addAll(defToAspect.keySet()); } @Override -- cgit From de8bf3e68e9e4d7cee485d0d6951a4e4ccb5859d Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 9 Jan 2022 19:19:04 +0100 Subject: Cleanup and update EM turret projectile --- .../entity/projectiles/projectileEM.java | 55 +++++++++------------- .../tileentity/turret/TileTurretHeadEM.java | 19 +++++++- .../core/transformations/bTransformationInfo.java | 7 ++- .../item/DebugElementalInstanceContainer_EM.java | 5 +- 4 files changed, 49 insertions(+), 37 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java index 702ed77315..92acd71ecd 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java @@ -18,6 +18,8 @@ import openmodularturrets.tileentity.turretbase.TurretBase; import openmodularturrets.util.PlayerUtil; import openmodularturrets.util.TurretHeadUtil; +import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.AVOGADRO_CONSTANT; + /** * Created by Bass on 27/07/2017. @@ -26,7 +28,7 @@ public class projectileEM extends LaserProjectile { public float gravity=0; private TurretBase turretBase; - private boolean exotic, antiMatter,isAmped; + private boolean strange, antiMatter,isAmped; private int ampLevel; @@ -45,36 +47,23 @@ public class projectileEM extends LaserProjectile { } } - public projectileEM(World par1World, TurretBase turretBase, cElementalInstanceStackMap avalableEM) { + public projectileEM(World par1World, TurretBase turretBase, cElementalInstanceStack projectileContent) { super(par1World, turretBase); this.turretBase = turretBase; - boolean onlyQuarks=true; - if(avalableEM!=null && avalableEM.hasStacks()) { - for (cElementalInstanceStack stack : avalableEM.values()) { - if (!(stack.definition instanceof eQuarkDefinition)) { - onlyQuarks = false; - } - } - if (onlyQuarks) { - avalableEM.clear(); - } else { - cElementalInstanceStack consumeFromThis=avalableEM.get(TecTech.RANDOM.nextInt(avalableEM.size())); - massFactor =(float) (consumeFromThis.definition.getMass()/ dHadronDefinition.hadron_n_.getMass()); + if(projectileContent != null){ + massFactor =(float) (projectileContent.definition.getMass()/ dHadronDefinition.hadron_n_.getMass()); - if(consumeFromThis.definition.getType()>1 || consumeFromThis.definition.getType()<-1) { - exotic = true; - } - if(consumeFromThis.definition.getType()<0) { - antiMatter = true; - } - - if (consumeFromThis.definition.getCharge() == 0) { - gravity = massFactor / 100f; - } else { - gravity = Math.min(0.0025F / Math.abs(consumeFromThis.definition.getCharge()), massFactor / 100f); - } + if(projectileContent.definition.getType()>1 || projectileContent.definition.getType()<-1) { + strange = true; + } + if(projectileContent.definition.getType()<0) { + antiMatter = true; + } - avalableEM.removeAmount(false,consumeFromThis.definition.getStackForm(1)); + if (projectileContent.definition.getCharge() == 0) { + gravity = massFactor / 100f; + } else { + gravity = Math.min(0.0025F / Math.abs(projectileContent.definition.getCharge()), massFactor / 100f); } } //todo make the recipe require some overflow hatches @@ -97,7 +86,8 @@ public class projectileEM extends LaserProjectile { worldObj.createExplosion(null, movingobjectposition.blockX + 0.5D, movingobjectposition.blockY + 0.5D, - movingobjectposition.blockZ + 0.5D, (exotic?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); + movingobjectposition.blockZ + 0.5D, + (strange ?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); } else { return; } @@ -107,18 +97,18 @@ public class projectileEM extends LaserProjectile { if(movingobjectposition.entityHit != null && !worldObj.isRemote) { worldObj.playSoundEffect(posX, posY, posZ, "openmodularturrets:laserHit", ConfigHandler.getTurretSoundVolume(), TecTech.RANDOM.nextFloat() + 0.5F); if(movingobjectposition.entityHit != null && !worldObj.isRemote) { - float damage = (exotic?10:1) * TecTech.configTecTech.TURRET_DAMAGE_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1); + float damage = (strange ?10:1) * TecTech.configTecTech.TURRET_DAMAGE_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1); if(movingobjectposition.entityHit instanceof EntityPlayer) { if(canDamagePlayer((EntityPlayer)movingobjectposition.entityHit)) { - movingobjectposition.entityHit.setFire((exotic?10:1)*2); + movingobjectposition.entityHit.setFire((strange ?10:1)*2); movingobjectposition.entityHit.attackEntityFrom(new NormalDamageSource("laser"), damage); if(antiMatter) { movingobjectposition.entityHit.hurtResistantTime = 0; } } } else { - movingobjectposition.entityHit.setFire((exotic?10:1)*2); + movingobjectposition.entityHit.setFire((strange ?10:1)*2); movingobjectposition.entityHit.attackEntityFrom(new NormalDamageSource("laser"), damage); if(antiMatter) { movingobjectposition.entityHit.hurtResistantTime = 0; @@ -133,7 +123,8 @@ public class projectileEM extends LaserProjectile { worldObj.createExplosion(null, movingobjectposition.entityHit.posX, movingobjectposition.entityHit.posY, - movingobjectposition.entityHit.posZ, (exotic?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); + movingobjectposition.entityHit.posZ, + (strange ?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); } } } 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 2de6b39c4c..1c8d476a36 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,8 +1,12 @@ 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.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; import net.minecraft.entity.Entity; import net.minecraft.item.Item; @@ -13,6 +17,8 @@ import openmodularturrets.handler.ConfigHandler; import openmodularturrets.tileentity.turrets.TurretHead; import openmodularturrets.util.TurretHeadUtil; +import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.*; + /** * Created by Bass on 27/07/2017. */ @@ -64,7 +70,18 @@ public class TileTurretHeadEM extends TurretHead{ @Override public final TurretProjectile createProjectile(World world, Entity target, ItemStack ammo) { - return new projectileEM(world, TurretHeadUtil.getTurretBase(worldObj, xCoord, yCoord, zCoord), hatchContentPointer); + while(hatchContentPointer!=null && hatchContentPointer.hasStacks()) { + cElementalInstanceStack stack = hatchContentPointer.get(TecTech.RANDOM.nextInt(hatchContentPointer.size())); + if(stack.amount fluidQuantization=new HashMap<>(32); public static final Map itemQuantization=new HashMap<>(32); diff --git a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java index 6850b24e0f..bfd7d266c0 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java @@ -31,8 +31,7 @@ import java.util.TreeSet; import static com.github.technus.tectech.Reference.MODID; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; -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_144; +import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.*; import static cpw.mods.fml.relauncher.Side.CLIENT; import static net.minecraft.util.StatCollector.translateToLocal; @@ -145,7 +144,7 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE for(iElementalDefinition definition: STACKS_REGISTERED){ list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getName()+" 1 mol"),new cElementalInstanceStackMap(new cElementalInstanceStack(definition, AVOGADRO_CONSTANT)))); list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getName()+" 144 mol"),new cElementalInstanceStackMap(new cElementalInstanceStack(definition, AVOGADRO_CONSTANT_144)))); - list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getName()+" 1000 mol"),new cElementalInstanceStackMap(new cElementalInstanceStack(definition, AVOGADRO_CONSTANT *1000)))); + list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getName()+" 1000 mol"),new cElementalInstanceStackMap(new cElementalInstanceStack(definition, AVOGADRO_CONSTANT_1000)))); } } -- cgit From e84ef7e2100575e7941a6329edc56dafa261aee7 Mon Sep 17 00:00:00 2001 From: Tec Date: Thu, 13 Jan 2022 22:27:27 +0100 Subject: This should make the EM anomaly and projectile as it was --- .../tectech/compatibility/gtpp/GtppAtomLoader.java | 53 ++--- .../openComputers/AvrArchitecture.java | 2 +- .../entity/projectiles/projectileEM.java | 105 ++++----- .../tileentity/turret/TileTurretHeadEM.java | 11 +- .../definitions/AspectDefinitionCompat.java | 30 --- .../definitions/AspectDefinitionCompatEnabled.java | 81 ------- .../definitions/dComplexAspectDefinition.java | 8 +- .../definitions/ePrimalAspectDefinition.java | 7 +- .../definitions/iElementalAspect.java | 8 - .../transformations/AspectDefinitionCompat.java | 29 +++ .../AspectDefinitionCompatEnabled.java | 81 +++++++ .../thing/metaTileEntity/multi/EssentiaCompat.java | 10 +- .../multi/EssentiaCompatEnabled.java | 33 +-- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 74 ++++-- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 14 +- .../github/technus/tectech/loader/MainLoader.java | 6 +- .../tectech/loader/thing/MachineLoader.java | 13 +- .../tectech/mechanics/anomaly/AnomalyHandler.java | 247 +++++++++++++-------- .../tectech/mechanics/anomaly/CancerCommand.java | 10 +- .../tectech/mechanics/anomaly/ChargeCommand.java | 10 +- .../core/transformations/bTransformationInfo.java | 53 +++-- .../definitions/complex/dAtomDefinition.java | 163 +++++++------- .../definitions/complex/dHadronDefinition.java | 4 +- .../GT_MetaTileEntity_Hatch_OverflowElemental.java | 10 +- .../multi/GT_MetaTileEntity_EM_decay.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 12 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 2 +- .../thing/tileEntity/ReactorSimTileEntity.java | 2 +- 28 files changed, 590 insertions(+), 490 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java delete mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java delete mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/iElementalAspect.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/transformations/AspectDefinitionCompat.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/transformations/AspectDefinitionCompatEnabled.java (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java index 32db2caed9..f3120fda25 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.compatibility.gtpp; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo; import gregtech.api.enums.OrePrefixes; import net.minecraftforge.fluids.FluidStack; @@ -58,34 +59,34 @@ public class GtppAtomLoader implements Runnable{ } //endregion - TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), AVOGADRO_CONSTANT_144), getFluid("NEON",144)); + bTransformationInfo.TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), AVOGADRO_CONSTANT_144), getFluid("NEON",144)); generate("GERMANIUM",true,true); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(32), AVOGADRO_CONSTANT_144), OrePrefixes.dust, getUnlocalizedName("GERMANIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(34), AVOGADRO_CONSTANT_144), OrePrefixes.dust, getUnlocalizedName("SELENIUM"),1); - TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(35), AVOGADRO_CONSTANT_144), getFluid("BROMINE",144)); - TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(36), AVOGADRO_CONSTANT_144), getFluid("KRYPTON",144)); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(40), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("ZIRCONIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(43), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("TECHNETIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(44), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RUTHENIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(45), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RHODIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(53), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("IODINE"),1); - TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(54), AVOGADRO_CONSTANT_144),getFluid("XENON",144)); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(72), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("HAFNIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(75), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RHENIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(81), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("THALLIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(32), AVOGADRO_CONSTANT_144), OrePrefixes.dust, getUnlocalizedName("GERMANIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(34), AVOGADRO_CONSTANT_144), OrePrefixes.dust, getUnlocalizedName("SELENIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(35), AVOGADRO_CONSTANT_144), getFluid("BROMINE",144)); + bTransformationInfo.TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(36), AVOGADRO_CONSTANT_144), getFluid("KRYPTON",144)); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(40), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("ZIRCONIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(43), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("TECHNETIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(44), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RUTHENIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(45), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RHODIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(53), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("IODINE"),1); + bTransformationInfo.TRANSFORMATION_INFO.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(54), AVOGADRO_CONSTANT_144),getFluid("XENON",144)); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(72), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("HAFNIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(75), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RHENIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(81), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("THALLIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(84), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("POLONIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(85), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("ASTATINE"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(87), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("FRANCIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(88), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RADIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(89), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("ACTINIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(91), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("PROTACTINIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(93), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("NEPTUNIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(84), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("POLONIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(85), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("ASTATINE"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(87), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("FRANCIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(88), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("RADIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(89), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("ACTINIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(91), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("PROTACTINIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(93), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("NEPTUNIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(96), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("CURIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(97), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("BERKELIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(98), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("CALIFORNIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(99), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("EINSTEINIUM"),1); - TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(100), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("FERMIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(96), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("CURIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(97), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("BERKELIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(98), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("CALIFORNIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(99), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("EINSTEINIUM"),1); + bTransformationInfo.TRANSFORMATION_INFO.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(100), AVOGADRO_CONSTANT_144),OrePrefixes.dust, getUnlocalizedName("FERMIUM"),1); } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java b/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java index 2842a71df3..595d814fc5 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java @@ -21,7 +21,7 @@ import li.cil.oc.api.machine.Signal; import li.cil.oc.common.SaveHandler; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import org.apache.commons.io.IOUtils; +import org.apache.commons.compress.utils.IOUtils; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java index 92acd71ecd..a0b6106151 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java @@ -1,10 +1,8 @@ package com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import gregtech.api.GregTech_API; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -18,8 +16,6 @@ import openmodularturrets.tileentity.turretbase.TurretBase; import openmodularturrets.util.PlayerUtil; import openmodularturrets.util.TurretHeadUtil; -import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.AVOGADRO_CONSTANT; - /** * Created by Bass on 27/07/2017. @@ -33,6 +29,7 @@ public class projectileEM extends LaserProjectile { private int ampLevel; private float massFactor; + private double mass,charge; public projectileEM(World par1World) { super(par1World); @@ -51,6 +48,8 @@ public class projectileEM extends LaserProjectile { super(par1World, turretBase); this.turretBase = turretBase; if(projectileContent != null){ + mass=projectileContent.getMass(); + charge=projectileContent.getCharge(); massFactor =(float) (projectileContent.definition.getMass()/ dHadronDefinition.hadron_n_.getMass()); if(projectileContent.definition.getType()>1 || projectileContent.definition.getType()<-1) { @@ -66,66 +65,70 @@ public class projectileEM extends LaserProjectile { gravity = Math.min(0.0025F / Math.abs(projectileContent.definition.getCharge()), massFactor / 100f); } } - //todo make the recipe require some overflow hatches - - //todo add more subspace pollution } @Override protected void onImpact(MovingObjectPosition movingobjectposition) { if(ticksExisted > 1) { - if(movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - Block hitBlock = worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); - if(hitBlock != null){ - if (hitBlock.getMaterial().isSolid() && TecTech.configTecTech.ENABLE_TURRET_EXPLOSIONS && antiMatter) { - worldObj.playSoundEffect(posX, posY, posZ, "openmodularturrets:laserHit", ConfigHandler.getTurretSoundVolume(), TecTech.RANDOM.nextFloat() + 0.5F); - GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1.0F, - movingobjectposition.blockX, - movingobjectposition.blockY, - movingobjectposition.blockZ); - worldObj.createExplosion(null, - movingobjectposition.blockX + 0.5D, - movingobjectposition.blockY + 0.5D, - movingobjectposition.blockZ + 0.5D, - (strange ?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); - } else { - return; - } - } - } - - if(movingobjectposition.entityHit != null && !worldObj.isRemote) { + if(!worldObj.isRemote){ worldObj.playSoundEffect(posX, posY, posZ, "openmodularturrets:laserHit", ConfigHandler.getTurretSoundVolume(), TecTech.RANDOM.nextFloat() + 0.5F); - if(movingobjectposition.entityHit != null && !worldObj.isRemote) { - float damage = (strange ?10:1) * TecTech.configTecTech.TURRET_DAMAGE_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1); - - if(movingobjectposition.entityHit instanceof EntityPlayer) { - if(canDamagePlayer((EntityPlayer)movingobjectposition.entityHit)) { + switch (movingobjectposition.typeOfHit){ + case BLOCK: + Block hitBlock = worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); + if(hitBlock != null){ + if (TecTech.configTecTech.ENABLE_TURRET_EXPLOSIONS && antiMatter && hitBlock.getMaterial().isSolid()) { + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1.0F, + movingobjectposition.blockX, + movingobjectposition.blockY, + movingobjectposition.blockZ); + worldObj.createExplosion(null, + movingobjectposition.blockX + 0.5D, + movingobjectposition.blockY + 0.5D, + movingobjectposition.blockZ + 0.5D, + TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * (strange ? 10 : 1) * massFactor * (isAmped ? ampLevel * .1f + 1 : 1) * (ticksExisted / 250f), true); + } else { + return; + } + } + break; + case ENTITY: + float damage = (strange ?10:1) * TecTech.configTecTech.TURRET_DAMAGE_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1); + + if(movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer player=(EntityPlayer)movingobjectposition.entityHit; + if(canDamagePlayer(player)) { + movingobjectposition.entityHit.setFire((strange ?10:1)*2); + movingobjectposition.entityHit.attackEntityFrom(new NormalDamageSource("laser"), damage); + if(antiMatter) { + movingobjectposition.entityHit.hurtResistantTime = 0; + } + if(strange){ + TecTech.anomalyHandler.addCancer(player,mass); + } + if(charge!=0) { + TecTech.anomalyHandler.addCharge(player,charge); + } + } + } else { movingobjectposition.entityHit.setFire((strange ?10:1)*2); movingobjectposition.entityHit.attackEntityFrom(new NormalDamageSource("laser"), damage); if(antiMatter) { movingobjectposition.entityHit.hurtResistantTime = 0; } } - } else { - movingobjectposition.entityHit.setFire((strange ?10:1)*2); - movingobjectposition.entityHit.attackEntityFrom(new NormalDamageSource("laser"), damage); - if(antiMatter) { - movingobjectposition.entityHit.hurtResistantTime = 0; + + if (TecTech.configTecTech.ENABLE_TURRET_EXPLOSIONS && antiMatter) { + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1.0F, + (int)movingobjectposition.entityHit.posX, + (int)movingobjectposition.entityHit.posY, + (int)movingobjectposition.entityHit.posZ); + worldObj.createExplosion(null, + movingobjectposition.entityHit.posX, + movingobjectposition.entityHit.posY, + movingobjectposition.entityHit.posZ, + (strange ?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); } - } - - if (TecTech.configTecTech.ENABLE_TURRET_EXPLOSIONS && antiMatter) { - GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1.0F, - (int)movingobjectposition.entityHit.posX, - (int)movingobjectposition.entityHit.posY, - (int)movingobjectposition.entityHit.posZ); - worldObj.createExplosion(null, - movingobjectposition.entityHit.posX, - movingobjectposition.entityHit.posY, - movingobjectposition.entityHit.posZ, - (strange ?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); - } + break; } } setDead(); 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 1c8d476a36..fd039a0630 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 @@ -5,8 +5,6 @@ import com.github.technus.tectech.compatibility.openmodularturrets.entity.projec 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.stacks.cElementalInstanceStack; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; import net.minecraft.entity.Entity; import net.minecraft.item.Item; @@ -17,7 +15,8 @@ import openmodularturrets.handler.ConfigHandler; import openmodularturrets.tileentity.turrets.TurretHead; import openmodularturrets.util.TurretHeadUtil; -import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.*; +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. @@ -72,8 +71,8 @@ public class TileTurretHeadEM extends TurretHead{ 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 defToAspect = new HashMap<>(); - public static final HashMap aspectToDef = new HashMap<>(); - - public void run(){} - - Object getAspect(cElementalDefinition definition){ - return null; - } - - String getAspectTag(cElementalDefinition definition){ - return null; - } - - iElementalDefinition getDefinition(String aspect){ - return null; - } -} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java deleted file mode 100644 index 3cb2eafccd..0000000000 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions; - -import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; -import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; -import thaumcraft.api.aspects.Aspect; - -import java.util.ArrayList; - -import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition.*; -import static com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM.STACKS_REGISTERED; - -/** - * Created by Tec on 21.05.2017. - */ -public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat { - @Override - public void run(){ - defToAspect.put(magic_air,"aer"); - defToAspect.put(magic_earth,"terra"); - defToAspect.put(magic_fire,"ignis"); - defToAspect.put(magic_water,"aqua"); - defToAspect.put(magic_order,"ordo"); - defToAspect.put(magic_entropy,"perditio"); - - aspectToDef.put("aer",magic_air); - aspectToDef.put("terra",magic_earth); - aspectToDef.put("ignis",magic_fire); - aspectToDef.put("aqua",magic_water); - aspectToDef.put("ordo",magic_order); - aspectToDef.put("perditio",magic_entropy); - - ArrayList list=Aspect.getCompoundAspects(); - Aspect[] array= list.toArray(new Aspect[0]); - while (!list.isEmpty()) { - for (Aspect aspect : array) { - if (list.contains(aspect)) { - Aspect[] content = aspect.getComponents(); - if (content.length != 2) { - list.remove(aspect); - }else if(aspectToDef.containsKey(content[0].getTag()) && aspectToDef.containsKey(content[1].getTag())){ - try { - dComplexAspectDefinition newAspect; - if(content[0].getTag().equals(content[1].getTag())){ - newAspect = new dComplexAspectDefinition(aspectToDef.get(content[0].getTag()).getStackForm(2) - ); - }else{ - newAspect = new dComplexAspectDefinition(aspectToDef.get(content[0].getTag()).getStackForm(1), aspectToDef.get(content[1].getTag()).getStackForm(1) - ); - } - aspectToDef.put(aspect.getTag(),newAspect); - defToAspect.put(newAspect,aspect.getTag()); - }catch (tElementalException e) { - /**/ - }finally { - list.remove(aspect); - } - } - } - } - } - - STACKS_REGISTERED.addAll(defToAspect.keySet()); - } - - @Override - Aspect getAspect(cElementalDefinition definition) { - return Aspect.getAspect(defToAspect.get(definition)); - } - - @Override - String getAspectTag(cElementalDefinition definition) { - return defToAspect.get(definition); - } - - @Override - iElementalDefinition getDefinition(String aspect) { - return aspectToDef.get(aspect); - } - -} 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 ddef29b214..8f570c1247 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 @@ -1,6 +1,7 @@ package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions; 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; @@ -24,7 +25,7 @@ import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by Tec on 06.05.2017. */ -public final class dComplexAspectDefinition extends cElementalDefinition implements iElementalAspect { +public final class dComplexAspectDefinition extends cElementalDefinition { private final int hash; public final double mass; @@ -252,11 +253,6 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme return null; } - @Override - public Object materializeIntoAspect() { - return AspectDefinitionCompat.aspectDefinitionCompat.getAspect(this); - } - @Override public iElementalDefinition getAnti() { return null; 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 02e7d2fe21..9c6d107bff 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 @@ -8,7 +8,7 @@ import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by Tec on 06.05.2017. */ -public final class ePrimalAspectDefinition extends cElementalPrimitive implements iElementalAspect { +public final class ePrimalAspectDefinition extends cElementalPrimitive { public static final ePrimalAspectDefinition magic_air = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Air"), "a`", 1e1D, 35), magic_earth = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Earth"), "e`", 1e9D, 34), @@ -35,11 +35,6 @@ public final class ePrimalAspectDefinition extends cElementalPrimitive implement return translateToLocal("tt.keyword.Primal") + ": " + name; } - @Override - public Object materializeIntoAspect() { - return AspectDefinitionCompat.aspectDefinitionCompat.getAspect(this); - } - @Override public boolean isTimeSpanHalfLife() { return false; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/iElementalAspect.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/iElementalAspect.java deleted file mode 100644 index 3cb2d8e5e8..0000000000 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/iElementalAspect.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.github.technus.tectech.compatibility.thaumcraft.element