diff options
Diffstat (limited to 'src/Java/gtPlusPlus')
39 files changed, 1635 insertions, 175 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/Logger.java b/src/Java/gtPlusPlus/api/objects/Logger.java index 6e2e9f6107..1ecdaa9e86 100644 --- a/src/Java/gtPlusPlus/api/objects/Logger.java +++ b/src/Java/gtPlusPlus/api/objects/Logger.java @@ -75,7 +75,7 @@ public class Logger { // ASM Comments public static void LOG_ASM(final String s) { - FMLRelaunchLog.info("", s); + FMLRelaunchLog.info("[Special ASM Logging] ", s); } diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index 24e589ad97..04ada83922 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -23,6 +23,7 @@ import gtPlusPlus.core.block.machine.Machine_WorkbenchAdvanced; import gtPlusPlus.core.fluids.FluidRegistryHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks3; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.fluids.Fluid; @@ -39,6 +40,7 @@ public final class ModBlocks { public static Block blockGriefSaver; public static Block blockCasingsMisc; public static Block blockCasings2Misc; + public static Block blockCasings3Misc; public static Block blockMetaTileEntity; public static Block blockHeliumGenerator; public static Block blockNHG; diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index c6aff47c5b..953d32f138 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -44,19 +44,14 @@ public class COMPAT_HANDLER { //Free IDs /* - 829 --- - //837 - //to - //839 - --- - 851 + 859 to 868 --- - 890 + 899 to - 950 + 945 */ new RECIPES_LaserEngraver(); @@ -102,6 +97,8 @@ public class COMPAT_HANDLER { GregtechMiniRaFusion.run(); GregtechComponentAssembler.run(); GregtechTeslaTower.run(); + GregtechSuperTanks.run(); + GregtechIndustrialFishPond.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 5197b2e34b..eca3c595ec 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -348,7 +348,7 @@ public class Material { sets.put(r.getStackMaterial()); } } - TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList(sets.values())); + TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList<Material>(sets.values())); if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) { Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+mostUsedTypeTextureSet.mSetName+"."); return mostUsedTypeTextureSet; @@ -611,6 +611,10 @@ public class Material { } private final short getComponentCount(final MaterialStack[] inputs){ + + if (inputs == null || inputs.length < 1) { + return 1; + } int counterTemp = 0; for (final MaterialStack m : inputs){ if (m.getStackMaterial() != null){ @@ -729,7 +733,7 @@ public class Material { } final Materials isValid = Materials.get(this.getLocalizedName()); - Logger.INFO("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName); + //Logger.MATERIALS("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName); if (isValid != Materials._NULL){ for (Materials m : invalidMaterials.values()){ if (isValid == m){ @@ -800,7 +804,7 @@ public class Material { //Generate a Cell if we need to if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ if (this.vGenerateCells){ - final Item temp = new BaseItemCell(this); + new BaseItemCell(this); Logger.INFO("Generated a cell for "+this.getUnlocalizedName()); } else { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 653094cdda..a460d7ca59 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -7,6 +7,7 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.recipe.RecipeUtils; @@ -141,6 +142,7 @@ public class RECIPES_Machines { public static ItemStack EV_MACHINE_Wiremill; public static ItemStack HV_MACHINE_Macerator; public static ItemStack EV_MACHINE_Macerator; + public static ItemStack EV_MACHINE_Cutter; public static ItemStack EV_MACHINE_MassFabricator; @@ -213,6 +215,7 @@ public class RECIPES_Machines { EV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); EV_MACHINE_MassFabricator= ItemList.Machine_EV_Massfab.get(1); EV_MACHINE_Centrifuge= ItemList.Machine_EV_Centrifuge.get(1); + EV_MACHINE_Cutter = ItemList.Machine_EV_Cutter.get(1); } @@ -1083,6 +1086,21 @@ public class RECIPES_Machines { ItemUtils.getSimpleStack(ModBlocks.blockProjectTable)); } + if (CORE.ConfigSwitches.enableMultiblock_IndustrialCuttingMachine){ + ItemStack plate = ALLOY.MARAGING300.getPlate(1); + RecipeUtils.recipeBuilder( + plate, CI.craftingToolHammer_Hard, plate, + "plateStellite", "frameGtTalonite", "plateStellite", + plate, CI.craftingToolWrench, plate, + GregtechItemList.Casing_CuttingFactoryFrame.get(Casing_Amount)); + + RecipeUtils.recipeBuilder( + plate,CI.getTieredCircuit(3),plate, + "wireFinePlatinum", EV_MACHINE_Cutter, "wireFinePlatinum", + plate,CI.getTieredCircuit(4),plate, + GregtechItemList.Industrial_CuttingFactoryController.get(1)); + } + //Wireless Chargers RecipeUtils.addShapedGregtechRecipe( CI.emitter_LV, CI.circuitTier1, CI.emitter_LV, diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java index 89c41452d5..c6edd94238 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java @@ -2,168 +2,108 @@ package gtPlusPlus.preloader.asm.transformers; import static org.objectweb.asm.Opcodes.*; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; import org.apache.logging.log4j.Level; import org.objectweb.asm.*; -import org.objectweb.asm.commons.GeneratorAdapter; import cpw.mods.fml.relauncher.FMLRelaunchLog; import gregtech.api.GregTech_API; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.common.blocks.GT_Block_Machines; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.XSTR; +import gtPlusPlus.core.util.array.BlockPos; import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.nbt.NBTUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; public class Preloader_ClassTransformer2 { - private final static Class<BaseMetaTileEntity> customTransformer2 = BaseMetaTileEntity.class; + /** + * + * So what I'd try is something like patch a new field into BaseMetaTileEntity to hold the ItemNBT, + * then patch GT_Block_Machines.breakBlock to store the ItemNBT into that field by calling setItemNBT, + * and then patch BaseMetaTileEntity.getDrops to retrieve that field instead of calling setItemNBT + * But there's probably a simpler solution if all you want to do is fix this + * for your super tanks rather than for all GT machines + * (which would only include saving the output count for chest buffers and item distributors...) + * + */ - public static ArrayList<ItemStack> getDrops(BaseMetaTileEntity o) { - Logger.INFO("DROP!"); - try { - short tID = (short) ReflectionUtils.getField(customTransformer2, "mID").get(o); - NBTTagCompound tRecipeStuff = (NBTTagCompound) ReflectionUtils.getField(customTransformer2, "mRecipeStuff").get(o); - boolean tMuffler = (boolean) ReflectionUtils.getField(customTransformer2, "mMuffler").get(o); - boolean tLockUpgrade = (boolean) ReflectionUtils.getField(customTransformer2, "mLockUpgrade").get(o); - boolean tSteamConverter = (boolean) ReflectionUtils.getField(customTransformer2, "mSteamConverter").get(o); - byte tColor = (byte) ReflectionUtils.getField(customTransformer2, "mColor").get(o); - byte tOtherUpgrades = (byte) ReflectionUtils.getField(customTransformer2, "mOtherUpgrades").get(o); - byte tStrongRedstone = (byte) ReflectionUtils.getField(customTransformer2, "mStrongRedstone").get(o); - int[] tCoverSides = (int[]) ReflectionUtils.getField(customTransformer2, "mCoverSides").get(o); - int[] tCoverData = (int[]) ReflectionUtils.getField(customTransformer2, "mCoverData").get(o); - FluidStack tFluid = null; - if (GT_MetaTileEntity_BasicTank.class.isInstance(o)) { - try { - tFluid = (FluidStack) ReflectionUtils.getField(GT_MetaTileEntity_BasicTank.class, "mFluid").get(o); - } - catch (Throwable t) { - Logger.REFLECTION("mFluid was not set."); - } - } - else { - Logger.REFLECTION("mFluid was not found."); - } - BaseMetaTileEntity tMetaTileEntity = o; - - Logger.REFLECTION("tID: "+(tID != 0)); - Logger.REFLECTION("tRecipeStuff: "+(tRecipeStuff != null)); - Logger.REFLECTION("tMuffler: "+(tMuffler != false)); - Logger.REFLECTION("tLockUpgrade: "+(tLockUpgrade != false)); - Logger.REFLECTION("tSteamConverter: "+(tSteamConverter != false)); - Logger.REFLECTION("tColor: "+(tColor != 0)); - Logger.REFLECTION("tOtherUpgrades: "+(tOtherUpgrades != 0)); - Logger.REFLECTION("tCoverSides: "+(tCoverSides != null)); - Logger.REFLECTION("tCoverData: "+(tCoverData != null)); - Logger.REFLECTION("tMetaTileEntity: "+(tMetaTileEntity != null)); - - ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, tID); - NBTTagCompound tNBT = new NBTTagCompound(); - if (tRecipeStuff != null && !tRecipeStuff.hasNoTags()) tNBT.setTag("GT.CraftingComponents", tRecipeStuff); - if (tMuffler) tNBT.setBoolean("mMuffler", tMuffler); - if (tLockUpgrade) tNBT.setBoolean("mLockUpgrade", tLockUpgrade); - if (tSteamConverter) tNBT.setBoolean("mSteamConverter", tSteamConverter); - if (tColor > 0) tNBT.setByte("mColor", tColor); - //if (tFluid != null) tFluid.writeToNBT(tNBT); - if (tFluid != null) tNBT.setTag("mFluid", tFluid.tag); - if (tOtherUpgrades > 0) tNBT.setByte("mOtherUpgrades", tOtherUpgrades); - if (tStrongRedstone > 0) tNBT.setByte("mStrongRedstone", tStrongRedstone); - for (byte i = 0; i < tCoverSides.length; i++) { - if (tCoverSides[i] != 0) { - tNBT.setIntArray("mCoverData", tCoverData); - tNBT.setIntArray("mCoverSides", tCoverSides); - break; - } - } - - //Set Item NBT - if (!o.isInvalid()){ - ((IMetaTileEntity) tMetaTileEntity).setItemNBT(tNBT); //Valid? Idk - } - else { - try { - Logger.REFLECTION("Trying to set NBT data to Itemstack from invalid tile, World might explode."); - ((IMetaTileEntity) tMetaTileEntity).setItemNBT(tNBT); //Valid? Idk - } - catch (Throwable t){ - Logger.REFLECTION("getDropsHack1"); - t.printStackTrace(); - } - } - - //Set stack NBT - if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT); - return new ArrayList<ItemStack>(Arrays.asList(rStack)); - } - catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException a){ - Logger.REFLECTION("getDropsHack2"); - a.printStackTrace(); - } - ArrayList<ItemStack> u = new ArrayList<ItemStack>(Arrays.asList(new ItemStack[]{ItemUtils.getSimpleStack(Blocks.bedrock)})); - return u; - } + public static boolean mHasSetField = false; + private final static Class<BaseMetaTileEntity> customTransformer2 = BaseMetaTileEntity.class; public static final class GT_MetaTile_Visitor extends ClassVisitor { + private boolean isGt_Block_Machines = false; - public GT_MetaTile_Visitor(ClassVisitor cv) { + public GT_MetaTile_Visitor(ClassVisitor cv, boolean isGt_Block_Machines) { super(ASM5, cv); + this.isGt_Block_Machines = isGt_Block_Machines; + } + + @Override + public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { + FieldVisitor j = super.visitField(access, name, desc, signature, value); + if (!mHasSetField && !isGt_Block_Machines) { + mHasSetField = true; + FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Injecting field 'mItemStorageNBT' into BaseMetaTileEntity.java. Access OpCode: "+access); + j = cv.visitField(0, "mItemStorageNBT", "Lnet/minecraft/nbt/NBTTagCompound;", null, null); + j.visitEnd(); + } + return j; } @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); - if(name.equals("getDrops") && desc.equals("()Ljava/util/ArrayList;")) { - FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Found target method. Access OpCode: "+access); - //return new TrySwapMethod(methodVisitor, access, name, desc); - return new SwapTwo(methodVisitor); + MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions); + + if (isGt_Block_Machines) { //Lnet/minecraft/world/World;IIILnet/minecraft/block/Block;I)V + if(name.equals("breakBlock") && desc.equals("(Lnet/minecraft/world/World;IIILnet/minecraft/block/Block;I)V")) { + FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Found target method 'breakBlock' [Unobfuscated]. Access OpCode: "+access); + return new swapBreakBlock(methodVisitor); + } + else if (name.equals("breakBlock") && !desc.equals("(Lnet/minecraft/world/World;IIILnet/minecraft/block/Block;I)V")) { + FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Found target method 'breakBlock' [Obfuscated]. Access OpCode: "+access); + return new swapBreakBlock(methodVisitor); + } } + else { + if(name.equals("getDrops") && desc.equals("()Ljava/util/ArrayList;")) { + FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Found target method 'getDrops'. Access OpCode: "+access); + return new swapGetDrops(methodVisitor); + } + } return methodVisitor; } } - /*private static final class TrySwapMethod extends GeneratorAdapter { - public TrySwapMethod(MethodVisitor mv, int access, String name, String desc) { - super(Opcodes.ASM5, mv, access, name, desc); - FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Created method swapper for '"+name+"' in 'gregtech/api/metatileentity/BaseMetaTileEntity'. Desc: "+desc); - } - - @Override - public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { - //gtPlusPlus.preloader.asm.transformers.Preloader_ClassTransformer2 - if(opcode==INVOKESPECIAL && owner.equals("net/minecraft/item/ItemStack") - && name.equals("<init>") && desc.equals("(Lnet/minecraft/block/Block;II)V")) { - FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Trying to proccess '"+name+"' | Opcode: "+opcode+" | Desc: "+desc+" | Owner: "+owner); - FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Fixing Greg & Blood's poor attempt at setItemNBT()."); - // not relaying the original instruction to super effectively removes the original - // instruction, instead we're producing a different instruction: - super.visitVarInsn(ALOAD, 0); - super.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2", - "getDrops", "()Ljava/util/ArrayList;", false); - FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Method should now be replaced."); - } - else { // relaying to super will reproduce the same instruction - //FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Original method call."); - super.visitMethodInsn(opcode, owner, name, desc, itf); - } - } - // all other, not overridden visit methods reproduce the original instructions - }*/ - private static final class SwapTwo extends MethodVisitor { + private static final class swapGetDrops extends MethodVisitor { - public SwapTwo(MethodVisitor mv) { + public swapGetDrops(MethodVisitor mv) { super(ASM5, mv); } @@ -174,7 +114,7 @@ public class Preloader_ClassTransformer2 { //ALOAD 0 //INVOKESTATIC gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2 getDrops (Lgregtech/api/metatileentity/BaseMetaTileEntity;)Ljava/util/ArrayList; //ARETURN - + super.visitVarInsn(ALOAD, 0); super.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2", @@ -188,4 +128,243 @@ public class Preloader_ClassTransformer2 { } + private static final class swapBreakBlock extends MethodVisitor { + + public swapBreakBlock(MethodVisitor mv) { + super(ASM5, mv); + } + + @Override + public void visitCode() { + FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Fixing breakBlock() in GT_Block_Machines.class"); + super.visitCode(); + //super.visitVarInsn(ALOAD, 0); + + super.visitVarInsn(ALOAD, 1); + super.visitVarInsn(ILOAD, 2); + super.visitVarInsn(ILOAD, 3); + super.visitVarInsn(ILOAD, 4); + super.visitVarInsn(ALOAD, 5); + super.visitVarInsn(ILOAD, 6); + + super.visitMethodInsn(INVOKESTATIC, + "gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2", + "breakBlock", + "(Lnet/minecraft/world/World;IIILnet/minecraft/block/Block;I)V", + false); + FMLRelaunchLog.log("[GT++ ASM] NBTFixer", Level.INFO, "Method should now be replaced."); + super.visitInsn(RETURN); + } + + } + + + + + + + + + + + + + + + + + + + + + + + + + public static ArrayList<ItemStack> getDrops(BaseMetaTileEntity o) { + Logger.INFO("BaseMetaTileEntity.getDrops(BaseMetaTileEntity(this))"); + try { + short tID = (short) ReflectionUtils.getField(customTransformer2, "mID").get(o); + ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, tID); + + NBTTagCompound i = new NBTTagCompound(); + + i = stupidFuckingNBTMap.get(new BlockPos(o.xCoord, o.yCoord, o.zCoord)); + Logger.INFO("Got NBT Tag Value from map."); + + NBTTagCompound tNBT = i; + if (tNBT == null) { + Logger.INFO("Map tag was null."); + tNBT = generateGetDropsNBT(o); + } + if (!tNBT.hasNoTags()) { + rStack.setTagCompound(tNBT); + Logger.INFO("Iterating rStack NBT."); + NBTUtils.tryIterateNBTData(rStack); + } + return new ArrayList<ItemStack>(Arrays.asList(rStack)); + } + catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException a){ + Logger.REFLECTION("getDropsHack2"); + a.printStackTrace(); + } + ArrayList<ItemStack> u = new ArrayList<ItemStack>(Arrays.asList(new ItemStack[]{ItemUtils.getSimpleStack(Blocks.bedrock)})); + return u; + } + + public static Map<BlockPos, NBTTagCompound> stupidFuckingNBTMap = new HashMap<BlockPos, NBTTagCompound>(); + public static void breakBlock(final World aWorld, final int aX, final int aY, final int aZ, final Block block, + final int meta) { + Logger.INFO("GT_Block_Machines.breakBlock()"); + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof IGregTechTileEntity) { + final IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity; + final Random tRandom = new XSTR(); + GT_Block_Machines.mTemporaryTileEntity.set(tGregTechTileEntity); + + //Try inject this + Logger.INFO("Hopefully saving ItemNBT data."); + + NBTTagCompound tNBT = new NBTTagCompound(); + tNBT = generateGetDropsNBT(tGregTechTileEntity.getMetaTileEntity().getBaseMetaTileEntity()); + tGregTechTileEntity.getMetaTileEntity().setItemNBT(tNBT); + Field fffff; + try { + fffff = ReflectionUtils.getField(tGregTechTileEntity.getClass(), "mItemStorageNBT"); + if (fffff == null) { + Logger.REFLECTION("Injected field is null."); + } + else { + fffff.set(tGregTechTileEntity.getMetaTileEntity().getBaseMetaTileEntity(), tNBT); + Logger.REFLECTION("Hopefully injected field data."); + stupidFuckingNBTMap.put(new BlockPos(aX, aY, aZ), tNBT); + Logger.INFO("Set NBT Tag Value to map."); + } + } + catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } + + for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); ++i) { + final ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); + if (tItem != null && tItem.stackSize > 0 && tGregTechTileEntity.isValidSlot(i)) { + + + + final EntityItem tItemEntity = new EntityItem(aWorld, + (double) (aX + tRandom.nextFloat() * 0.8f + 0.1f), + (double) (aY + tRandom.nextFloat() * 0.8f + 0.1f), + (double) (aZ + tRandom.nextFloat() * 0.8f + 0.1f), + new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); + if (tItem.hasTagCompound()) { + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); + |
