diff options
| author | Alkalus <Draknyte1@hotmail.com> | 2020-03-28 02:09:24 +0000 |
|---|---|---|
| committer | Alkalus <Draknyte1@hotmail.com> | 2020-03-28 02:09:24 +0000 |
| commit | f39e8134fcef5da8bd04503c5233b2b6de249b3a (patch) | |
| tree | 5713706bbff562e41ee5ebb4c896f5beab6e396d | |
| parent | 0678527ea975b4a95eb7f3d6547b79865b0a2a0e (diff) | |
| download | GT5-Unofficial-f39e8134fcef5da8bd04503c5233b2b6de249b3a.tar.gz GT5-Unofficial-f39e8134fcef5da8bd04503c5233b2b6de249b3a.tar.bz2 GT5-Unofficial-f39e8134fcef5da8bd04503c5233b2b6de249b3a.zip | |
+ Added more 'Special Behaviour' items for my multiblocks as Examples.
+ Added '/gtpp hand' command.
+ Added TungstenSteel & Neutronium tool variants to NEI while in dev.
+ Added Large Semifluid Generator and a crafting recipe for it.
+ Added Placeholder for Adv. Assembly Line.
+ Added Distillus Upgrade Chip and a crafting recipe for it.
% Updated build.gradle.
% Reworked a few recipes.
$ Fixed ULV Overflow Covers using 0L Water in assembler. (https://github.com/GTNewHorizons/NewHorizons/issues/5700)
$ Fixed Integral Encasement I using 0L Steel in assembler. (https://github.com/GTNewHorizons/NewHorizons/issues/5617)
$ Fixed Thaumcraft based FakePlayer's triggering Fluorite drops. (https://github.com/GTNewHorizons/NewHorizons/issues/5744)
$ Fixed bad handling of hatch textures on a few multiblocks.
$ Semi-Fixed Distillus.
$ Fixed Semifluid Generator recipes.
$ Fixed Semifluid Generators crashing the game when mined.
$ Fixed bad handling of calls to ItemList.java.
$ Began work fixing all ASM to be more compatible with ProGuard.
$ Fixed compiler complaining about varargs.
^ Bumped version to 1.7.05.x.
55 files changed, 2603 insertions, 1173 deletions
diff --git a/build.gradle b/build.gradle index ab5fec70de..f8260d8e38 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ buildscript { repositories { + mavenLocal() mavenCentral() jcenter() //maven { @@ -20,8 +21,8 @@ buildscript { } dependencies { classpath "net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT" - classpath 'net.sf.proguard:proguard-gradle:6.2.2' //classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.55" + classpath 'net.sf.proguard:proguard-gradle:6.2.2' } } @@ -81,7 +82,10 @@ compileJava.options.encoding = 'UTF-8' minecraft { version = "${config.minecraft.version}-${config.forge.version}" - runDir = "eclipse" + runDir = "eclipse" + srgExtra "PK: org/dom4j gtpp/shaded/org/dom4j" + srgExtra "PK: org/javassist gtpp/shaded/org/javassist" + srgExtra "PK: org/reflections/reflections gtpp/shaded/org/reflections" } idea { module { inheritOutputDirs = true } } @@ -89,7 +93,8 @@ idea { module { inheritOutputDirs = true } } configurations { provided embedded - compile.extendsFrom provided, embedded + shade + compile.extendsFrom provided, embedded, shade } repositories { @@ -110,8 +115,35 @@ sourceSets { } } +processResources +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } + exclude '**/Thumbs.db' +} + dependencies { + // Used for productive reflection without class loading. (0.9.12 has no reliance on Guava either) + //shade group: 'org.reflections', name: 'reflections', version: '0.9.12' + //shade group: 'org.dom4j', name: 'dom4j', version: '2.1.1' + //compile group: 'org.javassist', name: 'javassist', version: '3.26.0-GA' + + //compile files('libs/gregtech-5.08.33-dev.jar') compile files('libs/gregtech-5.09.31-dev.jar') @@ -122,7 +154,7 @@ dependencies { compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev" compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev" compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev" - compile files('libs/PlayerAPI-1.7.10-1.4.jar') + compile "api.player:PlayerAPI:1.7.10-1.4" compile "com.enderio.core:EnderCore:1.7.10-0.2.0.39_beta:dev" compile "com.enderio:EnderIO:1.7.10-2.3.0.430_beta:dev" @@ -143,33 +175,17 @@ dependencies { compile "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf" } -processResources -{ - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } - exclude '**/Thumbs.db' -} - jar { archiveName = archivesBaseName + "-" + version + ".jar" manifest { attributes 'FMLCorePlugin': 'gtPlusPlus.preloader.asm.Preloader_FMLLoadingPlugin' attributes 'FMLCorePluginContainsFMLMod': 'true' } + configurations.shade.each { dep -> + from(project.zipTree(dep)){ + exclude 'META-INF', 'META-INF/**' + } + } } task generateDictionaries(type: JavaExec) { @@ -212,7 +228,7 @@ task proguard(type: proguard.gradle.ProGuardTask) { build.finalizedBy(generateDictionaries) // Obfuscate this bitch. -//build.finalizedBy(proguard) // Disabled until optimization is working 100% +build.finalizedBy(proguard) // Disabled until optimization is working 100% //build.finalizedBy(gitChangelogTask) //build.finalizedBy(curseChangelogTask) diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 6f734db111..71adfcb1c2 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -43,7 +43,6 @@ import gtPlusPlus.core.handler.events.MissingMappingsEvent; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.data.LocaleUtils; import gtPlusPlus.core.util.minecraft.HazmatUtils; @@ -65,7 +64,6 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechMiniRaFusion; import gtPlusPlus.xmod.thaumcraft.commands.CommandDumpAspects; import net.minecraft.launchwrapper.Launch; import net.minecraft.util.IIcon; -import net.minecraftforge.oredict.OreDictionary; @MCVersion(value = "1.7.10") @Mod(modid = CORE.MODID, name = CORE.name, version = CORE.VERSION, dependencies = "required-after:Forge; after:TConstruct; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO; after:tectech; after:GTRedtech; after:beyondrealitycore; after:OpenBlocks; after:IC2NuclearControl; after:TGregworks; after:StevesCarts; after:xreliquary;") @@ -203,12 +201,8 @@ public class GTplusplus implements ActionListener { Meta_GT_Proxy.postInit(); Core_Manager.postInit(); //SprinklerHandler.registerModFerts(); - - //Set Variables for Fluorite Block handling - Logger.INFO("Setting some Variables for the block break event handler."); - BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone"); - BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone"); - BlockEventHandler.fluoriteOre = FLUORIDES.FLUORITE.getOre(1); + + BlockEventHandler.init(); Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Logger.INFO("| Recipes succesfully Loaded: " + RegistrationHandler.recipesSuccess + " | Failed: " diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java new file mode 100644 index 0000000000..78341db7a1 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java @@ -0,0 +1,27 @@ +package gtPlusPlus.api.objects.minecraft.multi; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.item.ItemStack; + +public class NoEUBonusMultiBehaviour extends SpecialMultiBehaviour { + + public NoEUBonusMultiBehaviour() { + // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes. + } + + @Override + public ItemStack getTriggerItem() { + return GregtechItemList.Chip_MultiNerf_NoEuBonus.get(1); + } + + @Override + public String getTriggerItemTooltip() { + return "Prevents EU discounts on GT++ multiblocks when used"; + } + + @Override + public int getEUPercent() { + return 0; + } + +} diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java index 4dc032d01f..8137f2573d 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java @@ -1,6 +1,6 @@ package gtPlusPlus.api.objects.minecraft.multi; -import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.item.ItemStack; public class NoOutputBonusMultiBehaviour extends SpecialMultiBehaviour { @@ -11,7 +11,7 @@ public class NoOutputBonusMultiBehaviour extends SpecialMultiBehaviour { @Override public ItemStack getTriggerItem() { - return CI.getNumberedBioCircuit(22); + return GregtechItemList.Chip_MultiNerf_NoOutputBonus.get(1); } @Override diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java new file mode 100644 index 0000000000..fe7a90960d --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java @@ -0,0 +1,27 @@ +package gtPlusPlus.api.objects.minecraft.multi; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.item.ItemStack; + +public class NoSpeedBonusMultiBehaviour extends SpecialMultiBehaviour { + + public NoSpeedBonusMultiBehaviour() { + // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes. + } + + @Override + public ItemStack getTriggerItem() { + return GregtechItemList.Chip_MultiNerf_NoSpeedBonus.get(1); + } + + @Override + public String getTriggerItemTooltip() { + return "Prevents speed bonuses on GT++ multiblocks when used"; + } + + @Override + public int getSpeedBonusPercent() { + return 0; + } + +} diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index 06b6f14822..adcaa1db70 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -2,15 +2,22 @@ package gtPlusPlus.core.commands; import java.util.ArrayList; import java.util.List; +import java.util.Map; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.NBTUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.asm.AsmConfig; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @@ -84,6 +91,27 @@ public class CommandEnableDebugWhileRunning implements ICommand AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging); PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging)); } + /* else if (argString[0].toLowerCase().equals("test")) { + ItemStack mSemiFluidgen = ItemUtils.simpleMetaStack("IC2:blockGenerator", 7, 1); + final EntityPlayer P = CommandUtils.getPlayer(S); + if(mSemiFluidgen != null) { + PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen)); + } + }*/ + else if (argString[0].toLowerCase().equals("hand")) { + final EntityPlayer P = CommandUtils.getPlayer(S); + if (P != null) { + ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P); + if (aHeldItem != null) { + String aItemDisplayName = ItemUtils.getItemName(aHeldItem); + String aNbtString = tryIterateNBTData(aHeldItem); + PlayerUtils.messagePlayer(P, "["+aItemDisplayName+"] "+aNbtString); + } + else { + PlayerUtils.messagePlayer(P, "No item held."); + } + } + } else { final EntityPlayer P = CommandUtils.getPlayer(S); PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'"); @@ -117,5 +145,35 @@ public class CommandEnableDebugWhileRunning implements ICommand public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost){ return true; } + + public static String tryIterateNBTData(ItemStack aStack) { + try { + AutoMap<String> aItemDataTags = new AutoMap<String>(); + NBTTagCompound aNBT = NBTUtils.getNBT(aStack); + if (aNBT != null) { + if (!aNBT.hasNoTags()) { + Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap"); + if (mInternalMap != null) { + for (Map.Entry<?, ?> e : mInternalMap.entrySet()) { + aItemDataTags.add(e.getKey().toString()+":"+e.getValue()); + } + int a = 0; + String data = ""; + for (String tag : aItemDataTags) { + data += (tag+","); + } + if (data.endsWith(",")) { + data = data.substring(0, data.length()-2); + } + return data; + } else { + Logger.INFO("Data map reflected from NBTTagCompound was not valid."); + return "Bad NBT"; + } + } + } + } catch (Throwable t) {} + return ""; + } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 71a7b37cfc..0398b1619f 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -110,7 +110,7 @@ public class CommonProxy { Logger.INFO("[Proxy] Calling Render registrator."); registerRenderThings(); - if (!mFluidsGenerated && ItemList.valueOf("Cell_Empty").hasBeenSet()) { + if (!mFluidsGenerated && ItemList.Cell_Empty.hasBeenSet()) { Material.generateQueuedFluids(); mFluidsGenerated = true; } @@ -126,7 +126,7 @@ public class CommonProxy { registerCustomItemsForMaterials(); ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner(); - if (!mFluidsGenerated && ItemList.valueOf("Cell_Empty").hasBeenSet()) { + if (!mFluidsGenerated && ItemList.Cell_Empty.hasBeenSet()) { Material.generateQueuedFluids(); mFluidsGenerated = true; } else { diff --git a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java index ee6c15fa67..b3738e6ea2 100644 --- a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java @@ -16,17 +16,28 @@ import net.minecraft.util.ChunkCoordinates; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraftforge.common.util.FakePlayer; 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; public static ArrayList<ItemStack> blockLimestone; public static ItemStack fluoriteOre; + + public static void init() { + //Set Variables for Fluorite Block handling + Logger.INFO("Setting some Variables for the block break event handler."); + BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone"); + BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone"); + BlockEventHandler.fluoriteOre = FLUORIDES.FLUORITE.getOre(1); + } @SubscribeEvent public void onBlockLeftClicked(final PlayerInteractEvent event) { @@ -90,7 +101,7 @@ public class BlockEventHandler { ChunkCoordinates aChunkLocation = p.getPlayerCoordinates(); // Cache Fake Player - if (p instanceof FakePlayer + if (p instanceof FakePlayer || p instanceof FakeThaumcraftPlayer || (event.harvester.getCommandSenderName() == null || event.harvester.getCommandSenderName().length() <= 0) || (p.isEntityInvulnerable() && !p.canCommandSenderUseCommand(0, "") diff --git a/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java b/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java index 4abb84a33c..d98b27d163 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java @@ -4,6 +4,14 @@ import static gtPlusPlus.core.lib.CORE.RANDOM; import java.util.List; +import gregtech.api.enums.ItemList; +import gtPlusPlus.core.entity.item.ItemEntityGiantEgg; +import gtPlusPlus.core.item.base.BaseItemBurnable; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.NBTUtils; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; @@ -14,16 +22,6 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import gregtech.api.enums.ItemList; - -import gtPlusPlus.core.entity.item.ItemEntityGiantEgg; -import gtPlusPlus.core.item.base.BaseItemBurnable; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.NBTUtils; - public class ItemGiantEgg extends BaseItemBurnable { public ItemGiantEgg(String unlocalizedName, String displayName, CreativeTabs creativeTab, int stackSize, int maxDmg, @@ -138,7 +136,7 @@ public class ItemGiantEgg extends BaseItemBurnable { if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 28) { - ItemList xl = Utils.getValueOfItemList("Circuit_Chip_Stemcell", ItemList.Circuit_Elite); + ItemList xl = ItemUtils.getValueOfItemList("Circuit_Chip_Stemcell", ItemList.Circuit_Elite); if (xl != null && xl.hasBeenSet()) { mCorrectStemCells = xl.get(1); } |
