diff options
author | Martin Robertz <dream-master@gmx.net> | 2023-02-16 22:18:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-16 22:18:39 +0100 |
commit | 3d54fb0243f5186a76b596c1acf1f8b029480746 (patch) | |
tree | 49360f4a7b6e3eb05d869ca19e01dc6ab8966c03 /src | |
parent | ca2921bb10732d32f52e2782f06b1bf1d0e3215d (diff) | |
parent | 397db3353bfef0f96455bd9c94e17675c7f38c44 (diff) | |
download | GT5-Unofficial-3d54fb0243f5186a76b596c1acf1f8b029480746.tar.gz GT5-Unofficial-3d54fb0243f5186a76b596c1acf1f8b029480746.tar.bz2 GT5-Unofficial-3d54fb0243f5186a76b596c1acf1f8b029480746.zip |
Merge pull request #158 from GTNewHorizons/fix/MultipleEOHFixes
Fix/MultipleEoHFixes
Diffstat (limited to 'src')
3 files changed, 23 insertions, 19 deletions
diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 0a1aef7763..17b5c88828 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -7,11 +7,8 @@ import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Iterator; -import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; -import pers.gwyog.gtneioreplugin.plugin.block.ModBlocks; - import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.loader.gui.CreativeTabEM; @@ -52,6 +49,7 @@ import gregtech.common.GT_Proxy; + "required-after:structurelib;" + "after:ComputerCraft;" + "after:OpenComputers;" + + "required-after:gtneioreplugin;" + "required-after:gregtech;" + "after:dreamcraft;" + "after:appliedenergistics2;" @@ -247,12 +245,11 @@ public class TecTech { pEvent.registerServerCommand(new ChargeCommand()); pEvent.registerServerCommand(new MassCommand()); } + } - // This must be done after game load otherwise it fails. + @Mod.EventHandler + public void onLoadCompleted(FMLLoadCompleteEvent event) { eyeOfHarmonyRecipeStorage = new EyeOfHarmonyRecipeStorage(); - // The reason we do this is to force the fields inside the class to instantiate at world load so NEI - // displays properly. - eyeOfHarmonyRecipeStorage.recipeLookUp(new ItemStack(ModBlocks.blocks.get("Ow"))); } public static EyeOfHarmonyRecipeStorage eyeOfHarmonyRecipeStorage = null; diff --git a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java index 1907906750..655a531432 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java +++ b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java @@ -111,14 +111,15 @@ public class TileEyeOfHarmony extends TileEntity { private static final Set<String> BLACKLISTED_BLOCKS = Collections .unmodifiableSet(new HashSet<>(Arrays.asList("Tf", "Ow", "ED", "EA", "VA"))); // Map of strings to blocks - private static final Map<String, Block> BLOCKS; + private static final Map<String, Block> BLOCKS = new HashMap<>(); static { // Initialize the map of blocks - BLOCKS = ModBlocks.blocks; - - // Remove blacklisted blocks from the map - BLOCKS.keySet().removeAll(BLACKLISTED_BLOCKS); + ModBlocks.blocks.forEach((dimString, dimBlock) -> { + if (!BLACKLISTED_BLOCKS.contains(dimString)) { + BLOCKS.put(dimString, dimBlock); + } + }); } private static final float MAX_ANGLE = 30; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java index ea0141dd2d..fc74091ea6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java @@ -692,8 +692,8 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl .addElement( 'H', buildHatchAdder(GT_MetaTileEntity_EM_EyeOfHarmony.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance) - .casingIndex(texturePage << 7).dot(1).buildAndChain(sBlockCasingsBA0, 12)) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus).casingIndex(texturePage << 7).dot(1) + .buildAndChain(sBlockCasingsBA0, 12)) .addElement( 'E', ofBlocksTiered( @@ -842,8 +842,13 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl return false; } - // 1 Maintenance hatch, as usual. - return (mMaintenanceHatches.size() == 1); + mHardHammer = true; + mSoftHammer = true; + mScrewdriver = true; + mCrowbar = true; + mSolderingTool = true; + mWrench = true; + return true; } @Override @@ -915,7 +920,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl + EnumChatFormatting.GRAY + " Reinforced Temporal Structure Casing.") .addStructureInfo( - EnumChatFormatting.GOLD + "31" + EnumChatFormatting.GOLD + "32" + EnumChatFormatting.GRAY + " Infinite SpaceTime Energy Boundary Casing.") .addStructureInfo( @@ -928,8 +933,6 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl + " Spacetime Compression Field Generator.") .addStructureInfo("--------------------------------------------") .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " maintenance hatch.") - .addStructureInfo( "Requires " + EnumChatFormatting.GOLD + 2 + EnumChatFormatting.GRAY + " input hatches.") .addStructureInfo( "Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " ME output hatch.") @@ -1011,6 +1014,9 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl // No item in multi gui slot. currentRecipe = eyeOfHarmonyRecipeStorage.recipeLookUp(aStack); + if (currentRecipe == null) { + return false; + } if (processRecipe(currentRecipe)) { return true; } |