diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-01-30 02:18:50 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-01-30 02:18:50 +0000 |
commit | 7832b6223896af1b1435cdfeb52ce0210bfd2203 (patch) | |
tree | 495a4e090f0bfadbb31e3718e50e2fc7ae5e0230 /src/Java | |
parent | 222fbc044f89a2d272f0bace58c28db1e6927e0f (diff) | |
download | GT5-Unofficial-7832b6223896af1b1435cdfeb52ce0210bfd2203.tar.gz GT5-Unofficial-7832b6223896af1b1435cdfeb52ce0210bfd2203.tar.bz2 GT5-Unofficial-7832b6223896af1b1435cdfeb52ce0210bfd2203.zip |
$ Fixed 'bug' where GT wooden Pipes/Frames would require an Axe to harvest. They now require a wrench, freeing up 4 MetaIDs on BlockMachines for myself to use.
$ Fixed handling of custom BaseMetaTileEntity implementations. Meta 12-15 is now used by GT++ to deploy custom without requiring any outside items or blocks.
$ Fixed IC2 items requiring a pickaxe to mine and shitty wrench handling. You can now just mine them as usual with a wrench.
$ Fixed ALL GT/GT++ Tile Entity Tooltips. Formatted some things slighty, added additional information and additional custom tooltip support.
Diffstat (limited to 'src/Java')
50 files changed, 894 insertions, 604 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 7b340dc798..79a3bee7ba 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -101,6 +101,7 @@ public class GTplusplus implements ActionListener { //Mod Instance @Mod.Instance(CORE.MODID) public static GTplusplus instance; + public static Meta_GT_Proxy instanceGtProxy; //Material Loader public static GT_Material_Loader mGregMatLoader; @@ -168,8 +169,12 @@ public class GTplusplus implements ActionListener { Logger.INFO("Login Handler Initialized"); + mChunkLoading.preInit(event); proxy.preInit(event); + Logger.INFO("Setting up our own GT_Proxy."); + instanceGtProxy = Meta_GT_Proxy.instance; + instanceGtProxy.preInit(); Core_Manager.preInit(); } @@ -180,6 +185,7 @@ public class GTplusplus implements ActionListener { mChunkLoading.init(event); proxy.init(event); proxy.registerNetworkStuff(); + instanceGtProxy.init(); Core_Manager.init(); //Used by foreign players to generate .lang files for translation. @@ -196,6 +202,7 @@ public class GTplusplus implements ActionListener { mChunkLoading.postInit(event); proxy.postInit(event); BookHandler.runLater(); + instanceGtProxy.postInit(); Core_Manager.postInit(); //SprinklerHandler.registerModFerts(); diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 6bced739c7..9176dcc720 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -2,13 +2,13 @@ package gtPlusPlus.core.common; import static gtPlusPlus.core.lib.CORE.DEBUG; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLLoadCompleteEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.registry.GameRegistry; - -import net.minecraft.entity.Entity; - import gregtech.api.enums.ItemList; - import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.ChunkManager; @@ -18,8 +18,15 @@ import gtPlusPlus.core.entity.InternalEntityRegistry; import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; -import gtPlusPlus.core.handler.*; -import gtPlusPlus.core.handler.events.*; +import gtPlusPlus.core.handler.BookHandler; +import gtPlusPlus.core.handler.BurnableFuelHandler; +import gtPlusPlus.core.handler.COMPAT_HANDLER; +import gtPlusPlus.core.handler.COMPAT_IntermodStaging; +import gtPlusPlus.core.handler.GuiHandler; +import gtPlusPlus.core.handler.events.BlockEventHandler; +import gtPlusPlus.core.handler.events.GeneralTooltipEventHandler; +import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler; +import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; @@ -33,12 +40,11 @@ import gtPlusPlus.core.util.player.PlayerCache; import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner; import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO; import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC; -import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; +import net.minecraft.entity.Entity; import net.minecraftforge.common.ForgeChunkManager; public class CommonProxy { - public static Meta_GT_Proxy GtProxy; private boolean mFluidsGenerated = false; public CommonProxy() { @@ -49,8 +55,6 @@ public class CommonProxy { } else { Logger.INFO("We're using GTNH's Gregtech " + Utils.getGregtechVersionAsString()); } - Logger.INFO("Setting up our own GT_Proxy."); - GtProxy = Meta_GT_Proxy.instance; } public void preInit(final FMLPreInitializationEvent e) { @@ -58,38 +62,33 @@ public class CommonProxy { LoadedMods.checkLoaded(); Logger.INFO("Making sure we're ready to party!"); - - if (!DEBUG){ + if (!DEBUG) { Logger.WARNING("Development mode not enabled."); - } - else if (DEBUG){ + } else if (DEBUG) { Logger.INFO("Development mode enabled."); - } - else { + } else { Logger.WARNING("Development mode not set."); } AddToCreativeTab.initialiseTabs(); - - //Moved from Init after Debug Loading. - //29/01/18 - Alkalus - //Moved earlier into PreInit, so that Items exist before they're called upon in recipes. - //20/03/18 - Alkalus + + // Moved from Init after Debug Loading. + // 29/01/18 - Alkalus + // Moved earlier into PreInit, so that Items exist before they're called upon in + // recipes. + // 20/03/18 - Alkalus ModItems.init(); ModBlocks.init(); CI.preInit(); - - - + COMPAT_IntermodStaging.preInit(); BookHandler.run(); - //Registration of entities and renderers + // Registration of entities and renderers Logger.INFO("[Proxy] Calling Entity registrator."); registerEntities(); Logger.INFO("[Proxy] Calling Tile Entity registrator."); registerTileEntities(); - - + Logger.INFO("[Proxy] Calling Render registrator."); registerRenderThings(); @@ -97,28 +96,21 @@ public class CommonProxy { Material.generateQueuedFluids(); mFluidsGenerated = true; } - - //Must be done in pre-init. - generateMobSpawners(); - - //Internal GT Proxy - GtProxy.preInit(); - + } public void init(final FMLInitializationEvent e) { - //Debug Loading - if (CORE.DEBUG){ + // Debug Loading + if (CORE.DEBUG) { DEBUG_INIT.registerHandlers(); - } + } ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner(); - + if (!mFluidsGenerated && ItemList.valueOf("Cell_Empty").hasBeenSet()) { Material.generateQueuedFluids(); mFluidsGenerated = true; - } - else { + } else { Logger.INFO("[ERROR] Did not generate fluids at all."); Logger.WARNING("[ERROR] Did not generate fluids at all."); Logger.ERROR("[ERROR] Did not generate fluids at all."); @@ -129,22 +121,22 @@ public class CommonProxy { * Register the Event Handlers. */ - //Prevents my Safes being destroyed. + // Prevents my Safes being destroyed. Utils.registerEvent(new PickaxeBlockBreakEventHandler()); - //Block Handler for all events. + // Block Handler for all events. Utils.registerEvent(new BlockEventHandler()); Utils.registerEvent(new GeneralTooltipEventHandler()); - //Handles Custom tooltips for EIO. + // Handles Custom tooltips for EIO. Utils.registerEvent(new HandlerTooltip_EIO()); - //Handles Custom Tooltips for GC + // Handles Custom Tooltips for GC Utils.registerEvent(new HandlerTooltip_GC()); - - //Register Chunkloader + + // Register Chunkloader ForgeChunkManager.setForcedChunkLoadingCallback(GTplusplus.instance, ChunkManager.getInstance()); Utils.registerEvent(ChunkManager.getInstance()); - if (ConfigSwitches.disableZombieReinforcement){ - //Make Zombie reinforcements fuck off. + if (ConfigSwitches.disableZombieReinforcement) { + // Make Zombie reinforcements fuck off. Utils.registerEvent(new ZombieBackupSpawnEventHandler()); } @@ -152,55 +144,48 @@ public class CommonProxy { * End of Subscribe Event registration. */ - //Compat Handling + // Compat Handling COMPAT_HANDLER.registerMyModsOreDictEntries(); COMPAT_HANDLER.intermodOreDictionarySupport(); COMPAT_IntermodStaging.init(); - - //Internal GT Proxy - GtProxy.init(); } public void postInit(final FMLPostInitializationEvent e) { Logger.INFO("Cleaning up, doing postInit."); PlayerCache.initCache(); - //Make Burnables burnable - if (!CORE.burnables.isEmpty()){ + // Make Burnables burnable + if (!CORE.burnables.isEmpty()) { BurnableFuelHandler fuelHandler = new BurnableFuelHandler(); GameRegistry.registerFuelHandler(fuelHandler); - Logger.INFO("[Fuel Handler] Registering "+fuelHandler.getClass().getName()); + Logger.INFO("[Fuel Handler] Registering " + fuelHandler.getClass().getName()); } - //Compat Handling + // Compat Handling COMPAT_HANDLER.RemoveRecipesFromOtherMods(); COMPAT_HANDLER.InitialiseHandlerThenAddRecipes(); COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); COMPAT_IntermodStaging.postInit(); COMPAT_HANDLER.runQueuedRecipes(); - //Internal GT Proxy - GtProxy.postInit(); } - - public void serverStarting(final FMLServerStartingEvent e) - { + public void serverStarting(final FMLServerStartingEvent e) { COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes(); } - + public void onLoadComplete(FMLLoadCompleteEvent event) { COMPAT_IntermodStaging.onLoadComplete(event); } - public void registerNetworkStuff(){ + public void registerNetworkStuff() { GuiHandler.init(); } - public void registerEntities(){ + public void registerEntities() { InternalEntityRegistry.registerEntities(); } - public void registerTileEntities(){ + public void registerTileEntities() { ModTileEntities.init(); } @@ -213,11 +198,11 @@ public class CommonProxy { } public void generateMysteriousParticles(final Entity entity) { - + } - + public void generateMobSpawners() { - //Try register some test spawners + // Try register some test spawners Utils.createNewMobSpawner(0, EntityGiantChickenBase.class); Utils.createNewMobSpawner(1, EntitySickBlaze.class); Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class); diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java new file mode 100644 index 0000000000..39cd8c248e --- /dev/null +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java @@ -0,0 +1,266 @@ +package gtPlusPlus.preloader.asm.transformers; + +import static org.objectweb.asm.Opcodes.*; + +import java.io.IOException; +import org.apache.logging.log4j.Level; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; + +import cpw.mods.fml.relauncher.FMLRelaunchLog; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.preloader.DevHelper; +import gtPlusPlus.preloader.asm.AsmConfig; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class ClassTransformer_GT_BlockMachines_MetaPipeEntity { + + //The qualified name of the class we plan to transform. + //gregtech/common/blocks/GT_Block_Machines + + private final boolean isValid; + private final ClassReader reader; + private final ClassWriter writer; + + /** + * Utility Functions + */ + + public static String getHarvestTool(int aMeta) { + //FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to call getHarvestTool. Meta: "+aMeta); + if (aMeta >= 8 && aMeta <= 11) { + return "cutter"; + } + return "wrench"; + } + + /** + * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. + * <p/> + * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantle + * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle + * <p/> + * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle + * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle + * <p/> + * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle + * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle + * <p/> + * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle + * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle + * <p/> + * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle + * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle + * <p/> + * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle + * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle + * <p/> + * == Reserved For Alkalus (Was previously used to allow axes on wooden blocks, but that's fucking stupid.) + * <p/> + * 12 = BaseMetaTileEntity, Wrench lvl 0 to dismantle + * 13 = BaseMetaTileEntity, Wrench lvl 1 to dismantle + * <p/> + * 14 = BaseMetaTileEntity, Wrench lvl 2 to dismantle + * 15 = BaseMetaTileEntity, Wrench lvl 3 to dismantle + */ + public static byte getTileEntityBaseType(Materials mMaterial) { + //FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to call getTileEntityBaseType."); + return (byte) (mMaterial == null ? 4 : (byte) (4) + Math.max(0, Math.min(3, mMaterial.mToolQuality))); + } + + + + /** + * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. + * <p/> + * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantle + * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle + * <p/> + * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle + * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle + * <p/> + * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle + * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle + * <p/> + * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle + * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle + * <p/> + * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle + * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle + * <p/> + * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle + * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle + * <p/> + * == Reserved For Alkalus (Was previously used to allow axes on wooden blocks, but that's fucking stupid.) + * <p/> + * 12 = BaseMetaTileEntity, Wrench lvl 2 to dismantle + * 13 = BaseMetaTileEntity, Wrench lvl 2 to dismantle + * <p/> + * 14 = BaseMetaTileEntity, Wrench lvl 3 to dismantle + * 15 = BaseMetaTileEntity, Wrench lvl 3 to dismantle + */ + public static TileEntity createTileEntity(World aWorld, int aMeta) { + Logger.INFO("Creating Tile Entity with Meta of "+aMeta); + if (aMeta < 4) { + return GregTech_API.constructBaseMetaTileEntity(); + } else if (aMeta < 12) { + return new BaseMetaPipeEntity(); + } else { + return Meta_GT_Proxy.constructCustomGregtechMetaTileEntityByMeta(aMeta); + } + } + + + + String aEntityPlayer; + String aEntityPlayerMP; + String aWorld; + int mMode; + + public ClassTransformer_GT_BlockMachines_MetaPipeEntity(byte[] basicClass, boolean obfuscated, int aMode) { + mMode = aMode; + ClassReader aTempReader = null; + ClassWriter aTempWriter = null; + + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to patch in mode "+aMode+"."); + + aTempReader = new ClassReader(basicClass); + aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES); + aTempReader.accept(new localClassVisitor(aTempWriter), 0); + + if (aTempReader != null && aTempWriter != null) { + isValid = true; + } + else { + isValid = false; + } + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Valid patch? "+isValid+"."); + reader = aTempReader; + writer = aTempWriter; + + + if (reader != null && writer != null) { + aEntityPlayer = obfuscated ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayer") : "net/minecraft/entity/player/EntityPlayer"; + aEntityPlayerMP = obfuscated ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayerMP") : "net/minecraft/entity/player/EntityPlayerMP"; + aWorld = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World"; + + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting Method Injection."); + if (aMode == 0) { + injectMethod("getHarvestTool"); + injectMethod("createTileEntity"); + } + else { + injectMethod("getTileEntityBaseType"); + } + } + + } + + public boolean isValidTransformer() { + return isValid; + } + + public ClassReader getReader() { + return reader; + } + + public ClassWriter getWriter() { + return writer; + } + + public boolean injectMethod(String aMethodName) { + MethodVisitor mv; + boolean didInject = false; + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Injecting "+aMethodName+"."); + if (aMethodName.equals("getHarvestTool")) { + mv = getWriter().visitMethod(ACC_PUBLIC, "getHarvestTool", "(I)Ljava/lang/String;", null, null); + mv.visitCode(); + Label l0 = new Label(); + mv.visitLabel(l0); + mv.visitLineNumber(63, l0); + mv.visitVarInsn(ILOAD, 1); + mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity", "getHarvestTool", "(I)Ljava/lang/String;", false); + mv.visitInsn(ARETURN); + Label l1 = new Label(); + mv.visitLabel(l1); + mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l1, 0); + mv.visitLocalVariable("aMeta", "I", null, l0, l1, 1); + mv.visitMaxs(1, 2); + mv.visitEnd(); + didInject = true; + } + else if (aMethodName.equals("createTileEntity")) { + mv = getWriter().visitMethod(ACC_PUBLIC, "createTileEntity", "(Lnet/minecraft/world/World;I)Lnet/minecraft/tileentity/TileEntity;", null, null); + mv.visitCode(); + Label l0 = new Label(); + mv.visitLabel(l0); + mv.visitLineNumber(442, l0); + mv.visitVarInsn(ALOAD, 1); + mv.visitVarInsn(ILOAD, 2); + mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity", "createTileEntity", "(Lnet/minecraft/world/World;I)Lnet/minecraft/tileentity/TileEntity;", false); + mv.visitInsn(ARETURN); + Label l1 = new Label(); + mv.visitLabel(l1); + mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l1, 0); + mv.visitLocalVariable("aWorld", "Lnet/minecraft/world/World;", null, l0, l1, 1); + mv.visitLocalVariable("aMeta", "I", null, l0, l1, 2); + mv.visitMaxs(2, 3); + mv.visitEnd(); + didInject = true; + + } + else if (aMethodName.equals("getTileEntityBaseType")) { + + String aClassName = mMode == 1 ? "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item" : mMode == 2 ? "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame" : "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid"; + mv = getWriter().visitMethod(ACC_PUBLIC, "getTileEntityBaseType", "()B", null, null); + mv.visitCode(); + Label l0 = new Label(); + mv.visitLabel(l0); + mv.visitLineNumber(37, l0); + mv.visitVarInsn(ALOAD, 0); + mv.visitFieldInsn(GETFIELD, ""+aClassName+"", "mMaterial", "Lgregtech/api/enums/Materials;"); + mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity", "getTileEntityBaseType", "(Lgregtech/api/enums/Materials;)B", false); + mv.visitInsn(IRETURN); + Label l1 = new Label(); + mv.visitLabel(l1); + mv.visitLocalVariable("this", "L"+aClassName+";", null, l0, l1, 0); + mv.visitMaxs(1, 1); + mv.visitEnd(); + didInject = true; + + } + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Method injection complete."); + return didInject; + } + + public static final class localClassVisitor extends ClassVisitor { + + public localClassVisitor(ClassVisitor cv) { + super(ASM5, cv); + } + + @Override + public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { + MethodVisitor methodVisitor; + if (name.equals("getHarvestTool") || name.equals("createTileEntity") || name.equals("getTileEntityBaseType")) { + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Found method "+name+", removing."); + methodVisitor = null; + } + else { + methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); + } + return methodVisitor; + } + } + +} diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java new file mode 100644 index 0000000000..1e67619337 --- /dev/null +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java @@ -0,0 +1,206 @@ +package gtPlusPlus.preloader.asm.transformers; + +import static org.objectweb.asm.Opcodes.*; + +import java.util.Random; + +import org.apache.logging.log4j.Level; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; + +import cpw.mods.fml.relauncher.FMLRelaunchLog; +import net.minecraft.block.Block; +import net.minecraft.item.Item; + +public class ClassTransformer_IC2_GetHarvestTool { + + private final boolean isValid; + private final ClassReader reader; + private final ClassWriter writer; + private final String className; + + public static String getHarvestTool(int aMeta) { + return "wrench"; + } + + public static Item getItemDropped(Block aBlock, int meta, Random random, int fortune) { + return Item.getItemFromBlock(aBlock); + } + + public static int damageDropped(int aMeta) { + return aMeta; + } + + public ClassTransformer_IC2_GetHarvestTool(byte[] basicClass, boolean obfuscated, String aClassName) { + className = aClassName; + ClassReader aTempReader = null; + ClassWriter aTempWriter = null; + + FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, + "Attempting to patch in mode " + className + "."); + + aTempReader = new ClassReader(basicClass); + aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES); + aTempReader.accept(new localClassVisitor(aTempWriter, className), 0); + + if (aTempReader != null && aTempWriter != null) { + isValid = true; + } else { + isValid = false; + } + FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Valid patch? " + isValid + "."); + reader = aTempReader; + writer = aTempWriter; + + if (reader != null && writer != null) { + FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Attempting Method Injection."); + injectMethod("getHarvestTool"); + + if (aClassName.equals("ic2.core.block.machine.BlockMachine2") + || aClassName.equals("ic2.core.block.machine.BlockMachine3")) { + injectMethod("getItemDropped"); + injectMethod("damageDropped"); + } + else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator") + || aClassName.equals("ic2.core.block.machine.BlockMachine")) { + injectMethod("damageDropped"); + } + } + + } + + public boolean isValidTransformer() { + return isValid; + } + + public ClassReader getReader() { + return reader; + } + + public ClassWriter getWriter() { + return writer; + } + + public boolean injectMethod(String aMethodName) { + MethodVisitor mv; + boolean didInject = false; + String aFormattedClassName = className.replace('.', '/'); + ClassWriter cw = getWriter(); + + + FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Injecting " + aMethodName + "."); + if (aMethodName.equals("getHarvestTool")) { + mv = getWriter().visitMethod(ACC_PUBLIC, "getHarvestTool", "(I)Ljava/lang/String;", null, null); + mv.visitCode(); + Label l0 = new Label(); + mv.visitLabel(l0); + mv.visitLineNumber(63, l0); + mv.visitVarInsn(ILOAD, 1); + mv.visitMethodInsn(INVOKESTATIC, + "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", "getHarvestTool", + "(I)Ljava/lang/String;", false); + mv.visitInsn(ARETURN); + Label l1 = new Label(); + mv.visitLabel(l1); + mv.visitLocalVariable("this", "L" + aFormattedClassName + ";", null, l0, l1, 0); + mv.visitLocalVariable("aMeta", "I", null, l0, l1, 1); + mv.visitMaxs(1, 2); + mv.visitEnd(); + didInject = true; + } + else if (aMethodName.equals("getItemDropped")) { + mv = cw.visitMethod(ACC_PUBLIC, "getItemDropped", "(ILjava/util/Random;I)Lnet/minecraft/item/Item;", null, null); + mv.visitCode(); + Label l0 = new Label(); + mv.visitLabel(l0); + mv.visitLineNumber(44, l0); + mv.visitVarInsn(ALOAD, 0); + mv.visitVarInsn(ILOAD, 1); + mv.visitVarInsn(ALOAD, 2); + mv.visitVarInsn(ILOAD, 3); + mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", "getItemDropped", "(Lnet/minecraft/block/Block;ILjava/util/Random;I)Lnet/minecraft/item/Item;", false); + mv.visitInsn(ARETURN); + Label l1 = new Label(); + mv.visitLabel(l1); + mv.visitLocalVariable("this", "L"+aFormattedClassName+";", null, l0, l1, 0); + mv.visitLocalVariable("meta", "I", null, l0, l1, 1); + mv.visitLocalVariable("random", "Ljava/util/Random;", null, l0, l1, 2); + mv.visitLocalVariable("fortune", "I", null, l0, l1, 3); + mv.visitMaxs(4, 4); + mv.visitEnd(); + didInject = true; + } + else if (aMethodName.equals("damageDropped")) { + mv = cw.visitMethod(ACC_PUBLIC, "damageDropped", "(I)I", null, null); + mv.visitCode(); + Label l0 = new Label(); + mv.visitLabel(l0); + mv.visitLineNumber(48, l0); + mv.visitVarInsn(ILOAD, 1); + mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", "damageDropped", "(I)I", false); + mv.visitInsn(IRETURN); + Label l1 = new Label(); + mv.visitLabel(l1); + mv.visitLocalVariable("this", "L"+aFormattedClassName+";", null, l0, l1, 0); + mv.visitLocalVariable("meta", "I", null, l0, l1, 1); + mv.visitMaxs(1, 2); + mv.visitEnd(); + didInject = true; + } + FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Method injection complete."); + return didInject; + } + + public final class localClassVisitor extends ClassVisitor { + + String aClassName; + + public localClassVisitor(ClassVisitor cv, String aName) { + super(ASM5, cv); + aClassName = aName; + } + + @Override + public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { + MethodVisitor methodVisitor; + if (aClassName.equals("ic2.core.block.machine.BlockMachine2") + || aClassName.equals("ic2.core.block.machine.BlockMachine3")) { + if (name.equals("getItemDropped")) { + methodVisitor = null; + } else if (name.equals("damageDropped")) { + methodVisitor = null; + } else if (name.equals("getHarvestTool")) { + methodVisitor = null; + } else { + methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); + } + } + else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator") + || aClassName.equals("ic2.core.block.machine.BlockMachine")) { + if (name.equals("damageDropped")) { + methodVisitor = null; + } else if (name.equals("getHarvestTool")) { + methodVisitor = null; + } else { + methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); + } + } + else { + if (name.equals("getHarvestTool")) { + methodVisitor = null; + } else { + methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); + } + } + if (methodVisitor == null) { + FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, + "Found method " + name + ", removing."); + } + return methodVisitor; + } + } + +} diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java index 8a8f0d86db..df9cd658be 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java @@ -2,6 +2,8 @@ package gtPlusPlus.preloader.asm.transformers; import java.io.File; import java.io.IOException; +import java.util.Random; + import org.apache.logging.log4j.Level; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; @@ -10,16 +12,24 @@ import cpw.mods.fml.relauncher.CoreModManager; import cpw.mods.fml.relauncher.FMLRelaunchLog; import cpw.mods.fml.relauncher.ReflectionHelper; import galaxyspace.SolarSystem.core.configs.GSConfigDimensions; +import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.launchwrapper.IClassTransformer; import net.minecraft.launchwrapper.Launch; import gtPlusPlus.core.util.Utils; import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.preloader.asm.transformers.Preloader_ClassTransformer.OreDictionaryVisitor; +@SuppressWarnings("static-access") public class Preloader_Transformer_Handler implements IClassTransformer { private final boolean mEnabled = false; - public static final AsmConfig mConfig; + public static final AsmConfig mConfig; + + private static final String class_Block_Machines = "gregtech.common.blocks.GT_Block_Machines"; + private static final String class_GT_MetaPipeEntity_Item = "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item"; + private static final String class_GT_MetaPipeEntity_Frame = "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame"; + private static final String class_GT_MetaPipeEntity_Fluid = "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid"; static { mConfig = new AsmConfig(new File("config/GTplusplus/asm.cfg")); @@ -27,6 +37,7 @@ public class Preloader_Transformer_Handler implements IClassTransformer { System.out.println("[GT++ ASM] Is DevHelper Valid? "+gtPlusPlus.preloader.DevHelper.mIsValidHelper); } + @SuppressWarnings("static-access") public byte[] transform(String name, String transformedName, byte[] basicClass) { @@ -93,11 +104,6 @@ public class Preloader_Transformer_Handler implements IClassTransformer { } } - //Fix GT NBT Persistency issue - if (transformedName.equals("gregtech.common.blocks.GT_Block_Machines")) { - FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Transforming %s", transformedName); - return new ClassTransformer_GT_BlockMachines_NBT(basicClass, probablyShouldBeFalse).getWriter().toByteArray(); - } //Patching Meta Tile Tooltips if (transformedName.equals("gregtech.common.blocks.GT_Item_Machines") && mConfig.enableGtTooltipFix) { FMLRelaunchLog.log("[GT++ ASM] Gregtech Tooltip Patch", Level.INFO, "Transforming %s", transformedName); @@ -105,7 +111,55 @@ public class Preloader_Transformer_Handler implements IClassTransformer { } + if (transformedName.equals(class_Block_Machines)) { + //Fix GT NBT Persistency issue + FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Transforming %s", transformedName); + byte[] g = new ClassTransformer_GT_BlockMachines_NBT(basicClass, probablyShouldBeFalse).getWriter().toByteArray(); + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Transforming %s", transformedName); + return new ClassTransformer_GT_BlockMachines_MetaPipeEntity(g, probablyShouldBeFalse, 0).getWriter().toByteArray(); + } + if (transformedName.equals(class_GT_MetaPipeEntity_Item) || transformedName.equals(class_GT_MetaPipeEntity_Frame) || transformedName.equals(class_GT_MetaPipeEntity_Fluid)) { + FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Transforming %s", transformedName); + int mode = 0; + if (transformedName.equals(class_GT_MetaPipeEntity_Item)) { + mode = 1; + } + else if (transformedName.equals(class_GT_MetaPipeEntity_Frame)) { + mode = 2; + } + else { + mode = 3; + } + return new ClassTransformer_GT_BlockMachines_MetaPipeEntity(basicClass, probablyShouldBeFalse, mode).getWriter().toByteArray(); + } + + String[] aIC2ClassNames = new String[] { + "ic2.core.block.BlockTileEntity", + "ic2.core.block.machine.BlockMachine", + "ic2.core.block.machine.BlockMachine2", + "ic2.core.block.machine.BlockMachine3", + "ic2.core.block.kineticgenerator.block.BlockKineticGenerator", + "ic2.core.block.heatgenerator.block.BlockHeatGenerator", + "ic2.core.block.generator.block.BlockGenerator", + "ic2.core.block.reactor.block.BlockReactorAccessHatch", + "ic2.core.block.reactor.block.BlockReactorChamber", + "ic2.core.block.reactor.block.BlockReactorFluidPort", + "ic2.core.block.reactor.block.BlockReactorRedstonePort", + "ic2.core.block.reactor.block.BlockReactorVessel", + }; + + //Fix IC2 Shit + for (String y : aIC2ClassNames) { + if (transformedName.equals(y)) { + //Fix GT NBT Persistency issue + FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Transforming %s", transformedName); + return new ClassTransformer_IC2_GetHarvestTool(basicClass, probablyShouldBeFalse, transformedName).getWriter().toByteArray(); + } + } + return basicClass; } + + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java index 214fcc6a3f..939cac2779 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java @@ -8,33 +8,22 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import ic2.api.Direction; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class BaseCustomTileEntity extends BaseMetaTileEntity { - - protected boolean mHasEnoughEnergy; - - protected short mID; - protected long oOutput; - - protected long mAcceptedAmperes; - protected NBTTagCompound mRecipeStuff; - - - - protected boolean[] mActiveEUInputs; - protected boolean[] mActiveEUOutputs; + + protected NBTTagCompound mRecipeStuff2; public BaseCustomTileEntity() { super(); + Logger.INFO("Created new BaseCustomTileEntity"); } public void writeToNBT(NBTTagCompound aNBT) { @@ -47,184 +36,20 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { } try { - aNBT.setInteger("nbtVersion", GT_Mod.TOTAL_VERSION); + if (!aNBT.hasKey("ModVersion")) + aNBT.setString("ModVersion", CORE.VERSION); } catch (Throwable arg6) { GT_Log.err.println( "Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould\'ve been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); arg6.printStackTrace(GT_Log.err); } - - } - - public void readFromNBT(NBTTagCompound aNBT) { - super.readFromNBT(aNBT); - this.setInitialValuesAsNBT(aNBT, (short) 0); - } - - public void updateStatus() { - } - - public void chargeItem(ItemStack aStack) { - this.decreaseStoredEU( - (long) GT_ModHandler.chargeElectricItem(aStack, (int) Math.min(2147483647L, this.getStoredEU()), - (int) Math.min(2147483647L, this.mMetaTileEntity.getOutputTier()), false, false), - true); - } - - public void dischargeItem(ItemStack aStack) { - this.increaseStoredEnergyUnits((long) GT_ModHandler.dischargeElectricItem(aStack, - (int) Math.min(2147483647L, this.getEUCapacity() - this.getStoredEU()), - (int) Math.min(2147483647L, this.mMetaTileEntity.getInputTier()), false, false, false), true); - } - - public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) { - return !this.canAccessData() ? false - : (this.mHasEnoughEnergy = this.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy) - || this.decreaseStoredSteam(aEnergy, false) - || aIgnoreTooLessEnergy && this.decreaseStoredSteam(aEnergy, true)); - } - - public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) { - if (!this.canAccessData()) { - return false; - } else if (this.getStoredEU() >= this.getEUCapacity() && !aIgnoreTooMuchEnergy) { - return false; - } else { - this.setStoredEU(this.mMetaTileEntity.getEUVar() + aEnergy); - return true; - } - } - - public boolean inputEnergyFrom(byte aSide) { - return aSide == 6 ? true - : (!this.isServerSide() ? this.isEnergyInputSide(aSide) - : aSide >= 0 && aSide < 6 && this.mActiveEUInputs[aSide] && !this.mReleaseEnergy); - } - - public boolean outputsEnergyTo(byte aSide) { - return aSide == 6 ? true - : (!this.isServerSide() ? this.isEnergyOutputSide(aSide) - : aSide >= 0 && aSide < 6 && this.mActiveEUOutputs[aSide] || this.mReleaseEnergy); - } - - public long getOutputAmperage() { - return this.canAccessData() && this.mMetaTileEntity.isElectric() ? this.mMetaTileEntity.maxAmperesOut() : 0L; - } - - public long getOutputVoltage() { - return this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput() - ? this.mMetaTileEntity.maxEUOutput() - : 0L; - } - - public long getInputAmperage() { - return this.canAccessData() && this.mMetaTileEntity.isElectric() ? this.mMetaTileEntity.maxAmperesIn() : 0L; - } - - public long getInputVoltage() { - return this.canAccessData() && this.mMetaTileEntity.isElectric() ? this.mMetaTileEntity.maxEUInput() - : 2147483647L; - } - - public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) { - if (!this.canAccessData()) { - return false; - } else if (this.mMetaTileEntity.getSteamVar() >= this.getSteamCapacity() && !aIgnoreTooMuchEnergy) { - return false; - } else { - this.setStoredSteam(this.mMetaTileEntity.getSteamVar() + aEnergy); - return true; - } - } - - public long getUniversalEnergyStored() { - return Math.max(this.getStoredEU(), this.getStoredSteam()); - } - - public long getUniversalEnergyCapacity() { - return Math.max(this.getEUCapacity(), this.getSteamCapacity()); - } - - public long getStoredEU() { - return this.canAccessData() ? Math.min(this.mMetaTileEntity.getEUVar(), this.getEUCapacity()) : 0L; - } - - public long getEUCapacity() { - return this.canAccessData() ? this.mMetaTileEntity.maxEUStore() : 0L; - } - - private boolean isEnergyInputSide(byte aSide) { - if (aSide >= 0 && aSide < 6) { - if (!this.getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, this.getCoverIDAtSide(aSide), - this.getCoverDataAtSide(aSide), this)) { - return false; - } - - if (this.isInvalid() || this.mReleaseEnergy) { - return false; - } - - if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetInput()) { - return this.mMetaTileEntity.isInputFacing(aSide); - } - } - - return false; - } - - private boolean isEnergyOutputSide(byte aSide) { - if (aSide >= 0 && aSide < 6) { - if (!this.getCoverBehaviorAtSide(aSide).letsEnergyOut(aSide, this.getCoverIDAtSide(aSide), - this.getCoverDataAtSide(aSide), this)) { - return false; - } - - if (this.isInvalid() || this.mReleaseEnergy) { - return this.mReleaseEnergy; - } - - if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput()) { - return this.mMetaTileEntity.isOutputFacing(aSide); - } - } - - return false; - } - - public boolean setStoredEU(long aEnergy) { - if (!this.canAccessData()) { - return false; - } else { - if (aEnergy < 0L) { - aEnergy = 0L; - } - - this.mMetaTileEntity.setEUVar(aEnergy); - return true; - } - } - - public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) { - if (!this.canAccessData()) { - return false; - } else if (this.mMetaTileEntity.getEUVar() - aEnergy < 0L && !aIgnoreTooLessEnergy) { - return false; - } else { - this.setStoredEU(this.mMetaTileEntity.getEUVar() - aEnergy); - if (this.mMetaTileEntity.getEUVar() < 0L) { - this.setStoredEU(0L); - return false; - } else { - return true; - } - } } public void doEnergyExplosion() { if (this.getUniversalEnergyCapacity() > 0L && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) { this.doExplosion( - this.oOutput * (long) (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() ? 4 + this.getOutput() * (long) (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() ? 4 : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L ? 2 : 1))); GT_Mod arg9999 = GT_Mod.instance; GT_Mod.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(this.getOwnerName()), @@ -257,11 +82,9 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { } } - if (this.mRecipeStuff != null) { + if (this.mRecipeStuff2 != null) { for (i = 0; i < 9; ++i) { - if (this.getRandomNumber(100) < 50) { - this.dropItems(GT_Utility.loadItem(this.mRecipeStuff, "Ingredient." + i)); - } + this.dropItems(GT_Utility.loadItem(this.mRecipeStuff2, "Ingredient." + i)); } } @@ -272,7 +95,7 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { } public ArrayList<ItemStack> getDrops() { - ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1, this.mID); + ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1, this.getMetaTileID()); NBTTagCompound aSuperNBT = super.getDrops().get(0).getTagCompound(); NBTTagCompound tNBT = aSuperNBT; if (this.hasValidMetaTileEntity()) { @@ -285,195 +108,8 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { return new ArrayList<ItemStack>(Arrays.asList(new ItemStack[] { rStack })); } - public long getAverageElectricInput() { - int rEU = 0; - - for (int i = 0; i < this.mAverageEUInput.length; ++i) { - if (i != this.mAverageEUInputIndex) { - rEU += this.mAverageEUInput[i]; - } - } - - return (long) (rEU / (this.mAverageEUInput.length - 1)); - } - - public long getAverageElectricOutput() { - int rEU = 0; - - for (int i = 0; i < this.mAverageEUOutput.length; ++i) { - if (i != this.mAverageEUOutputIndex) { - rEU += this.mAverageEUOutput[i]; - } - } - - return (long) (rEU / (this.mAverageEUOutput.length - 1)); - } - - public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { - if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L - && aVoltage > 0L && this.getStoredEU() < this.getEUCapacity() - && this.mMetaTileEntity.maxAmperesIn() > this.mAcceptedAmperes) { - if (aVoltage > this.getInputVoltage()) { - this.doExplosion(aVoltage); - return 0L; - } else if (this - .increaseStoredEnergyUnits( - aVoltage * (aAmperage = Math - .min(aAmperage, - Math.min(this.mMetaTileEntity.maxAmperesIn() - this.mAcceptedAmperes, - 1L + (this.getEUCapacity() - this.getStoredEU()) / aVoltage))), - true)) { - this.mAverageEUInput[this.mAverageEUInputIndex] = (int) ((long) this.mAverageEUInput[this.mAverageEUInputIndex] - + aVoltage * aAmperage); - this.mAcceptedAmperes += aAmperage; - return aAmperage; - } else { - return 0L; - } - } else { - return 0L; - } - } - - public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { - if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.outputsEnergyTo(aSide) - && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) { - if (this.decreaseStoredEU(aVoltage * aAmperage, false)) { - this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex] - + aVoltage * aAmperage); - return true; - } else { - return false; - } - } else { - return false; - } - } - - public boolean acceptsRotationalEnergy(byte aSide) { - return this.canAccessData() && this.getCoverIDAtSide(aSide) == 0 - ? this.mMetaTileEntity.acceptsRotationalEnergy(aSide) - : false; - } - - public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) { - return this.canAccessData() && this.getCoverIDAtSide(aSide) == 0 - ? this.mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy) - : false; - } - - public double getOutputEnergyUnitsPerTick() { - return (double) this.oOutput; - } - - public double demandedEnergyUnits() { - return !this.mReleaseEnergy && this.canAccessData() && this.mMetaTileEntity.isEnetInput() - ? (double) (this.getEUCapacity() - this.getStoredEU()) - : 0.0D; - } - - public double injectEnergyUnits(ForgeDirection aDirection, double aAmount) { - return this.injectEnergyUnits((byte) aDirection.ordinal(), (long) ((int) aAmount), 1L) > 0L ? 0.0D : aAmount; - } - - public boolean acceptsEnergyFrom(TileEntity aEmitter, ForgeDirection aDirection) { - return this.inputEnergyFrom((byte) aDirection.ordinal()); - } - - public boolean emitsEnergyTo(TileEntity aReceiver, ForgeDirection aDirection) { - return this.outputsEnergyTo((byte) aDirection.ordinal()); - } - - public double getOfferedEnergy() { - return this.canAccessData() && this.getStoredEU() - this.mMetaTileEntity.getMinimumStoredEU() >= this.oOutput - ? (double) Math.max(0L, this.oOutput) - : 0.0D; - } - - public void drawEnergy(double amount) { - this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((double) this.mAverageEUOutput[this.mAverageEUOutputIndex] - + amount); - this.decreaseStoredEU((long) ((int) amount), true); - } - - public int injectEnergy(ForgeDirection aForgeDirection, int aAmount) { - return this.injectEnergyUnits((byte) aForgeDirection.ordinal(), (long) aAmount, 1L) > 0L ? 0 : aAmount; - } - - public int addEnergy(int aEnergy) { - if (!this.canAccessData()) { - return 0; - } else { - if (aEnergy > 0) { - this.increaseStoredEnergyUnits((long) aEnergy, true); - } else { - this.decreaseStoredEU((long) (-aEnergy), true); - } - - return (int) Math.min(2147483647L, this.mMetaTileEntity.getEUVar()); - } - } - - public boolean isAddedToEnergyNet() { - return false; - } - - public int demandsEnergy() { - return !this.mReleaseEnergy && this.canAccessData() && this.mMetaTileEntity.isEnetInput() - ? this.getCapacity() - this.getStored() - : 0; - } - - public int getCapacity() { - return (int) Math.min(2147483647L, this.getEUCapacity()); - } - - public int getStored() { - return (int) Math.min(2147483647L, Math.min(this.getStoredEU(), (long) this.getCapacity())); - } - - public void setStored(int aEU) { - if (this.canAccessData()) { - this.setStoredEU((long) aEU); - } - - } - - public int getMaxSafeInput() { - return (int) Math.min(2147483647L, this.getInputVoltage()); - } - - public int getMaxEnergyOutput() { - return this.mReleaseEnergy ? Integer.MAX_VALUE : this.getOutput(); - } - - public int getOutput() { - return (int) Math.min(2147483647L, this.oOutput); - } - - public int injectEnergy(Direction aDirection, int aAmount) { - return this.injectEnergyUnits((byte) aDirection.toSideValue(), (long) aAmount, 1L) > 0L ? 0 : aAmount; - } - public boolean isTeleporterCompatible(Direction aSide) { return this.canAccessData() && this.mMetaTileEntity.isTeleporterCompatible(); } - public boolean acceptsEnergyFrom(TileEntity aReceiver, Direction aDirection) { - return this.inputEnergyFrom((byte) aDirection.toSideValue()); - } - - public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) { - return this.outputsEnergyTo((byte) aDirection.toSideValue()); - } - - public boolean isUniversalEnergyStored(long aEnergyAmount) { - if (this.getUniversalEnergyStored() >= aEnergyAmount) { - return true; - } else { - this.mHasEnoughEnergy = false; - return false; - } - } - }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java index e39c65b82f..0b8cb10606 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java @@ -8,50 +8,36 @@ import net.minecraftforge.common.util.ForgeDirection; public class BaseCustomPower_MTE extends BaseCustomTileEntity { - public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { - //Logger.INFO("Injecting Energy Units"); - + public BaseCustomPower_MTE() { + super(); + Logger.INFO("Created new BaseCustomPower_MTE"); + } + + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { if (mMetaTileEntity == null) { - Logger.INFO("Bad Tile"); - - } - + Logger.MACHINE_INFO("Bad Tile"); + } if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L && aVoltage > 0L && this.getStoredEU() < this.getEUCapacity() - && this.mMetaTileEntity.maxAmperesIn() > this.mAcceptedAmperes) { - Logger.INFO("Injecting Energy Units"); - if (aVoltage > this.getInputVoltage()) { - this.doExplosion(aVoltage); - return 0L; - } else if (this - .increaseStoredEnergyUnits( - aVoltage * (aAmperage = Math - .min(aAmperage, - Math.min(this.mMetaTileEntity.maxAmperesIn() - this.mAcceptedAmperes, - 1L + (this.getEUCapacity() - this.getStoredEU()) / aVoltage))), - true)) { - Logger.INFO("Injecting Energy Units"); - this.mAverageEUInput[this.mAverageEUInputIndex] = (int) ((long) this.mAverageEUInput[this.mAverageEUInputIndex] - + aVoltage * aAmperage); - this.mAcceptedAmperes += aAmperage; - return aAmperage; - } else { - return 0L; - } + && this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) { + Logger.MACHINE_INFO("Injecting Energy Units"); + return super.injectEnergyUnits(aSide, aVoltage, aAmperage); } else { - Logger.INFO("canAccessData(): "+canAccessData()); - Logger.INFO("isElectric(): "+this.mMetaTileEntity.isElectric()); - Logger.INFO("InputEnergyFromSide("+aSide+"): "+this.inputEnergyFrom(aSide)); - Logger.INFO("aAmperage: "+aAmperage); - Logger.INFO("aVoltage: "+aVoltage); - Logger.INFO("this.getStoredEU() < this.getEUCapacity(): "+(this.getStoredEU() < this.getEUCapacity())); - Logger.INFO("this.mMetaTileEntity.maxAmperesIn() > this.mAcceptedAmperes: "+(this.mMetaTileEntity.maxAmperesIn() > this.mAcceptedAmperes)); + Logger.MACHINE_INFO("canAccessData(): "+canAccessData()); + Logger.MACHINE_INFO("isElectric(): "+this.mMetaTileEntity.isElectric()); + Logger.MACHINE_INFO("InputEnergyFromSide("+aSide+"): "+this.inputEnergyFrom(aSide)); + Logger.MACHINE_INFO("aAmperage: "+aAmperage); + Logger.MACHINE_INFO("aVoltage: "+aVoltage); + Logger.MACHINE_INFO("this.getStoredEU() < this.getEUCapacity(): "+(this.getStoredEU() < this.getEUCapacity())); + Logger.MACHINE_INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: "+(this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage())); + Logger.MACHINE_INFO("this.mMetaTileEntity.maxAmperesIn(): "+(this.mMetaTileEntity.maxAmperesIn())); + Logger.MACHINE_INFO("this.mAcceptedAmperes: "+(this.getInputAmperage())); return 0L; } } public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { - Logger.INFO("Draining Energy Units"); + Logger.MACHINE_INFO("Draining Energy Units 4"); if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.outputsEnergyTo(aSide) && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) { if (this.decreaseStoredEU(aVoltage * aAmperage, false)) { @@ -68,6 +54,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { @Override public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) { + Logger.MACHINE_INFO("Draining Energy Units 3"); // TODO Auto-generated method stub return super.decreaseStoredEnergyUnits(aEnergy, aIgnoreTooLessEnergy); } @@ -86,6 +73,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { @Override public boolean outputsEnergyTo(byte aSide) { + Logger.MACHINE_INFO("Draining Energy Units 2"); // TODO Auto-generated method stub return super.outputsEnergyTo(aSide); } @@ -146,6 +134,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { @Override public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) { + Logger.MACHINE_INFO("Draining Energy Units 1"); // TODO Auto-generated method stub return super.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java index e3ab7915d2..785c4698db 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java @@ -2,9 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; import static gregtech.api.enums.GT_Values.GT; -import org.apache.commons.lang3.ArrayUtils; - -import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; @@ -67,7 +64,7 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo @Override public byte getTileEntityBaseType() { - return (byte) (Math.min(3, mTier <= 0 ? 0 : 1 + ((mTier - 1) / 4))); + return 12; } @Override @@ -85,8 +82,6 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo AutoMap<String> aTooltip = new AutoMap<String>(); String []s1 = null; - aTooltip.put("Special GT++ Machine"); - aTooltip.put(CORE.GT_Tooltip); s1 = new String[aTooltip.size()]; int u = 0; for (String s : aTooltip) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java index 3824206d24..ba98af25f7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java @@ -3,7 +3,10 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.CustomMetaTileBase; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.world.World; @@ -12,6 +15,7 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { public MetaTileEntityCustomPower(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { super(aID, aBasicName, aRegionalName, aInvSlotCount); + this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower()); } public MetaTileEntityCustomPower(String aStack, int aInvSlotCount) { @@ -23,6 +27,12 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { } public void doExplosion(long aExplosionPower) { + + if (MathUtils.randInt(1, 10) > 0) { + Logger.INFO("Machine tried to explode, let's stop that. xo"); + return; + } + float tStrength = aExplosionPower < GT_Values.V[0] ? 1.0F : (aExplosionPower < GT_Values.V[1] @@ -58,6 +68,11 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { @Override public void onExplosion() { + + if (MathUtils.randInt(1, 10) > 0) { + Logger.INFO("Machine tried to explode, let's stop that. xo"); + return; + } // TODO Auto-generated method stub super.onExplosion(); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java index 251deba6d4..e6bf4b8486 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java @@ -55,7 +55,11 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock ITexture[][][] rTextures = new ITexture[2][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i + 1]}; + rTextures[0][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + this.mInventory.length > 4 + ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] + : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)]}; + rTextures[1][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] @@ -187,6 +191,7 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { /*this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; @@ -268,18 +273,8 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock return new long[]{tStored, tScale}; } - public String[] getInfoData() { - ++this.count; - if (this.mMax == 0L || this.count % 20L == 0L) { - long[] tmp = this.getStoredEnergy(); - this.mStored = tmp[0]; - this.mMax = tmp[1]; - } - - return new String[]{this.getLocalName(), "Stored Items:", GT_Utility.formatNumbers(this.mStored) + " EU /", - GT_Utility.formatNumbers(this.mMax) + " EU", "Average input:", - this.getBaseMetaTileEntity().getAverageElectricInput() + "", "Average output:", - this.getBaseMetaTileEntity().getAverageElectricOutput() + ""}; + public String[] getInfoData() { + return new String[]{}; } public boolean isGivingInformation() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java index 57f8b722c3..01134817ae 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java @@ -51,8 +51,7 @@ GT_MetaTileEntity_Hatch { } return new String[]{ this.mDescription, - "Capacity: " + mSlots + " slots", - CORE.GT_Tooltip}; + "Capacity: " + mSlots + " slots"}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java index ba97cc38eb..8cb7c943c0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java @@ -49,8 +49,7 @@ GT_MetaTileEntity_Hatch { } return new String[]{ this.mDescription, - "Capacity: " + mSlots + " slots", - CORE.GT_Tooltip}; + "Capacity: " + mSlots + " slots"}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java index 9eea6b4a28..f6056af87a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java @@ -101,7 +101,7 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY, EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY, EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (this.mGasProof) + EnumChatFormatting.GRAY, - CORE.GT_Tooltip + //CORE.GT_Tooltip }; } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java index c69ecec114..98722a2b96 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java @@ -59,7 +59,7 @@ public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implem "Max Voltage: %%%" + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY, "Max Amperage: %%%" + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY, "Loss/Meter/Ampere: %%%" + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + "%%% EU-Volt", - CORE.GT_Tooltip + //CORE.GT_Tooltip }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java index 4a496c5002..d05a254bf7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java @@ -16,7 +16,7 @@ extends GregtechMetaTreeFarmerBase { @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] {this.mDescription}; } public GregtechMetaTreeFarmerStructural(final int aID, final String aName, final String aNameRegional, final int aTier) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java index 1920b4a282..422837fa46 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java @@ -1,18 +1,20 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import java.util.Locale; + import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import net.minecraft.item.ItemStack; public abstract class CustomMetaTileBase extends MetaTileEntity { - private IGregTechTileEntity mBaseMetaTileEntity; public CustomMetaTileBase(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { super(aID, aBasicName, aRegionalName, aInvSlotCount); - this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntity()); - this.getBaseMetaTileEntity().setMetaTileID((short) aID); + GT_LanguageManager.addStringLocalization("gtpp.blockmachines." + aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH) + ".name", aRegionalName); + this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntity()); + this.getBaseMetaTileEntity().setMetaTileID((short) aID); } public CustomMetaTileBase(String aName, int aInvSlotCount) { @@ -24,7 +26,35 @@ public abstract class CustomMetaTileBase extends MetaTileEntity { } public String getLocalName() { - return GT_LanguageManager.getTranslation("gt.blockmachines." + this.mName + ".name"); + return GT_LanguageManager.getTranslation("gtpp.blockmachines." + this.mName + ".name"); + } + + /** + * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. + * <p/> + * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantlee + * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle + * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle + * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle + * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle + * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle + * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle + * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle + * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle + * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle + * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle + * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle + * + * == Reserved for Alk now + * + * 12 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle + * 13 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle + * 14 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle + * 15 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle + */ + @Override + public byte getTileEntityBaseType() { + return 12; } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java index 4140617fcf..c9201471a4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java @@ -63,7 +63,7 @@ public abstract class GregtechMetaTileEntity extends MetaTileEntity { @Override public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip }; + return new String[] { this.mDescription }; } /** diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java index df7e8cf373..ccf31673e7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java @@ -85,7 +85,7 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer @Override public String[] getDescription() { - return new String[] { this.mDescription, "Accepts 4A and outputs 16A", CORE.GT_Tooltip }; + return new String[] { this.mDescription, "Accepts 4A and outputs 16A"}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 3e5c783a5c..41ba313b0e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -295,15 +295,13 @@ GT_MetaTileEntity_MultiBlockBase { aRequiresCoreModule, aRequiresMuffler, getPollutionTooltip(), - getMachineTooltip(), - CORE.GT_Tooltip}; + getMachineTooltip()}; } else { z = new String[] { aRequiresMaint, aRequiresCoreModule, - getMachineTooltip(), - CORE.GT_Tooltip}; + getMachineTooltip(),}; } int a2, a3; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java index f6dc8547cc..287d2105ac 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java @@ -58,7 +58,7 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ @Override public String[] getDescription() { - return new String[]{this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip}; + return new String[]{this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%"}; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java index c1915fb14a..a88d6a4832 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java @@ -65,13 +65,11 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ return new String[]{ this.mDescription, "Fuel Efficiency: " + this.getEfficiency()*2 + "%", - aPollution, - CORE.GT_Tooltip}; + aPollution}; } return new String[]{ this.mDescription, - "Fuel Efficiency: " + this.getEfficiency()*2 + "%", - CORE.GT_Tooltip}; + "Fuel Efficiency: " + this.getEfficiency()*2 + "%"}; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 2bea7473cc..0556a7f4fe 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -20,6 +20,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; import gregtech.GT_Mod; @@ -50,6 +51,7 @@ public class Meta_GT_Proxy { static { instance = new Meta_GT_Proxy(); + Logger.INFO("GT_PROXY - initialized."); } public static final Meta_GT_Proxy instance; @@ -69,7 +71,7 @@ public class Meta_GT_Proxy { public static IIconRegister sBlockIcons, sItemIcons; public Meta_GT_Proxy() { - Logger.INFO("GT_PROXY - initialized."); + } public static Block sBlockMachines; @@ -77,7 +79,7 @@ public class Meta_GT_Proxy { public void preInit() { //New GT++ Block, yay! (Progress) - sBlockMachines = new GTPP_Block_Machines(); + //sBlockMachines = new GTPP_Block_Machines(); GT_Log.out.println("GT++ Mod: Register TileEntities."); BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity(); @@ -103,6 +105,15 @@ public class Meta_GT_Proxy { } + public static TileEntity constructCustomGregtechMetaTileEntityByMeta(int aMeta) { + if (aMeta == 12) { + return Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower(); + } + else { + return Meta_GT_Proxy.constructBaseMetaTileEntity(); + } + } + public static BaseCustomTileEntity constructBaseMetaTileEntity() { if (sBaseMetaTileEntityClass == null) { try { @@ -307,7 +318,74 @@ public class Meta_GT_Proxy { }else i++; } } - if (tTileEntity.getEUCapacity() > 0L) { + + + + if (tTileEntity.getEUCapacity() > 0L) { + + final long tVoltage = tTileEntity.getInputVoltage(); + byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage))); + + //Custom handling + if (tDamage < 30500 && tDamage >= 30400) { + int aOffset = tDamage - 30400; + if ((aOffset) <= 10) { + tTier -= 2; + aList.add(EnumChatFormatting.BOLD+"16"+" Fuse Slots"+EnumChatFormatting.GRAY); + aList.add("Per each fuse, you may insert "+EnumChatFormatting.YELLOW+(GT_Values.V[tTier])+EnumChatFormatting.GRAY+" EU/t"); + aList.add("However this "+EnumChatFormatting.ITALIC+EnumChatFormatting.RED+"MUST"+EnumChatFormatting.GRAY+" be in a single Amp"); + aList.add("This machine can accept upto a single amp of "+GT_Values.VN[Math.min(tTier+2, 12)]+" as a result"); + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + } + + + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Special_Power_1", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + } + + + if (tTileEntity.getInputVoltage() > 0L) { + String inA = "0"; + if (tTileEntity.getInputAmperage() >= 1L) { + inA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getInputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + else { + inA = " at " + EnumChatFormatting.WHITE + tTileEntity.getInputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + String a1 = "Voltage IN: "+EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + + EnumChatFormatting.GRAY + inA; + aList.add(a1); + } + + if (tTileEntity.getOutputVoltage() > 0L) { + String outA = "0"; + if (tTileEntity.getOutputAmperage() >= 1L) { + outA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + else { + outA = " at " + EnumChatFormatting.WHITE + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + String a1 = "Voltage OUT: "+EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + + EnumChatFormatting.GRAY + outA; + aList.add(a1); + } + + + if (tTileEntity.getOutputVoltage() > 0L) { + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+""+(tDamage < 30500 && tDamage >= 30400 ? 0 : 1), !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + } + + if (tTileEntity.getEUCapacity() > 0) { + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2", + "Internal Capacity: ", !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU"); + } + } + + /*if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getInputVoltage() > 0L) { aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); } @@ -318,7 +396,8 @@ public class Meta_GT_Proxy { aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY); } aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY); - } + }*/ + } NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { @@ -341,15 +420,28 @@ public class Meta_GT_Proxy { } } - //Add Custom Tooltips - for (String s : mCustomGregtechMetaTooltips.keySet()) { - if (aNBT.hasKey(s)) { - String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s)); - aList.add(aTip); - } - } - } + + //Add Custom Here + + //Add Custom Tooltips + for (String s : mCustomGregtechMetaTooltips.keySet()) { + if (aNBT.hasKey(s)) { + String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s)); + aList.add(aTip); + } + } + + //Add GT++ Stuff + + if (tDamage >= 30400 && tDamage < 30500) { + aList.add(EnumChatFormatting.UNDERLINE+"Special GT++ Machine"); + } + if ((tDamage >= 750 && tDamage < 1000) || (tDamage >= 30000 && tDamage < 31000)) { + aList.add(CORE.GT_Tooltip); + } + + } catch (Throwable e) { e.printStackTrace(GT_Log.err); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java index 9fe89bfabc..c62d47e904 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java @@ -21,6 +21,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Item_Machines; import gregtech.common.blocks.GT_Material_Machines; import gregtech.common.render.GT_Renderer_Block; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; import net.minecraft.block.Block; @@ -98,11 +99,29 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } public String getUnlocalizedName() { - return "gtpp.blockmachines"; + int tDamage = 0; + String aUnlocalName = (tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length) + ? (GregTech_API.METATILEENTITIES[tDamage] != null + ? ("gtpp.blockmachines.name" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName()) + : ("gtpp.blockmachines.name")) : ""; + + Logger.INFO("Unlocal Name: "+aUnlocalName); + return aUnlocalName; } public String getLocalizedName() { - return StatCollector.translateToLocal("gtpp.blockmachines" + ".name"); + String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");; + if (aName.toLowerCase().contains(".name")) { + aName = StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + } + if (aName.toLowerCase().contains(".name")) { + aName = StatCollector.translateToLocal("gt.blockmachines" + ".name"); + } + if (aName.toLowerCase().contains(".name")) { + aName = "BAD"; + } + Logger.INFO("Name: "+aName); + return aName; } public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java index a9645184cf..ba3b05ff8e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java @@ -7,6 +7,7 @@ import gregtech.api.util.GT_ItsNotMyFaultException; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import java.util.List; @@ -78,9 +79,9 @@ public class GTPP_Item_Machines extends ItemBlock { if ((e - 30400) <= 10) { tTier -= 2; aList.add(EnumChatFormatting.BOLD+"16"+" Fuse Slots"+EnumChatFormatting.GRAY); - aList.add("One will blow per each A of eu extra passed into it"); - aList.add("Can receive an additional "+EnumChatFormatting.YELLOW+GT_Values.V[tTier]+EnumChatFormatting.GRAY+" EU/t per Fuse"); - aList.add("This machine can accept upto a single amp of "+GT_Values.VN[Math.min(tTier+2, 12)]); + aList.add("Per each fuse, you may insert "+EnumChatFormatting.YELLOW+(GT_Values.V[tTier])+EnumChatFormatting.GRAY+" EU/t"); + aList.add("However this "+EnumChatFormatting.ITALIC+EnumChatFormatting.RED+"MUST"+EnumChatFormatting.GRAY+" be in a single Amp"); + aList.add("This machine can accept upto a single amp of "+GT_Values.VN[Math.min(tTier+2, 12)]+" as a result"); aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } @@ -91,32 +92,39 @@ public class GTPP_Item_Machines extends ItemBlock { } - if (aNBT.getInputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + aNBT.getInputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getInputVoltage())] + ")" - + EnumChatFormatting.GRAY); + if (aNBT.getInputVoltage() > 0L) { + String inA = "0"; + if (aNBT.getInputAmperage() >= 1L) { + inA = " at " + EnumChatFormatting.YELLOW + aNBT.getInputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + else { + inA = " at " + EnumChatFormatting.WHITE + aNBT.getInputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + String a1 = "Voltage IN: "+EnumChatFormatting.GREEN + aNBT.getInputVoltage() + + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getInputVoltage())] + ")" + + EnumChatFormatting.GRAY + inA; + aList.add(a1); } - if (aNBT.getOutputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + aNBT.getOutputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getOutputVoltage())] + ")" - + EnumChatFormatting.GRAY); + if (aNBT.getOutputVoltage() > 0L) { + String outA = "0"; + if (aNBT.getOutputAmperage() >= 1L) { + outA = " at " + EnumChatFormatting.YELLOW + aNBT.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + else { + outA = " at " + EnumChatFormatting.WHITE + aNBT.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + String a1 = "Voltage OUT: "+EnumChatFormatting.GREEN + aNBT.getOutputVoltage() + + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getOutputVoltage())] + ")" + + EnumChatFormatting.GRAY + outA; + aList.add(a1); } aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+"0", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); - - if (aNBT.getOutputAmperage() > 1L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW + aNBT.getOutputAmperage() - + EnumChatFormatting.GRAY); - } - - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2", "Internal Capacity: ", !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + aNBT.getEUCapacity() - + EnumChatFormatting.GRAY); + + EnumChatFormatting.GRAY + " EU"); } } @@ -158,7 +166,7 @@ public class GTPP_Item_Machines extends ItemBlock { short tDamage = (short) (this.getDamage(aStack) + 30400); //Add Offset; return tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length ? (GregTech_API.METATILEENTITIES[tDamage] != null - ? "gt.blockmachines" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName() + ? "gtpp.blockmachines" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName() : "") : ""; } @@ -181,7 +189,9 @@ public class GTPP_Item_Machines extends ItemBlock { return false; } - byte tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType(); + byte tMetaData = 32; + //byte tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType(); + Logger.INFO("Using Meta: "+tMetaData+" for ID "+tDamage+" | "+GregTech_API.METATILEENTITIES[tDamage].getInventoryName()); if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tMetaData, 3)) { return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java index 8f7539f268..c97723b042 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -629,8 +629,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi "Generates a Tesseract for the attached Inventory", "Connect with pipes to insert items", "Consumes "+TESSERACT_ENERGY_COST+"EU/t for same dimension transfers", - "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers", - CORE.GT_Tooltip }; + "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers", }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java index f5cc4a0cd5..ed8b2db41f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -498,8 +498,7 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic "Connect with pipes to extract items or fluids", "Outputs from the back face", "Consumes "+TESSERACT_ENERGY_COST+"EU/t for same dimension transfers", - "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers", - CORE.GT_Tooltip }; + "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers", }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java index faefea6bba..282268fb3d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java @@ -1,6 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.automation; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_ThreadedSuperBuffer; import gtPlusPlus.xmod.gregtech.api.gui.GUI_ThreadedSuperBuffer; import gtPlusPlus.xmod.gregtech.common.StaticFields59; @@ -22,7 +21,7 @@ public class GT_MetaTileEntity_ThreadedSuperBuffer extends GT_MetaTileEntity_Thr "Buffers up to 256 Item Stacks", "Use Screwdriver to regulate output stack size", "Consumes 1EU per moved Item", - CORE.GT_Tooltip}); + }); } public GT_MetaTileEntity_ThreadedSuperBuffer(final String aName, final int aTier, final int aInvSlotCount, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index 542c90d977..a0ca249aec 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -53,7 +53,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { return new String[]{ this.mDescription, "Consumes "+(mSteamPerSecond/160)+"L of water per second", - "Produces "+this.mPollutionPerSecond+" pollution/sec", CORE.GT_Tooltip}; + "Produces "+this.mPollutionPerSecond+" pollution/sec",}; } public ITexture getOverlayIcon() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index 29c2eb963a..45a73f9e35 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -68,7 +68,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - return new String[]{this.mDescription, "Produces "+(this.getPollution()*20)+" pollution/sec", "Fuel Efficiency: "+this.getEfficiency() + "%", CORE.GT_Tooltip}; + return new String[]{this.mDescription, "Produces "+(this.getPollution()*20)+" pollution/sec", "Fuel Efficiency: "+this.getEfficiency() + "%"}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index 27a576da8a..5ebdbf0ef8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -38,7 +38,7 @@ extends GT_MetaTileEntity_BasicGenerator @Override public String[] getDescription() { - return new String[]{this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", CORE.GT_Tooltip}; + return new String[]{this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick"}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 006d4b612c..f3fd95f0c1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -173,7 +173,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator "RTG changes output voltage depending on fuel", "Generates power at " + this.getEfficiency() + "% Efficiency per tick", "Output Voltage: "+this.getOutputTier()+" EU/t", - CORE.GT_Tooltip}; + }; } public GregtechMetaTileEntity_RTG(int aID, String aName, String aNameRegional, int aTier) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java index d557cbaa7d..1ee27afbf0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java @@ -9,7 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; - +import net.minecraft.util.EnumChatFormatting; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -48,7 +48,7 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { @Override public String[] getDescription() { - return new String[] {this.mDescription, "Use Screwdriver to change voltage", CORE.GT_Tooltip}; + return new String[] {this.mDescription, "Use Screwdriver to change voltage", EnumChatFormatting.GREEN+"CREATIVE MACHINE"}; } /* @@ -56,8 +56,8 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { */ @Override public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - CustomIcon g = TexturesGtBlock.Casing_Material_RedSteel; - CustomIcon h = TexturesGtBlock.Casing_Material_Grisium; + CustomIcon h = TexturesGtBlock.Casing_Material_RedSteel; + CustomIcon g = TexturesGtBlock.Casing_Material_Grisium; CustomIcon k; boolean j = MathUtils.isNumberEven(this.mTier); final ITexture[][][] rTextures = new ITexture[2][17][]; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java index e75106382a..129446c40d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java @@ -72,7 +72,7 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered String.format("Accelerating things (Radius: %d EU/t: %d Speed Bonus: x%d)", mTier, getEnergyDemand(mTier, false), mAccelerateStatic[mTier]), "Use a screwdriver to change mode", "To accelerate TileEntities, this machine has to be adjacent to it", - "This machine accepts up to 8 Amps", "Accelerating TileEntities doubles Energy-Demand", CORE.GT_Tooltip}; + "This machine accepts up to 8 Amps", "Accelerating TileEntities doubles Energy-Demand"}; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 9c66e1e05c..fad09027c4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -82,7 +82,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", "High Efficiency: Removes full pollution, Turbine takes 100% dmg", "Turbine Rotor will not break in LE mode", - CORE.GT_Tooltip}; + }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java index 3e94cef7bb..9c246ba913 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java @@ -34,7 +34,7 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase{ @Override public String[] getDescription() { - return new String[]{this.mDescription, "IC2 Steam + Water = Normal Steam.", "Requires no power to run, although it's not very fast.", CORE.GT_Tooltip}; + return new String[]{this.mDescription, "IC2 Steam + Water = Normal Steam.", "Requires no power to run, although it's not very fast.", }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java index 82565bb1d9..0309f876b5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java @@ -39,7 +39,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public String[] getDescription() { - return new String[] {this.mDescription, "A useful debug machine to create pollution.", CORE.GT_Tooltip}; + return new String[] {this.mDescription, "A useful debug machine to create pollution."}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java index ee2ea1da55..2f9bbcc9fb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java @@ -43,7 +43,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { public String[] getDescription() { return new String[] {this.mDescription, "Right click to check pollution levels.", "Configure with screwdriver to set redstone output amount.", - "Does not use power.", CORE.GT_Tooltip}; + "Does not use power."}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java index b7c31e8514..8456f40797 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java @@ -25,7 +25,7 @@ public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTile @Override public String[] getDescription() { - return new String[] {this.mDescription, "Generates Thaumcraft research notes, because it's magic.", CORE.GT_Tooltip}; + return new String[] {this.mDescription, "Generates Thaumcraft research notes, because it's magic."}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java index 0786d46fc4..81f594bc7e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java @@ -42,7 +42,7 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM @Override public String[] getDescription() { - return new String[]{this.mDescription, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip}; + return new String[]{this.mDescription, "Grants no byproducts, but it is fast.", }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java index faeaf1d605..b4e819a459 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java @@ -55,7 +55,7 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti public String[] getDescription() { return new String[] { this.mDescription, "Not Very Fast, but not very big either.", "Each side pair in/out puts to different slots.", "Top & Bottom Sides are Outputs.", - "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2.", CORE.GT_Tooltip }; + "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2." }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java index 7ccee3f4b4..5a0f888ddb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java @@ -55,7 +55,7 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux public String[] getDescription() { return new String[] { this.mDescription, "Not Very Fast, but not very big either.", "Each side pair in/out puts to different slots.", "Top & Bottom Sides are Outputs.", - "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2.", CORE.GT_Tooltip }; + "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2." }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index 96192c5128..25c14a68e7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -49,7 +49,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { "Mixed: Provides both 2A of long range and 1A per player locally.", "Mixed mode is more conservative of power and as a result only", "Gets half the distances each singular mode gets.", - CORE.GT_Tooltip}; + }; } public int getTier(){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java index 98057836ec..5d6904bd46 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java @@ -54,7 +54,7 @@ extends MetaTileEntity { "Multiblock: 3x3x5 hollow with opening on top", "Same shape as Bronze/Bricked blast furnace, except one ring of 8 taller.", "40 Iron Plated Bricks required", - CORE.GT_Tooltip}; + }; } else { return new String[]{"Sloooowly, Skip the Bronze age, Get some Steel!", @@ -67,7 +67,7 @@ extends MetaTileEntity { "as Iron is. This machine takes 5x longer than the bronze", "blast furnace as a result.", "----", - CORE.GT_Tooltip}; + }; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java index c7b4f166b4..aad16d3a56 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -86,7 +86,7 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus "1-16 Output Hatches", "1-16 Energy Hatches", "All Hatches must be "+aTierName+" or better", - CORE.GT_Tooltip}; + }; //"32768 EU/t and 80mio EU Cap per Energy Hatch" } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java index ec28967bb7..9ac67cf874 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java @@ -582,7 +582,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G "Radius is " + (this.getRadiusInChunks() << 4) + " blocks", "Every tick, this machine altenates betweem consumption of Pyrotheum & Cryotheum", "Pyrotheum is used to bore through the Mantle of the world", - "Cryotheum is used to keep the internal components cool", CORE.GT_Tooltip }; + "Cryotheum is used to keep the internal components cool",}; } static { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index 81559db1a5..8294773be3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -32,10 +32,10 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { String aTankPortableness = CORE.GTNH ? "non-portable" : "portable"; if (this.mFluid == null) { - aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank.", CORE.GT_Tooltip}; + aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank."}; } else { - aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank.", "Fluid: "+mFluid.getLocalizedName()+" "+mFluid.amount+"L", CORE.GT_Tooltip}; + aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank.", "Fluid: "+mFluid.getLocalizedName()+" "+mFluid.amount+"L"}; } return aTip; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index 52c1c8818a..1d2fad941b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -41,7 +41,7 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public String[] getDescription() { - return new String[] {this.mDescription, "Accepts/Outputs 4Amp", CORE.GT_Tooltip}; + return new String[] {this.mDescription, "Accepts/Outputs 4Amp",}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java index 80448727cc..b52ed040f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java @@ -18,7 +18,7 @@ extends GregtechMetaSafeBlockBase { @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] {this.mDescription}; } public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java index 2c24809f9a..43d5cffe82 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java @@ -207,7 +207,7 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { "Right click to store/remove something", "Ctrl + Rmb to check contents", "Ctrl + Rmb with a screwdriver to lock", - CORE.GT_Tooltip }; + }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index 2c8a63312f..a3a04a44da 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -43,34 +43,34 @@ public class GregtechDehydrator { //Basic GregtechItemList.GT_Dehydrator_MV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(911, "machine.dehydrator.tier.00", - "Basic Dehydrator I", 2, "This dehydrates your Grapes into Raisins. " + CORE.GT_Tooltip, + "Basic Dehydrator I", 2, "This dehydrates your Grapes into Raisins. ", Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_HV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(912, "machine.dehydrator.tier.01", - "Basic Dehydrator II", 3, "This dehydrates your Grapes into Raisins. " + CORE.GT_Tooltip, + "Basic Dehydrator II", 3, "This dehydrates your Grapes into Raisins. ", Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); //Chemical GregtechItemList.GT_Dehydrator_EV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(813, "advancedmachine.dehydrator.tier.01", - "Chemical Dehydrator I", 4, "This dehydrates your Grapes into Raisins. " + CORE.GT_Tooltip, + "Chemical Dehydrator I", 4, "This dehydrates your Grapes into Raisins. ", Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(814, "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5, - "A hangover is the way your body reacts to dehydration. " + CORE.GT_Tooltip, + "A hangover is the way your body reacts to dehydration. ", Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(815, "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6, - "You could probably make space icecream with this.. " + CORE.GT_Tooltip, + "You could probably make space icecream with this.. ", Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(816, "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7, - "You can definitely make space icecream with this.. " + CORE.GT_Tooltip, + "You can definitely make space icecream with this.. ", Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); |