From 258f37066093a6b1ebb5d2a2e24157eaaa2ee866 Mon Sep 17 00:00:00 2001 From: Technus Date: Wed, 6 Sep 2017 21:03:25 +0200 Subject: Refactor m8 --- .../com/github/technus/tectech/CommonValues.java | 20 +- .../technus/tectech/auxiliary/Reference.java | 2 +- .../dreamcraft/DreamCraftRecipeLoader.java | 11 ++ .../tectech/compatibility/gtpp/GtppAtomLoader.java | 45 +++++ .../compatibility/thaumcraft/EssentiaCompat.java | 30 +++ .../thaumcraft/EssentiaCompatEnabled.java | 69 +++++++ .../definitions/AspectDefinitionCompat.java | 30 +++ .../definitions/AspectDefinitionCompatEnabled.java | 81 ++++++++ .../definitions/dComplexAspectDefinition.java | 209 +++++++++++++++++++++ .../definitions/ePrimalAspectDefinition.java | 42 +++++ .../thaumcraft/definitions/iElementalAspect.java | 8 + .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 139 ++++++++++++++ .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 144 ++++++++++++++ .../definitions/dAtomDefinition.java | 2 +- .../technus/tectech/gtppAddon/GtppAtomLoader.java | 45 ----- .../tectech/loader/DreamCraftRecipeLoader.java | 11 -- .../technus/tectech/loader/ElementalLoader.java | 4 +- .../technus/tectech/loader/MachineLoader.java | 4 +- .../github/technus/tectech/loader/MainLoader.java | 12 +- .../technus/tectech/loader/RecipeLoader.java | 1 + .../technus/tectech/magicAddon/EssentiaCompat.java | 30 --- .../tectech/magicAddon/EssentiaCompatEnabled.java | 69 ------- .../definitions/AspectDefinitionCompat.java | 30 --- .../definitions/AspectDefinitionCompatEnabled.java | 81 -------- .../definitions/dComplexAspectDefinition.java | 209 --------------------- .../definitions/ePrimalAspectDefinition.java | 42 ----- .../magicAddon/definitions/iElementalAspect.java | 8 - .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 139 -------------- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 144 -------------- .../tectech/thing/block/QuantumGlassItem.java | 4 +- .../tectech/thing/casing/GT_Item_CasingsTT.java | 4 +- .../tectech/thing/casing/GT_Item_HintTT.java | 4 +- .../thing/item/ConstructableTriggerItem.java | 2 +- .../tectech/thing/item/DebugContainer_EM.java | 2 +- .../tectech/thing/item/DefinitionContainer_EM.java | 2 +- .../tectech/thing/item/ParametrizerMemoryCard.java | 2 +- .../GT_MetaTileEntity_Hatch_DataConnector.java | 6 +- .../hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java | 2 +- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 8 +- .../hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 2 +- .../GT_MetaTileEntity_Hatch_MufflerElemental.java | 6 +- .../hatch/GT_MetaTileEntity_Hatch_Param.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Rack.java | 6 +- .../hatch/GT_MetaTileEntity_Hatch_Uncertainty.java | 2 +- .../multi/GT_MetaTileEntity_EM_annihilation.java | 2 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 2 +- .../multi/GT_MetaTileEntity_EM_collider.java | 2 +- .../multi/GT_MetaTileEntity_EM_computer.java | 2 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 2 +- .../multi/GT_MetaTileEntity_EM_decay.java | 2 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 2 +- .../multi/GT_MetaTileEntity_EM_junction.java | 2 +- .../multi/GT_MetaTileEntity_EM_machine.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_research.java | 2 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 2 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_switch.java | 2 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 2 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 2 +- .../multi/GT_MetaTileEntity_MultiblockBase_EM.java | 14 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 2 +- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 2 +- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 2 +- .../GT_MetaTileEntity_DebugPowerGenerator.java | 2 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 2 +- 68 files changed, 888 insertions(+), 887 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompat.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompat.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/ePrimalAspectDefinition.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/iElementalAspect.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java create mode 100644 src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java delete mode 100644 src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompat.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompatEnabled.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/definitions/AspectDefinitionCompat.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/definitions/AspectDefinitionCompatEnabled.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/definitions/dComplexAspectDefinition.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/definitions/ePrimalAspectDefinition.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/definitions/iElementalAspect.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java delete mode 100644 src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/CommonValues.java b/src/main/java/com/github/technus/tectech/CommonValues.java index 0b01377a95..aba9944770 100644 --- a/src/main/java/com/github/technus/tectech/CommonValues.java +++ b/src/main/java/com/github/technus/tectech/CommonValues.java @@ -6,22 +6,22 @@ import net.minecraft.util.EnumChatFormatting; * Created by danie_000 on 11.01.2017. */ public final class CommonValues { - public final static String tecMark = + public final static String TEC_MARK = EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.BLUE + ": Elemental Matter"; - public final static String bassMark = + public final static String BASS_MARK = EnumChatFormatting.BLUE + "Bass" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.BLUE + ": Theta Movement"; - public final static byte decayAt = 0;// hatches compute decays - 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 + public final static byte DECAY_AT = 0;// hatches compute decays + public final static byte MULTI_PURGE_1_AT = 2;// multiblocks clean their hatches 1 + public final static byte MOVE_AT = 4;// move stuff around + public final static byte RECIPE_AT = 6;// move stuff around + public final static byte MULTI_PURGE_2_AT = 8;// multiblocks clean their hatches 2 + public final static byte OVERFLOW_AT = 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 byte MULTI_CHECK_AT = 12;// multiblock checks it's state + public final static byte DISPERSE_AT = 14;// overflow hatches perform disperse } 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 4363d8ca88..cc5202636a 100644 --- a/src/main/java/com/github/technus/tectech/auxiliary/Reference.java +++ b/src/main/java/com/github/technus/tectech/auxiliary/Reference.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.auxiliary; -public class Reference { +public final class Reference { public static final String MODID = "tectech"; public static final String NAME = "TecTech - Tec Technology!"; public static final String VERSION = "GRADLETOKEN_VERSION"; diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java new file mode 100644 index 0000000000..c870d7d829 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -0,0 +1,11 @@ +package com.github.technus.tectech.compatibility.dreamcraft; + +/** + * Created by Tec on 06.08.2017. + */ +public class DreamCraftRecipeLoader implements Runnable { + @Override + public void run() { + + } +} 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 new file mode 100644 index 0000000000..13e76073a5 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java @@ -0,0 +1,45 @@ +package com.github.technus.tectech.compatibility.gtpp; + +import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack; +import gregtech.api.enums.OrePrefixes; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MaterialGenerator; + +import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.getBestUnstableIsotope; +import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.getFirstStableIsotope; +import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.transformation; + +public class GtppAtomLoader implements Runnable{ + @Override + public void run() { + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), 144), ELEMENT.getInstance().NEON.getFluid(144)); + MaterialGenerator.generate(ELEMENT.getInstance().GERMANIUM); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(32), 144), OrePrefixes.dust, ELEMENT.getInstance().GERMANIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(34), 144), OrePrefixes.dust, ELEMENT.getInstance().SELENIUM.getUnlocalizedName(),1); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(35), 144), ELEMENT.getInstance().BROMINE.getFluid(144)); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(36), 144), ELEMENT.getInstance().KRYPTON.getFluid(144)); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(40), 144),OrePrefixes.dust, ELEMENT.getInstance().ZIRCONIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(43), 144),OrePrefixes.dust, ELEMENT.getInstance().TECHNETIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(44), 144),OrePrefixes.dust, ELEMENT.getInstance().RUTHENIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(45), 144),OrePrefixes.dust, ELEMENT.getInstance().RHODIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(53), 144),OrePrefixes.dust, ELEMENT.getInstance().IODINE.getUnlocalizedName(),1); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(54), 144),ELEMENT.getInstance().XENON.getFluid(144)); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(72), 144),OrePrefixes.dust, ELEMENT.getInstance().HAFNIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(75), 144),OrePrefixes.dust, ELEMENT.getInstance().RHENIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(81), 144),OrePrefixes.dust, ELEMENT.getInstance().THALLIUM.getUnlocalizedName(),1); + + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(84),144),OrePrefixes.dust, ELEMENT.getInstance().POLONIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(85),144),OrePrefixes.dust, ELEMENT.getInstance().ASTATINE.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(87),144),OrePrefixes.dust, ELEMENT.getInstance().FRANCIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(88),144),OrePrefixes.dust, ELEMENT.getInstance().RADIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(89),144),OrePrefixes.dust, ELEMENT.getInstance().ACTINIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(91),144),OrePrefixes.dust, ELEMENT.getInstance().PROTACTINIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(93),144),OrePrefixes.dust, ELEMENT.getInstance().NEPTUNIUM.getUnlocalizedName(),1); + + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(96),144),OrePrefixes.dust, ELEMENT.getInstance().CURIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(97),144),OrePrefixes.dust, ELEMENT.getInstance().BERKELIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(98),144),OrePrefixes.dust, ELEMENT.getInstance().CALIFORNIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(99),144),OrePrefixes.dust, ELEMENT.getInstance().EINSTEINIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(100),144),OrePrefixes.dust, ELEMENT.getInstance().FERMIUM.getUnlocalizedName(),1); + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompat.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompat.java new file mode 100644 index 0000000000..dc0c55439d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompat.java @@ -0,0 +1,30 @@ +package com.github.technus.tectech.compatibility.thaumcraft; + +import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; +import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; +import net.minecraft.tileentity.TileEntity; + +/** + * Created by Tec on 21.05.2017. + */ +public class EssentiaCompat { + public static EssentiaCompat essentiaContainerCompat; + + public void run(){} + + public boolean check(GT_MetaTileEntity_MultiblockBase_EM meta){ + return false; + } + + public TileEntity getContainer(GT_MetaTileEntity_MultiblockBase_EM meta){ + return null; + } + + public boolean putElementalInstanceStack(TileEntity conatainer, cElementalInstanceStack stack){ + return false; + } + + public cElementalInstanceStack getFromContainer(TileEntity container){ + return null; + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java new file mode 100644 index 0000000000..fd50ff3af1 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java @@ -0,0 +1,69 @@ +package com.github.technus.tectech.compatibility.thaumcraft; + +import com.github.technus.tectech.elementalMatter.classes.cElementalDefinition; +import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; +import com.github.technus.tectech.compatibility.thaumcraft.definitions.iElementalAspect; +import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; +import net.minecraft.tileentity.TileEntity; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IAspectContainer; +import thaumcraft.common.tiles.TileEssentiaReservoir; +import thaumcraft.common.tiles.TileJarFillable; + +import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectToDef; + +/** + * Created by Tec on 21.05.2017. + */ +public class EssentiaCompatEnabled extends EssentiaCompat { + @Override + public void run() { + + } + + @Override + public boolean check(GT_MetaTileEntity_MultiblockBase_EM meta) { + TileEntity tile =meta.getBaseMetaTileEntity().getTileEntityAtSide(meta.getBaseMetaTileEntity().getBackFacing()); + return tile!=null && (tile instanceof TileEssentiaReservoir) || (tile instanceof TileJarFillable); + } + + @Override + public TileEntity getContainer(GT_MetaTileEntity_MultiblockBase_EM meta) { + TileEntity tile =meta.getBaseMetaTileEntity().getTileEntityAtSide(meta.getBaseMetaTileEntity().getBackFacing()); + return tile!=null && !tile.isInvalid() && (tile instanceof TileEssentiaReservoir) || (tile instanceof TileJarFillable)?tile:null; + } + + @Override + public boolean putElementalInstanceStack(TileEntity container,cElementalInstanceStack stack){ + if(container==null || container.isInvalid())return false; + if((container instanceof IAspectContainer) && (stack.definition instanceof iElementalAspect)){ + Aspect aspect=(Aspect)(((iElementalAspect) stack.definition).materializeIntoAspect()); + if(aspect!=null){ + ((IAspectContainer) container).addToContainer(aspect,1); + return true; + } + } + return false; + } + + @Override + public cElementalInstanceStack getFromContainer(TileEntity container){ + if(container==null || container.isInvalid())return null; + if(container instanceof IAspectContainer){ + AspectList aspects=((IAspectContainer) container).getAspects(); + if(aspects!=null){ + Aspect[] aspectsArr= aspects.getAspects(); + if(aspectsArr!=null && aspectsArr[0]!=null){ + if (((IAspectContainer) container).takeFromContainer(aspectsArr[0],1)){ + cElementalDefinition def=aspectToDef.get(aspectsArr[0].getTag()); + if(def!=null){ + return new cElementalInstanceStack(def,1); + } + } + } + } + } + return null; + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompat.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompat.java new file mode 100644 index 0000000000..8e2c3a6684 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompat.java @@ -0,0 +1,30 @@ +package com.github.technus.tectech.compatibility.thaumcraft.definitions; + + +import com.github.technus.tectech.elementalMatter.classes.cElementalDefinition; +import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; + +import java.util.HashMap; + +/** + * Created by Tec on 21.05.2017. + */ +public class AspectDefinitionCompat { + public static AspectDefinitionCompat aspectDefinitionCompat; + static final HashMap 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/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java new file mode 100644 index 0000000000..c8ce016a20 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java @@ -0,0 +1,81 @@ +package com.github.technus.tectech.compatibility.thaumcraft.definitions; + +import com.github.technus.tectech.elementalMatter.classes.cElementalDefinition; +import com.github.technus.tectech.elementalMatter.classes.tElementalException; +import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; +import thaumcraft.api.aspects.Aspect; + +import java.util.ArrayList; + +import static com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition.*; + +/** + * Created by Tec on 21.05.2017. + */ +public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat { + 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); + } + } + } + } + } + } + + @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/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java new file mode 100644 index 0000000000..667072a62e --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java @@ -0,0 +1,209 @@ +package com.github.technus.tectech.compatibility.thaumcraft.definitions; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.elementalMatter.classes.*; +import com.github.technus.tectech.elementalMatter.definitions.eBosonDefinition; +import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; +import net.minecraft.nbt.NBTTagCompound; + +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.elementalMatter.classes.cElementalDecay.noDecay; +import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectDefinitionCompat; + +/** + * Created by Tec on 06.05.2017. + */ +public final class dComplexAspectDefinition extends cElementalDefinition implements iElementalAspect { + private final int hash; + public final float mass; + + 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)); + } + + public dComplexAspectDefinition(cElementalDefinitionStack... aspects) throws tElementalException { + this(true, new cElementalDefinitionStackMap(aspects)); + } + + private dComplexAspectDefinition(boolean check, cElementalDefinitionStack... aspects) throws tElementalException { + this(check, new cElementalDefinitionStackMap(aspects)); + } + + public dComplexAspectDefinition(cElementalDefinitionStackMap aspects) throws tElementalException { + this(true, aspects); + } + + private dComplexAspectDefinition(boolean check, cElementalDefinitionStackMap aspects) throws tElementalException { + if (check && !canTheyBeTogether(aspects)) throw new tElementalException("Hadron Definition error"); + this.aspectStacks = aspects; + float mass=0; + for(cElementalDefinitionStack stack:aspects.values()){ + mass+=stack.getMass(); + } + this.mass=mass; + hash=super.hashCode(); + } + + //public but u can just try{}catch(){} the constructor it still calls this method + private static boolean canTheyBeTogether(cElementalDefinitionStackMap stacks) { + int amount = 0; + for (cElementalDefinitionStack aspects : stacks.values()) { + if (aspects.definition instanceof dComplexAspectDefinition || aspects.definition instanceof ePrimalAspectDefinition) + amount += aspects.amount; + else return false; + } + return amount==2; + } + + @Override + public String getName() { + String name= aspectDefinitionCompat.getAspectTag(this); + if(name!=null){ + name=name.substring(0,1).toUpperCase()+name.substring(1); + }else{ + name=getSymbol(); + } + return "Aspect: "+name; + } + + @Override + public String getSymbol() { + String symbol = ""; + for (cElementalDefinitionStack aspect : aspectStacks.values()) { + if (aspect.definition instanceof ePrimalAspectDefinition) { + for (int i = 0; i < aspect.amount; i++) { + symbol += aspect.definition.getSymbol(); + } + } else { + symbol+="("; + for (int i = 0; i < aspect.amount; i++) { + symbol += aspect.definition.getSymbol(); + } + symbol+=")"; + } + } + return symbol; + } + + @Override + public NBTTagCompound toNBT() { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setByte("t", nbtType); + cElementalDefinitionStack[] quarkStacksValues = aspectStacks.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))); + try { + return new dComplexAspectDefinition(stacks); + } catch (tElementalException e) { + if (DEBUG_MODE) e.printStackTrace(); + return null; + } + } + + @Override + public float getRawLifeTime() { + return -1; + } + + @Override + public int getCharge() { + return 0; + } + + @Override + public byte getType() { + return 0; + } + + @Override + public byte getColor() { + return -1; + } + + @Override + public cElementalDefinitionStackMap getSubParticles() { + return aspectStacks; + } + + @Override + public cElementalDecay[] getEnergeticDecayInstant() { + return new cElementalDecay[]{new cElementalDecay(0.75F, aspectStacks), eBosonDefinition.deadEnd}; + } + + @Override + public cElementalDecay[] getNaturalDecayInstant() { + return noDecay; + } + + @Override + public cElementalDecay[] getDecayArray() { + return noDecay; + } + + @Override + public float getMass() { + return mass; + } + + @Override + public aFluidDequantizationInfo someAmountIntoFluidStack() { + return null; + } + + @Override + public aItemDequantizationInfo someAmountIntoItemsStack() { + return null; + } + + @Override + public aOredictDequantizationInfo someAmountIntoOredictStack() { + return null; + } + + public Object materializeIntoAspect() { + return aspectDefinitionCompat.getAspect(this); + } + + @Override + public iElementalDefinition getAnti() { + return null; + } + + public static void run() { + try { + cElementalDefinition.addCreatorFromNBT(nbtType, dComplexAspectDefinition.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-96); + } catch (Exception e) { + if (DEBUG_MODE) e.printStackTrace(); + } + if(DEBUG_MODE) + TecTech.Logger.info("Registered Elemental Matter Class: ComplexAspect "+nbtType+" "+(-96)); + } + + @Override + public byte getClassType() { + return -96; + } + + @Override + public int hashCode() { + return hash; + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/ePrimalAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/ePrimalAspectDefinition.java new file mode 100644 index 0000000000..ff203da5bc --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/ePrimalAspectDefinition.java @@ -0,0 +1,42 @@ +package com.github.technus.tectech.compatibility.thaumcraft.definitions; + +import com.github.technus.tectech.elementalMatter.classes.cElementalPrimitive; + +import static com.github.technus.tectech.elementalMatter.classes.cElementalDecay.noDecay; +import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectDefinitionCompat; + +/** + * Created by Tec on 06.05.2017. + */ +public final class ePrimalAspectDefinition extends cElementalPrimitive implements iElementalAspect { + public static final ePrimalAspectDefinition + magic_air = new ePrimalAspectDefinition("Air", "a`", 0, 1e1F, 0, -1, 35), + magic_earth = new ePrimalAspectDefinition("Earth", "e`", 0, 1e9F, 0, -1, 34), + magic_fire = new ePrimalAspectDefinition("Fire", "f`", 0, 1e3F, 0, -1, 33), + magic_water = new ePrimalAspectDefinition("Water", "w`", 0, 1e7F, 0, -1, 32), + magic_order = new ePrimalAspectDefinition("Order", "o`", 0, 1e5F, 0, -1, 30), + magic_entropy = new ePrimalAspectDefinition("Entropy", "e`", 0, 1e5F, 0, -1, 31); + + private ePrimalAspectDefinition(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() { + magic_air.init(null, -1F, -1, -1, noDecay); + magic_earth.init(null, -1F, -1, -1, noDecay); + magic_fire.init(null, -1F, -1, -1, noDecay); + magic_water.init(null, -1F, -1, -1, noDecay); + magic_order.init(null, -1F, -1, -1, noDecay); + magic_entropy.init(null, -1F, -1, -1, noDecay); + } + + @Override + public String getName() { + return "Primal: " + name; + } + + public Object materializeIntoAspect() { + return aspectDefinitionCompat.getAspect(this); + } +} + diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/iElementalAspect.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/iElementalAspect.java new file mode 100644 index 0000000000..0f96d3d4be --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/iElementalAspect.java @@ -0,0 +1,8 @@ +package com.github.technus.tectech.compatibility.thaumcraft.definitions; + +/** + * Created by Tec on 21.05.2017. + */ +public interface iElementalAspect { + Object materializeIntoAspect(); +} 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 new file mode 100644 index 0000000000..4ad1d4e9b1 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -0,0 +1,139 @@ +package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; +import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; +import com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.thing.block.QuantumGlassBlock; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; + +import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static gregtech.api.enums.GT_Values.E; +import static com.github.technus.tectech.Util.V; + +/** + * Created by danie_000 on 17.12.2016. + */ +public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + private TileEntity container; + + //region Structure + //use multi A energy inputs, use less power the longer it runs + private static final String[][] shape = new String[][]{ + {" "," . "," ",}, + {"0A0",E,"0A0",}, + {"121","232","121",}, + {"\"\"\"","\"2\"","\"\"\"",}, + {"202","0!0","202",}, + }; + private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{0,0,4,8}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalInputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatch", + "3 - Elemental Overflow Hatches or Elemental Casing", + "General - Some sort of Essentia Storage", + }; + //endregion + + public GT_MetaTileEntity_EM_essentiaDequantizer(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_EM_essentiaDequantizer(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_essentiaDequantizer(this.mName); + } + + @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if(hintsOnly){ + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12); + } else{ + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) + iGregTechTileEntity.getWorld().setBlock( + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12,2); + } + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + container=essentiaContainerCompat.getContainer(this); + if (eInputHatches.size() < 1 || container==null) { + stopMachine(); + return false; + } + cElementalInstanceStackMap inputHatchContainer=eInputHatches.get(0).getContainerHandler(); + if(inputHatchContainer.hasStacks()){ + cElementalInstanceStack stack = inputHatchContainer.getFirst(); + inputHatchContainer.removeAmount(false,new cElementalInstanceStack(stack.definition,1)); + if(!essentiaContainerCompat.putElementalInstanceStack(container,stack)) + cleanStackEM_EM(stack); + mMaxProgresstime = 20; + mEfficiencyIncrease = 10000; + eAmpereFlow=1; + if (stack.definition instanceof ePrimalAspectDefinition) { + mEUt = (int) -V[8]; + } else { + mEUt = (int) -V[10]; + } + return true; + } + mEfficiencyIncrease = 0; + mMaxProgresstime = 0; + return false; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK, + "Transform quantum form back to...", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "regular one, but why?" + }; + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java new file mode 100644 index 0000000000..b38fab7286 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -0,0 +1,144 @@ +package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; +import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; +import com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.thing.block.QuantumGlassBlock; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; + +import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static gregtech.api.enums.GT_Values.E; +import static com.github.technus.tectech.Util.V; + +/** + * Created by danie_000 on 17.12.2016. + */ +public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + private TileEntity container; + + //region Structure + //use multi A energy inputs, use less power the longer it runs + private static final String[][] shape = new String[][]{ + {" "," . "," ",}, + {"0A0",E,"0A0",}, + {"121","232","121",}, + {"\"\"\"","\"1\"","\"\"\"",}, + {"010","1!1","010",}, + }; + private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{0,4,0,8}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalOutputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset+4, textureOffset + 4}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Output Hatch", + "3 - Elemental Overflow Hatches or Elemental Casing", + "General - Some sort of Essentia Storage", + }; + //endregion + + public GT_MetaTileEntity_EM_essentiaQuantizer(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_EM_essentiaQuantizer(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_essentiaQuantizer(this.mName); + } + + @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if(hintsOnly){ + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12); + } else{ + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) + iGregTechTileEntity.getWorld().setBlock( + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12,2); + } + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK, + "Conveniently convert regular stuff into quantum form.", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "To make it more inconvenient." + }; + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + container=essentiaContainerCompat.getContainer(this); + cElementalInstanceStack newStack=essentiaContainerCompat.getFromContainer(container); + if(newStack!=null){ + mMaxProgresstime = 20; + mEfficiencyIncrease = 10000; + eAmpereFlow=1; + outputEM = new cElementalInstanceStackMap[]{ + new cElementalInstanceStackMap(newStack) + }; + if (newStack.definition instanceof ePrimalAspectDefinition) { + mEUt = (int) -V[8]; + } else { + mEUt = (int) -V[10]; + } + return true; + } + mEfficiencyIncrease = 0; + mMaxProgresstime = 0; + return false; + } + + @Override + public void outputAfterRecipe_EM() { + if (eOutputHatches.size() < 1) { + stopMachine(); + return; + } + eOutputHatches.get(0).getContainerHandler().putUnifyAll(outputEM[0]); + outputEM=null; + } +} 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 7350beea8e..5b7d8c349b 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 @@ -3,7 +3,7 @@ package com.github.technus.tectech.elementalMatter.definitions; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; -import com.github.technus.tectech.gtppAddon.GtppAtomLoader; +import com.github.technus.tectech.compatibility.gtpp.GtppAtomLoader; import cpw.mods.fml.common.Loader; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; diff --git a/src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java b/src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java deleted file mode 100644 index 1cefb4c170..0000000000 --- a/src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.github.technus.tectech.gtppAddon; - -import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack; -import gregtech.api.enums.OrePrefixes; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.MaterialGenerator; - -import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.getBestUnstableIsotope; -import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.getFirstStableIsotope; -import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.transformation; - -public class GtppAtomLoader implements Runnable{ - @Override - public void run() { - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), 144), ELEMENT.getInstance().NEON.getFluid(144)); - MaterialGenerator.generate(ELEMENT.getInstance().GERMANIUM); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(32), 144), OrePrefixes.dust, ELEMENT.getInstance().GERMANIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(34), 144), OrePrefixes.dust, ELEMENT.getInstance().SELENIUM.getUnlocalizedName(),1); - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(35), 144), ELEMENT.getInstance().BROMINE.getFluid(144)); - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(36), 144), ELEMENT.getInstance().KRYPTON.getFluid(144)); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(40), 144),OrePrefixes.dust, ELEMENT.getInstance().ZIRCONIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(43), 144),OrePrefixes.dust, ELEMENT.getInstance().TECHNETIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(44), 144),OrePrefixes.dust, ELEMENT.getInstance().RUTHENIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(45), 144),OrePrefixes.dust, ELEMENT.getInstance().RHODIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(53), 144),OrePrefixes.dust, ELEMENT.getInstance().IODINE.getUnlocalizedName(),1); - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(54), 144),ELEMENT.getInstance().XENON.getFluid(144)); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(72), 144),OrePrefixes.dust, ELEMENT.getInstance().HAFNIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(75), 144),OrePrefixes.dust, ELEMENT.getInstance().RHENIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(81), 144),OrePrefixes.dust, ELEMENT.getInstance().THALLIUM.getUnlocalizedName(),1); - - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(84),144),OrePrefixes.dust, ELEMENT.getInstance().POLONIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(85),144),OrePrefixes.dust, ELEMENT.getInstance().ASTATINE.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(87),144),OrePrefixes.dust, ELEMENT.getInstance().FRANCIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(88),144),OrePrefixes.dust, ELEMENT.getInstance().RADIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(89),144),OrePrefixes.dust, ELEMENT.getInstance().ACTINIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(91),144),OrePrefixes.dust, ELEMENT.getInstance().PROTACTINIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(93),144),OrePrefixes.dust, ELEMENT.getInstance().NEPTUNIUM.getUnlocalizedName(),1); - - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(96),144),OrePrefixes.dust, ELEMENT.getInstance().CURIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(97),144),OrePrefixes.dust, ELEMENT.getInstance().BERKELIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(98),144),OrePrefixes.dust, ELEMENT.getInstance().CALIFORNIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(99),144),OrePrefixes.dust, ELEMENT.getInstance().EINSTEINIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(100),144),OrePrefixes.dust, ELEMENT.getInstance().FERMIUM.getUnlocalizedName(),1); - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java deleted file mode 100644 index cd64c9f537..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.technus.tectech.loader; - -/** - * Created by Tec on 06.08.2017. - */ -public class DreamCraftRecipeLoader implements Runnable { - @Override - public void run() { - - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java b/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java index 5cc1133d88..eaff4b6cf4 100644 --- a/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java @@ -2,8 +2,8 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.elementalMatter.classes.cElementalPrimitive; import com.github.technus.tectech.elementalMatter.definitions.*; -import com.github.technus.tectech.magicAddon.definitions.dComplexAspectDefinition; -import com.github.technus.tectech.magicAddon.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.compatibility.thaumcraft.definitions.dComplexAspectDefinition; +import com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition; /** * Created by danie_000 on 16.11.2016. diff --git a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java index ebe8642d26..580f9a9f2f 100644 --- a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.loader; -import com.github.technus.tectech.magicAddon.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_essentiaDequantizer; -import com.github.technus.tectech.magicAddon.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_essentiaQuantizer; +import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_essentiaDequantizer; +import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_essentiaQuantizer; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; import com.github.technus.tectech.thing.metaTileEntity.multi.*; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index 9a1e1be66c..95f8a2ed53 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -1,10 +1,10 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.magicAddon.EssentiaCompat; -import com.github.technus.tectech.magicAddon.EssentiaCompatEnabled; -import com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompat; -import com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompatEnabled; +import com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat; +import com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompatEnabled; +import com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat; +import com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompatEnabled; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; @@ -25,8 +25,8 @@ import java.util.List; import static com.github.technus.tectech.TecTech.hasThaumcraft; import static com.github.technus.tectech.TecTech.mainTab; -import static com.github.technus.tectech.magicAddon.EssentiaCompat.essentiaContainerCompat; -import static com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompat.aspectDefinitionCompat; +import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; +import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectDefinitionCompat; import static gregtech.api.enums.GT_Values.W; public final class MainLoader {//TODO add checks for - is mod loaded dreamcraft to enable higher tier machinery. (above UV), or implement a check for GT tier values. diff --git a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java index 3e99920c9e..a0c72baf51 100644 --- a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.loader; +import com.github.technus.tectech.compatibility.dreamcraft.DreamCraftRecipeLoader; import com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition; import cpw.mods.fml.common.Loader; diff --git a/src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompat.java b/src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompat.java deleted file mode 100644 index 2cc647ea7f..0000000000 --- a/src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompat.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.github.technus.tectech.magicAddon; - -import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; -import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; -import net.minecraft.tileentity.TileEntity; - -/** - * Created by Tec on 21.05.2017. - */ -public class EssentiaCompat { - public static EssentiaCompat essentiaContainerCompat; - - public void run(){} - - public boolean check(GT_MetaTileEntity_MultiblockBase_EM meta){ - return false; - } - - public TileEntity getContainer(GT_MetaTileEntity_MultiblockBase_EM meta){ - return null; - } - - public boolean putElementalInstanceStack(TileEntity conatainer, cElementalInstanceStack stack){ - return false; - } - - public cElementalInstanceStack getFromContainer(TileEntity container){ - return null; - } -} diff --git a/src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompatEnabled.java b/src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompatEnabled.java deleted file mode 100644 index 8e5b774a50..0000000000 --- a/src/main/java/com/github/technus/tectech/magicAddon/EssentiaCompatEnabled.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.github.technus.tectech.magicAddon; - -import com.github.technus.tectech.elementalMatter.classes.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; -import com.github.technus.tectech.magicAddon.definitions.iElementalAspect; -import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; -import net.minecraft.tileentity.TileEntity; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.aspects.IAspectContainer; -import thaumcraft.common.tiles.TileEssentiaReservoir; -import thaumcraft.common.tiles.TileJarFillable; - -import static com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompat.aspectToDef; - -/** - * Created by Tec on 21.05.2017. - */ -public class EssentiaCompatEnabled extends EssentiaCompat { - @Override - public void run() { - - } - - @Override - public boolean check(GT_MetaTileEntity_MultiblockBase_EM meta) { - TileEntity tile =meta.getBaseMetaTileEntity().getTileEntityAtSide(meta.getBaseMetaTileEntity().getBackFacing()); - return tile!=null && (tile instanceof TileEssentiaReservoir) || (tile instanceof TileJarFillable); - } - - @O