diff options
author | Alkalus <draknyte1@hotmail.com> | 2021-05-20 23:07:24 +0000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2021-05-20 23:07:24 +0000 |
commit | 7881c840421c191e8c4249fc303e184fa1cbf9a8 (patch) | |
tree | 0e1f8d8d19ca14e14dfb16c1ed49750935612dfa /src/Java/gtPlusPlus/core/handler | |
parent | de40c882cb16535deae1c29b22f1a535747db536 (diff) | |
parent | 5316a0ffcbc403e17a06d4c9e28d57e202f0aafe (diff) | |
download | GT5-Unofficial-7881c840421c191e8c4249fc303e184fa1cbf9a8.tar.gz GT5-Unofficial-7881c840421c191e8c4249fc303e184fa1cbf9a8.tar.bz2 GT5-Unofficial-7881c840421c191e8c4249fc303e184fa1cbf9a8.zip |
Merged in MultiFixes (pull request #11)
MultiFixes
Diffstat (limited to 'src/Java/gtPlusPlus/core/handler')
8 files changed, 337 insertions, 201 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/BookHandler.java b/src/Java/gtPlusPlus/core/handler/BookHandler.java index d9d3efe680..4bfd39e9a3 100644 --- a/src/Java/gtPlusPlus/core/handler/BookHandler.java +++ b/src/Java/gtPlusPlus/core/handler/BookHandler.java @@ -3,6 +3,8 @@ package gtPlusPlus.core.handler; import java.util.HashMap; import java.util.Map; +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.recipe.common.CI; @@ -22,6 +24,7 @@ public class BookHandler { public static BookTemplate book_ModularBauble; public static BookTemplate book_MultiMachineManual; public static BookTemplate book_NuclearManual; + public static BookTemplate book_MultiChemicalPlant; public static void run(){ @@ -56,45 +59,45 @@ public class BookHandler { "Power Storage & You [Version 0.64]", "Alkalus", new String[] { - //Page 1 - "So, when it comes to power storage you relaly have three seperate options:\n"+ - " \n"+ - "Battery Buffers,\n"+ - "Energy Buffers,\n"+ - "The Power Sub-Station\n", - //Page 2 - "Battery Buffer\n" + - " \n" + - "Is rather portable. Allowing you to throw set one up and insert batteries where ever you may need."+"\n"+ - "They output 1A for each battery stored inside, upto a maximum of 16A.", - //Page 3 - "Energy Buffer\n" + - " \n" + - "Is a more optimal choice for storage in your base. Once placed down, they cannot be moved without losing all stored power."+"\n"+ - "Energy Buffers can output 4A from the output side, however accept 16A as input.", - //Page 4 - "The Power Sub-Station"+ - " \n"+ - "Is used for storing Insane amounts of power later game."+"\n"+ - "Consumes 2% of the average voltage of all energy type hatches every tick."+"\n", - //Page 5 - "Allows Insertation/Removal of power from the rear face of the controller, swap with a screwdriver."+"\n"+ - "Variable Height Structure, between 4-16Y. Inserted Redox Cells dictate max energy tier of structure."+"\n", - //Page 6 - "Redox Cells cannot be placed into the Top or Bottom layer and only take up 3xhx3 internally."+"\n"+ - "Different Tier cells CANNOT be mixed together."+"\n", - //Page 7 - "All Hatches Must be HV at a Minimum, this minimum tier is in place to stop people abusing ULV/LV hatches to lower the avg/t."+"\n"+ - "Currently the GUI will NOT display anything at all until the structure forms, this is a known bug."+"\n", - //Page 8 - "Valid Hatches:\n"+ - "Energy Hatch,\n"+ - "Dynamo Hatch,\n"+ - "Charging Bus,\n"+ - "Discharging Bus,\n"+ - "Dynamo Buffer,\n"+ - "Multi-Amp Dynamo Hatch.\n\n\n"+ - "Structure MUST contain at least one energy input and one energy output hatch." + //Page 1 + "So, when it comes to power storage you relaly have three seperate options:\n"+ + " \n"+ + "Battery Buffers,\n"+ + "Energy Buffers,\n"+ + "The Power Sub-Station\n", + //Page 2 + "Battery Buffer\n" + + " \n" + + "Is rather portable. Allowing you to throw set one up and insert batteries where ever you may need."+"\n"+ + "They output 1A for each battery stored inside, upto a maximum of 16A.", + //Page 3 + "Energy Buffer\n" + + " \n" + + "Is a more optimal choice for storage in your base. Once placed down, they cannot be moved without losing all stored power."+"\n"+ + "Energy Buffers can output 4A from the output side, however accept 16A as input.", + //Page 4 + "The Power Sub-Station"+ + " \n"+ + "Is used for storing Insane amounts of power later game."+"\n"+ + "Consumes 2% of the average voltage of all energy type hatches every tick."+"\n", + //Page 5 + "Allows Insertation/Removal of power from the rear face of the controller, swap with a screwdriver."+"\n"+ + "Variable Height Structure, between 4-16Y. Inserted Redox Cells dictate max energy tier of structure."+"\n", + //Page 6 + "Redox Cells cannot be placed into the Top or Bottom layer and only take up 3xhx3 internally."+"\n"+ + "Different Tier cells CANNOT be mixed together."+"\n", + //Page 7 + "All Hatches Must be HV at a Minimum, this minimum tier is in place to stop people abusing ULV/LV hatches to lower the avg/t."+"\n"+ + "Currently the GUI will NOT display anything at all until the structure forms, this is a known bug."+"\n", + //Page 8 + "Valid Hatches:\n"+ + "Energy Hatch,\n"+ + "Dynamo Hatch,\n"+ + "Charging Bus,\n"+ + "Discharging Bus,\n"+ + "Dynamo Buffer,\n"+ + "Multi-Amp Dynamo Hatch.\n\n\n"+ + "Structure MUST contain at least one energy input and one energy output hatch." }); //Test Novel @@ -102,7 +105,7 @@ public class BookHandler { "Manual_Modular_Bauble", "How to: Modular Baubles", "Alkalus", new String[] { "Concept: This idea came from wanting flexibility. \n" + - "First step, Build a Modularity table to begin customisation of your Bauble. \n" + "First step, Build a Modularity table to begin customisation of your Bauble. \n" + " After this has been constructed, you can now combine the upgrades listed within this book to improve the baubles level/100.", "Defence:\n" + "Can be upgraded by combining metal plates with the bauble. \n" @@ -127,7 +130,7 @@ public class BookHandler { "[Fluid Work] Mode B - Allows the multiblock to function as a Fermenter, a Fluid Extractor or an Extractor. To allow a hatch to run in Fermenter mode, insert a No. 20 circuit. For Fluid Extractor, use No. 21 and for Extractor use No. 22.", "[Misc. Work] Mode C - Allows the multiblock to function as a Laser Engraver, an Autoclave or a Fluid Solidifier. To allow a hatch to run in Laser Engraver mode, insert a No. 20 circuit. For Autoclave, use No. 21 and for Solidifier use No. 22.", }); - + book_NuclearManual = writeBookTemplate( "Manual_NuclearStuff_1", "Nuclear Chemistry [FFPP]", "Alkalus", new String[] { @@ -177,8 +180,168 @@ public class BookHandler { "Processing Plant"+ "----------------------\n"+ "This structure is used to produce the Molten Salts required to run a Liquid Fluorine Thorium Reactor [LFTR]." + + }); + + + book_MultiChemicalPlant = writeBookTemplate( + "book_Multi_ChemicalPlant", "Chemical Plant Manual", "Alkalus", + new String[] { + + // Intro + "This book will explain how the Chemical Plant is constructed, which blocks are valid to upgrade it and also how the upgrades work.", + + // Info + "Solid Casings = Plant tier" + "\n" + + "Machine Casings = Hatch tier" + "\n" + + "Higher tier coils More Speed" + "\n" + + "T1 50% , T2 100% , T3 150%, etc" + "\n", + + "Higher tier pipe casings boost parallel"+ "\n" + + "and reduce catalyst consumption" + "\n" + + "+2 parallel per tier, 20% extra chance of"+ "\n" + + "not damaging catalyst per tier" + "\n", + + // Machine Casings + "Valid Solid Machine Casings:" + "\n" + + "0 - Strong Bronze" + "\n" + + "1 - Solid Steel" + "\n" + + "2 - Sturdy Aluminium" + "\n" + + "3 - Clean Stainless Steel" + "\n" + + "4 - Stable Titanium" + "\n" + + "5 - Robust Tungstensteel" + "\n" + + "6 - Vigorous Laurenium" + "\n" + + "7 - Rugged Botmium", + + // Machine Casings + "Valid Tiered Machine Casings:" + "\n" + "\n" + + "1 - " + GT_Values.VN[0] + "\n" + + "2 - " + GT_Values.VN[1] + "\n" + + "3 - " + GT_Values.VN[2] + "\n" + + "4 - " + GT_Values.VN[3] + "\n" + + "5 - " + GT_Values.VN[4] + "\n" + + "6 - " + GT_Values.VN[5] + "\n" + + "7 - " + GT_Values.VN[6] + "\n" + + "8 - " + GT_Values.VN[7] + "\n" + + "9 - " + GT_Values.VN[8] + "\n" + + "10 - " + GT_Values.VN[9], + + // Pipe Casings + "Valid Pipe Casings:" + "\n" + "\n" + + "1 - Bronze" + "\n" + + "2 - Steel" + "\n" + + "3 - Titanium" + "\n" + + "4 - Tungstensteel", + + //Coils + "Valid Coils:" + "\n" + "\n" + + "1 - Cupronickel" + "\n" + + "2 - Kanthal" + "\n" + + "3 - Nichrome" + "\n" + + "4 - Tungstensteel" + "\n" + + "5 - HSS-G" + "\n" + + "6 - Naquadah" + "\n" + + "7 - Naquadah Alloy", + + // Requirements + "Multiblock Requirements:" + "\n" + "\n" + + "27x Coils" + "\n" + + "18x Pipe Casings" + "\n" + + "57x Tiered Machine Casings" + "\n" + + "80+ Solid Casings" + "\n" + + "1x Catalyst Housing (Catalysts cannot go inside an Input Bus)", + + // Construction Guide + "Construction Guide Pt1:" + "\n" + "\n" + + "Controller is placed on a middle casing in the bottom layer" + "\n" + + "Hatches can only be placed on the bottom layer edges", + + "Construction Guide Pt2:" + "\n" + "\n" + + "7x7x7 Hollow frame of solid casings" + "\n" + + "5x1x5 layer of solid casings (fills in top layer)" + "\n" + + "5x1x5 layer of machine casings (fills in bottom layer)", + + "Construction Guide Pt3:" + "\n" + + "In the central 3x5x3:" + "\n" + + "3x1x3 layer of Coils, surrounded by ring of Machine Casings" + "\n" + + "3x1x3 layer of Pipe Casings" + "\n" + + "3x1x3 layer of Coils" + "\n" + + "3x1x3 layer of Pipe Casings" + "\n" + + "3x1x3 layer of Coils, surrounded by ring of Machine Casings", + + // Construction Guide Info + "Information:" + "\n" + "\n" + + "A = Air" + "\n" + + "X = Solid Casing" + "\n" + + "M = Machine Casing" + "\n" + + "P = Pipe Casing" + "\n" + + "C = Coil Casing", + + "Layer 1:" + "\n" + "\n" + + "XXXXXXX" + "\n" + + "XMMMMMX" + "\n" + + "XMMMMMX" + "\n" + + "XMMMMMX" + "\n" + + "XMMMMMX" + "\n" + + "XMMMMMX" + "\n" + + "XXXXXXX", + + "Layer 2:" + "\n" + "\n" + + "AAAAAAA" + "\n" + + "AMMMMMA" + "\n" + + "AMCCCMA" + "\n" + + "AMCCCMA" + "\n" + + "AMCCCMA" + "\n" + + "AMMMMMA" + "\n" + + "AAAAAAA", + + "Layer 3:" + "\n" + "\n" + + "AAAAAAA" + "\n" + + "AAAAAAA" + "\n" + + "AAPPPAA" + "\n" + + "AAPPPAA" + "\n" + + "AAPPPAA" + "\n" + + "AAAAAAA" + "\n" + + "AAAAAAA", + + "Layer 4:" + "\n" + "\n" + + "AAAAAAA" + "\n" + + "AAAAAAA" + "\n" + + "AACCCAA" + "\n" + + "AACCCAA" + "\n" + + "AACCCAA" + "\n" + + "AAAAAAA" + "\n" + + "AAAAAAA", + + "Layer 5:" + "\n" + "\n" + + "AAAAAAA" + "\n" + + "AAAAAAA" + "\n" + + "AAPPPAA" + "\n" + + "AAPPPAA" + "\n" + + "AAPPPAA" + "\n" + + "AAAAAAA" + "\n" + + "AAAAAAA", + + "Layer 6:" + "\n" + "\n" + + "AAAAAAA" + "\n" + + "AMMMMMA" + "\n" + + "AMCCCMA" + "\n" + + "AMCCCMA" + "\n" + + "AMCCCMA" + "\n" + + "AMMMMMA" + "\n" + + "AAAAAAA", + + "Layer 7:" + "\n" + "\n" + + "XXXXXXX" + "\n" + + "XXXXXXX" + "\n" + + "XXXXXXX" + "\n" + + "XXXXXXX" + "\n" + + "XXXXXXX" + "\n" + + "XXXXXXX" + "\n" + + "XXXXXXX", }); + } @@ -189,6 +352,7 @@ public class BookHandler { public static ItemStack ItemBookWritten_ModularBaubles; public static ItemStack ItemBookWritten_MultiPowerStorage; public static ItemStack ItemBookWritten_MultiMachineManual; + public static ItemStack ItemBookWritten_MultiChemicalPlant; public static void runLater(){ ItemBookWritten_ThermalBoiler = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 0, 1); @@ -196,12 +360,21 @@ public class BookHandler { ItemBookWritten_ModularBaubles = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 2, 1); ItemBookWritten_MultiMachineManual = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 3, 1); ItemBookWritten_NuclearManual = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 4, 1); + ItemBookWritten_MultiChemicalPlant = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 5, 1); //Multiblock Manuals RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getSimpleStack(Items.lava_bucket)}, ItemBookWritten_ThermalBoiler); RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict(CI.craftingToolWrench, 1)}, ItemBookWritten_MultiMachineManual); RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict("wireGt01Tin", 1)}, ItemBookWritten_MultiPowerStorage); RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1)}, ItemBookWritten_NuclearManual); + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict("wireGt01Copper", 1)}, ItemBookWritten_MultiChemicalPlant); + + for (int i=0;i<mBookKeeperCount;i++){ + ItemStack bookstack = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, i, 1); + GT_OreDictUnificator.registerOre("bookWritten", bookstack); + GT_OreDictUnificator.registerOre("craftingBook", bookstack); + } + } private static BookTemplate writeBookTemplate(String aMapping, String aTitle, String aAuthor, String[] aPages){ diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 21f3e1d6cd..bbc0e44d7e 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -43,71 +43,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; -import gtPlusPlus.xmod.gregtech.registration.gregtech.Gregtech4Content; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAdvancedBoilers; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAdvancedMixer; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAlgaeContent; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAmazonWarehouse; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechBedrockPlatforms; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechBufferDynamos; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechComponentAssembler; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCustomHatches; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCyclotron; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFactoryGradeReplacementMultis; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFluidReactor; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeneratorsULV; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeothermalThermalGenerator; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechHiAmpTransformer; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialArcFurnace; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialBlastSmelter; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCentrifuge; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCokeOven; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCuttingFactory; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialElectrolyzer; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialExtruder; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialFishPond; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialAlloySmelter; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialFuelRefinery; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialGeneratorArray; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMacerator; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMassFabricator; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMixer; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMultiMachine; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMultiTank; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialPlatePress; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialSifter; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialThermalCentrifuge; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialTreeFarm; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWashPlant; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWiremill; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIronBlastFurnace; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIsaMill; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechLFTR; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechLargeTurbinesAndHeatExchanger; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechMiniRaFusion; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNaqReactor; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPollutionDevices; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerBreakers; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerSubStation; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRTG; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerators; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSimpleWasher; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarTower; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperChests; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTeslaTower; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThaumcraftDevices; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThreadedBuffers; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredChunkloaders; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredFluidTanks; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTreeFarmerTE; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechWirelessChargers; -import gtPlusPlus.xmod.gregtech.registration.gregtech.NewHorizonsAccelerator; +import gtPlusPlus.xmod.gregtech.registration.gregtech.*; import net.minecraft.item.ItemStack; public class COMPAT_HANDLER { @@ -220,6 +156,8 @@ public class COMPAT_HANDLER { GregtechAlgaeContent.run(); GregtechIndustrialAlloySmelter.run(); GregtechIsaMill.run(); + GregtechSteamMultis.run(); + GregtechIndustrialElementDuplicator.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java index cd25fdb1c3..9a1b551d30 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java @@ -16,6 +16,7 @@ import gtPlusPlus.xmod.ob.HANDLER_OpenBlocks; import gtPlusPlus.xmod.railcraft.HANDLER_Railcraft; import gtPlusPlus.xmod.reliquary.HANDLER_Reliquary; import gtPlusPlus.xmod.sc2.HANDLER_SC2; +import gtPlusPlus.xmod.sol.HANDLER_SpiceOfLife; import gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft; import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF; import gtPlusPlus.xmod.tinkers.HANDLER_Tinkers; @@ -39,6 +40,7 @@ public class COMPAT_IntermodStaging { HANDLER_Railcraft.preInit(); HANDLER_Reliquary.preInit(); HANDLER_OpenBlocks.preInit(); + HANDLER_SpiceOfLife.preInit(); } public static void init(FMLInitializationEvent init){ @@ -58,6 +60,7 @@ public class COMPAT_IntermodStaging { HANDLER_Railcraft.init(); HANDLER_Reliquary.init(); HANDLER_OpenBlocks.init(); + HANDLER_SpiceOfLife.init(); } public static void postInit(FMLPostInitializationEvent postinit){ @@ -77,6 +80,7 @@ public class COMPAT_IntermodStaging { HANDLER_Railcraft.postInit(); HANDLER_Reliquary.postInit(); HANDLER_OpenBlocks.postInit(); + HANDLER_SpiceOfLife.postInit(); } public static void onLoadComplete(FMLLoadCompleteEvent event) { diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java index e44c9a8f20..0567d6c5dd 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -5,19 +5,7 @@ import cpw.mods.fml.common.network.NetworkRegistry; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; -import gtPlusPlus.core.container.Container_BackpackBase; -import gtPlusPlus.core.container.Container_CircuitProgrammer; -import gtPlusPlus.core.container.Container_DecayablesChest; -import gtPlusPlus.core.container.Container_FishTrap; -import gtPlusPlus.core.container.Container_Grindle; -import gtPlusPlus.core.container.Container_ModularityTable; -import gtPlusPlus.core.container.Container_PestKiller; -import gtPlusPlus.core.container.Container_ProjectTable; -import gtPlusPlus.core.container.Container_RoundRobinator; -import gtPlusPlus.core.container.Container_SuperJukebox; -import gtPlusPlus.core.container.Container_TradeTable; -import gtPlusPlus.core.container.Container_Workbench; -import gtPlusPlus.core.container.Container_WorkbenchAdvanced; +import gtPlusPlus.core.container.*; import gtPlusPlus.core.container.box.LunchBoxContainer; import gtPlusPlus.core.container.box.MagicBagContainer; import gtPlusPlus.core.container.box.ToolBoxContainer; @@ -28,17 +16,7 @@ import gtPlusPlus.core.gui.item.GuiBaseGrindle; import gtPlusPlus.core.gui.item.box.LunchBoxGui; import gtPlusPlus.core.gui.item.box.MagicBagGui; import gtPlusPlus.core.gui.item.box.ToolBoxGui; -import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer; -import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; -import gtPlusPlus.core.gui.machine.GUI_FishTrap; -import gtPlusPlus.core.gui.machine.GUI_ModularityTable; -import gtPlusPlus.core.gui.machine.GUI_PestKiller; -import gtPlusPlus.core.gui.machine.GUI_ProjectTable; -import gtPlusPlus.core.gui.machine.GUI_RoundRobinator; -import gtPlusPlus.core.gui.machine.GUI_SuperJukebox; -import gtPlusPlus.core.gui.machine.GUI_TradeTable; -import gtPlusPlus.core.gui.machine.GUI_Workbench; -import gtPlusPlus.core.gui.machine.GUI_WorkbenchAdvanced; +import gtPlusPlus.core.gui.machine.*; import gtPlusPlus.core.interfaces.IGuiManager; import gtPlusPlus.core.inventories.BaseInventoryBackpack; import gtPlusPlus.core.inventories.BaseInventoryGrindle; @@ -46,9 +24,7 @@ import gtPlusPlus.core.inventories.box.LunchBoxInventory; import gtPlusPlus.core.inventories.box.MagicBagInventory; import gtPlusPlus.core.inventories.box.ToolBoxInventory; import gtPlusPlus.core.tileentities.base.TileEntityBase; -import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; -import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; -import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; +import gtPlusPlus.core.tileentities.general.*; import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; @@ -79,6 +55,8 @@ public class GuiHandler implements IGuiHandler { public static final int GUI14 = 13; // Super Jukebox public static final int GUI15 = 14; // Pest Killer public static final int GUI16 = 15; // Round-Robinator + public static final int GUI17 = 16; // Egg Box + public static final int GUI18 = 17; // Volumetric Flask Setter public static void init() { @@ -129,6 +107,10 @@ public class GuiHandler implements IGuiHandler { return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te); } else if (ID == GUI16) { return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); + } else if (ID == GUI17) { + return new Container_EggBox(player.inventory, (TileEntityEggBox) te); + } else if (ID == GUI18) { + return new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te); } } @@ -191,7 +173,11 @@ public class GuiHandler implements IGuiHandler { return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te); } else if (ID == GUI16) { return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); - } + } else if (ID == GUI17) { + return new GUI_EggBox(player.inventory, (TileEntityEggBox) te); + } else if (ID == GUI18) { + return new GUI_VolumetricFlaskSetter(new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te)); + } } if (ID == GUI9) { diff --git a/src/Java/gtPlusPlus/core/handler/PacketHandler.java b/src/Java/gtPlusPlus/core/handler/PacketHandler.java index 2b9d424b32..382b82df29 100644 --- a/src/Java/gtPlusPlus/core/handler/PacketHandler.java +++ b/src/Java/gtPlusPlus/core/handler/PacketHandler.java @@ -1,69 +1,91 @@ package gtPlusPlus.core.handler; -import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.simpleimpl.*; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; - +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.network.handler.AbstractClientMessageHandler; +import gtPlusPlus.core.network.packet.AbstractPacket; +import gtPlusPlus.core.network.packet.Packet_VolumetricFlaskGui; +import gtPlusPlus.core.network.packet.Packet_VolumetricFlaskGui2; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import io.netty.buffer.ByteBuf; - public class PacketHandler { - - public static SimpleNetworkWrapper packetLightning; - public PacketHandler(){ - packetLightning = NetworkRegistry.INSTANCE.newSimpleChannel("gtpp_Lightning"); - packetLightning.registerMessage(Packet_Lightning_Handler.class, Packet_Lightning.class, 0, Side.SERVER); + private static byte packetId = 0; + + private static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(CORE.MODID); + + public static final void init() { + registerMessage(Packet_VolumetricFlaskGui.class, Packet_VolumetricFlaskGui.class); + registerMessage(Packet_VolumetricFlaskGui2.class, Packet_VolumetricFlaskGui2.class); } - - - /** - * Internal Packet Handlers - * @author Alkalus - * + * Registers a message and message handler */ + private static final void registerMessage(Class handlerClass, Class messageClass) { + Side side = AbstractClientMessageHandler.class.isAssignableFrom(handlerClass) ? Side.CLIENT : Side.SERVER; + registerMessage(handlerClass, messageClass, side); + } - private class Packet_Lightning implements IMessage{ - - public void sendTo(IMessage msg, EntityPlayerMP player){ - packetLightning.sendTo(msg, player); + private static final void registerMessage(Class handlerClass, Class messageClass, Side side) { + INSTANCE.registerMessage(handlerClass, messageClass, packetId++, side); + if (AbstractPacket.class.isInstance(messageClass.getClass())) { + AbstractPacket aPacket = ReflectionUtils.createNewInstanceFromConstructor(ReflectionUtils.getConstructor(messageClass, new Class[] {}), new Object[] {}); + if (aPacket != null) { + Logger.INFO("Registered Packet: "+aPacket.getPacketName()); + } } - - public void sendToServer(String string){ - packetLightning.sendToServer(new Packet_Lightning(string)); - } - - private String text; + } + + /** + * Send this message to the specified player. + * See {@link SimpleNetworkWrapper#sendTo(IMessage, EntityPlayerMP)} + */ + public static final void sendTo(IMessage message, EntityPlayerMP player) { + INSTANCE.sendTo(message, player); + } + + /** + * Send this message to everyone within a certain range of a point. + * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, NetworkRegistry.TargetPoint)} + */ + public static final void sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) { + INSTANCE.sendToAllAround(message, point); + } - public Packet_Lightning(String text) { - this.text = text; - } + /** + * Sends a message to everyone within a certain range of the coordinates in the same dimension. + */ + public static final void sendToAllAround(IMessage message, int dimension, double x, double y, double z, double range) { + sendToAllAround(message, new NetworkRegistry.TargetPoint(dimension, x, y, z, range)); + } - @Override - public void fromBytes(ByteBuf buf) { - text = ByteBufUtils.readUTF8String(buf); // this class is very useful in general for writing more complex objects - } + /** + * Sends a message to everyone within a certain range of the player provided. + */ + public static final void sendToAllAround(IMessage message, EntityPlayer player, double range) { + sendToAllAround(message, player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, range); + } - @Override - public void toBytes(ByteBuf buf) { - ByteBufUtils.writeUTF8String(buf, text); - } - + /** + * Send this message to everyone within the supplied dimension. + * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, int)} + */ + public static final void sendToDimension(IMessage message, int dimensionId) { + INSTANCE.sendToDimension(message, dimensionId); } - - private class Packet_Lightning_Handler implements IMessageHandler<Packet_Lightning, IMessage>{ - @Override - public IMessage onMessage(Packet_Lightning message, MessageContext ctx) { - System.out.println(String.format("Received %s from %s", message.text, ctx.getServerHandler().playerEntity.getDisplayName())); - return null; // no response in this case - } - + /** + * Send this message to the server. + * See {@link SimpleNetworkWrapper#sendToServer(IMessage)} + */ + public static final void sendToServer(IMessage message) { + INSTANCE.sendToServer(message); } - - } diff --git a/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java b/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java index 8853acd4b7..b3b720497e 100644 --- a/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java +++ b/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java @@ -1,8 +1,13 @@ package gtPlusPlus.core.handler; +import java.lang.reflect.Field; + import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import net.minecraft.client.Minecraft; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.stats.AchievementList; import net.minecraftforge.event.entity.player.AchievementEvent; @@ -14,11 +19,28 @@ public class StopAnnoyingFuckingAchievements { */ @SubscribeEvent(priority=EventPriority.HIGHEST) public void FUCK_OFF(AchievementEvent event) { + if (Utils.isClient()) { + doClientStuff(); + } if (event.achievement.equals(AchievementList.openInventory)) { event.setCanceled(true); - if (Minecraft.getMinecraft() != null) { - if (Minecraft.getMinecraft().gameSettings != null) { - Minecraft.getMinecraft().gameSettings.showInventoryAchievementHint = false; + } + } + + @SideOnly(Side.CLIENT) + private final void doClientStuff() { + Class aMC = ReflectionUtils.getClass("net.minecraft.client.Minecraft"); + if (aMC != null) { + Field aInstanceMC = ReflectionUtils.getField(aMC, "theMinecraft"); + Object aMcObj = ReflectionUtils.getFieldValue(null, aInstanceMC); + Class aClazz2 = aMcObj.getClass(); + if (aClazz2 != null) { + Field aGameSettings = ReflectionUtils.getField(aClazz2, "gameSettings"); + Object aGameSettingsObj = ReflectionUtils.getFieldValue(aInstanceMC, aGameSettings); + Class aClazz3 = aGameSettingsObj.getClass(); + if (aClazz2 != null) { + Field ainvHint = ReflectionUtils.getField(aClazz3, "showInventoryAchievementHint"); + ReflectionUtils.setField(aGameSettingsObj, ainvHint, false); } } } diff --git a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java index 6da2dac38b..03bb99bb2a 100644 --- a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java @@ -1,18 +1,11 @@ package gtPlusPlus.core.handler.events; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.*; +import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard; +import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre; import java.util.ArrayList; -import java.util.Map; -import java.util.WeakHashMap; import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; @@ -20,12 +13,14 @@ import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import net.minecraftforge.common.util.FakePlayer; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.oredict.OreDictionary; -import thaumcraft.common.lib.FakeThaumcraftPlayer; public class BlockEventHandler { public static ArrayList<ItemStack> oreLimestone; diff --git a/src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java b/src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java index 3492ee4788..391672e028 100644 --- a/src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java @@ -11,14 +11,10 @@ import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.event.entity.living.LivingDropsEvent; -import thaumcraft.common.lib.FakeThaumcraftPlayer; public class EntityDeathHandler { |