aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-08-29 16:04:28 +0200
committerGitHub <noreply@github.com>2022-08-29 16:04:28 +0200
commit7d1f51a8937e0a86486267437d444696e81e8aa0 (patch)
treea5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity
parent5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff)
downloadGT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.gz
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.bz2
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.zip
Buildscript + Spotless (#318)
* Convert AES.java to readable class * Buildscript * Spotless
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java382
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java552
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java610
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java350
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java71
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java47
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java142
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java539
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java140
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java282
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java371
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java693
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java204
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java46
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java96
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java131
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java318
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java547
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java420
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java366
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java614
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java385
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java427
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java395
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java205
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java505
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java124
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java757
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java382
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java258
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java326
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java250
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java422
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java99
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java74
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java354
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java964
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java125
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java221
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java5472
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java1318
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java861
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java713
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java441
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java731
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java572
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java355
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java60
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java60
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java559
50 files changed, 12871 insertions, 11465 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
index 5ccbd8cb2d..a88105f7f6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Random;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -12,201 +7,202 @@ import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity;
-import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import ic2.api.Direction;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Random;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCustomMetaTileEntity {
-
- protected NBTTagCompound mRecipeStuff2;
- private static final Field ENTITY_ITEM_HEALTH_FIELD_2;
-
- static {
- Field f = null;
- try {
- f = EntityItem.class.getDeclaredField("field_70291_e");
- f.setAccessible(true);
- } catch (Exception var4) {
- try {
- f = EntityItem.class.getDeclaredField("health");
- f.setAccessible(true);
- } catch (Exception var3) {
- var4.printStackTrace();
- var3.printStackTrace();
- }
- }
-
- ENTITY_ITEM_HEALTH_FIELD_2 = f;
- }
-
- public BaseCustomTileEntity() {
- super();
- Logger.MACHINE_INFO("Created new BaseCustomTileEntity");
- }
-
- public boolean doesExplode() {
- return true;
- }
-
- public void writeToNBT(NBTTagCompound aNBT) {
- try {
- super.writeToNBT(aNBT);
- } catch (Throwable arg7) {
- 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!!!");
- arg7.printStackTrace(GT_Log.err);
- }
-
- try {
- 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 doEnergyExplosion() {
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [doEnergyExplosion]");
- return;
- }
- if (this.getUniversalEnergyCapacity() > 0L
- && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) {
- this.doExplosion(
- 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()),
- "electricproblems");
- }
-
- }
-
- public void doExplosion(long aAmount) {
-
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
- return;
- }
-
- if (this.canAccessData()) {
- if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) {
- try {
- this.mReleaseEnergy = true;
- Util.emitEnergyToNetwork(GT_Values.V[5], Math.max(1L, this.getStoredEU() / GT_Values.V[5]), this);
- } catch (Exception arg4) {
- ;
- }
- }
-
- this.mReleaseEnergy = false;
- this.mMetaTileEntity.onExplosion();
- int i;
-
- boolean aExplosionDropItem = false;
- Object aProxyField = StaticFields59.getFieldFromGregtechProxy(false, "mExplosionItemDrop");
- if (boolean.class.isInstance(aProxyField) || Boolean.class.isInstance(aProxyField)) {
- aExplosionDropItem = (boolean) aProxyField;
- }
-
- if (aExplosionDropItem) {
- for (i = 0; i < this.getSizeInventory(); ++i) {
- ItemStack tItem = this.getStackInSlot(i);
- if (tItem != null && tItem.stackSize > 0 && this.isValidSlot(i)) {
- this.dropItems(tItem);
- this.setInventorySlotContents(i, (ItemStack) null);
- }
- }
- }
-
- if (this.mRecipeStuff2 != null) {
- for (i = 0; i < 9; ++i) {
- this.dropItems(GT_Utility.loadItem(this.mRecipeStuff2, "Ingredient." + i));
- }
- }
-
- PollutionUtils.addPollution(this, 100000);
- this.mMetaTileEntity.doExplosion(aAmount);
- }
-
- }
-
-
- public void dropItems(ItemStack tItem) {
- if (tItem != null) {
- Random tRandom = new Random();
- EntityItem tItemEntity = new EntityItem(this.worldObj,
- (double) ((float) this.xCoord + tRandom.nextFloat() * 0.8F + 0.1F),
- (double) ((float) this.yCoord + tRandom.nextFloat() * 0.8F + 0.1F),
- (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F),
- new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
- if (tItem.hasTagCompound()) {
- tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
- }
-
- tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D;
- tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D;
- tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D;
- tItemEntity.hurtResistantTime = 999999;
- tItemEntity.lifespan = 60000;
-
- try {
- if (ENTITY_ITEM_HEALTH_FIELD_2 != null) {
- ENTITY_ITEM_HEALTH_FIELD_2.setInt(tItemEntity, 99999999);
- }
- } catch (Exception var5) {
- ;
- }
-
- this.worldObj.spawnEntityInWorld(tItemEntity);
- tItem.stackSize = 0;
- }
- }
-
- public ArrayList<ItemStack> getDrops() {
- ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
- ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, this.getMetaTileID());
- // Currently not using my custom block.
- // ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1,
- // this.getMetaTileID());
- boolean fail = true;
-
- ArrayList<ItemStack> aSuperDrops = super.getDrops();
- if (aSuperDrops != null && !aSuperDrops.isEmpty()) {
- ItemStack aSuperStack = super.getDrops().get(0);
- if (aSuperStack != null && aSuperStack.hasTagCompound()) {
- NBTTagCompound aSuperNBT = aSuperStack.getTagCompound();
- if (aSuperNBT != null && !aSuperNBT.hasNoTags()) {
- NBTTagCompound tNBT = (NBTTagCompound) aSuperNBT.copy();
- if (tNBT != null && !tNBT.hasNoTags()) {
- if (this.hasValidMetaTileEntity()) {
- this.mMetaTileEntity.setItemNBT(tNBT);
- rStack.setTagCompound(tNBT);
- fail = false;
- aDrops.add(rStack);
- }
- }
- }
-
- }
- }
- if (fail) {
- aDrops.add(rStack);
- }
- return aDrops;
- }
-
- public boolean isTeleporterCompatible(Direction aSide) {
- return this.canAccessData() && this.mMetaTileEntity.isTeleporterCompatible();
- }
-
-} \ No newline at end of file
+
+ protected NBTTagCompound mRecipeStuff2;
+ private static final Field ENTITY_ITEM_HEALTH_FIELD_2;
+
+ static {
+ Field f = null;
+ try {
+ f = EntityItem.class.getDeclaredField("field_70291_e");
+ f.setAccessible(true);
+ } catch (Exception var4) {
+ try {
+ f = EntityItem.class.getDeclaredField("health");
+ f.setAccessible(true);
+ } catch (Exception var3) {
+ var4.printStackTrace();
+ var3.printStackTrace();
+ }
+ }
+
+ ENTITY_ITEM_HEALTH_FIELD_2 = f;
+ }
+
+ public BaseCustomTileEntity() {
+ super();
+ Logger.MACHINE_INFO("Created new BaseCustomTileEntity");
+ }
+
+ public boolean doesExplode() {
+ return true;
+ }
+
+ public void writeToNBT(NBTTagCompound aNBT) {
+ try {
+ super.writeToNBT(aNBT);
+ } catch (Throwable arg7) {
+ 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!!!");
+ arg7.printStackTrace(GT_Log.err);
+ }
+
+ try {
+ 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 doEnergyExplosion() {
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [doEnergyExplosion]");
+ return;
+ }
+ if (this.getUniversalEnergyCapacity() > 0L
+ && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) {
+ this.doExplosion(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()), "electricproblems");
+ }
+ }
+
+ public void doExplosion(long aAmount) {
+
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
+ return;
+ }
+
+ if (this.canAccessData()) {
+ if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) {
+ try {
+ this.mReleaseEnergy = true;
+ Util.emitEnergyToNetwork(GT_Values.V[5], Math.max(1L, this.getStoredEU() / GT_Values.V[5]), this);
+ } catch (Exception arg4) {
+ ;
+ }
+ }
+
+ this.mReleaseEnergy = false;
+ this.mMetaTileEntity.onExplosion();
+ int i;
+
+ boolean aExplosionDropItem = false;
+ Object aProxyField = StaticFields59.getFieldFromGregtechProxy(false, "mExplosionItemDrop");
+ if (boolean.class.isInstance(aProxyField) || Boolean.class.isInstance(aProxyField)) {
+ aExplosionDropItem = (boolean) aProxyField;
+ }
+
+ if (aExplosionDropItem) {
+ for (i = 0; i < this.getSizeInventory(); ++i) {
+ ItemStack tItem = this.getStackInSlot(i);
+ if (tItem != null && tItem.stackSize > 0 && this.isValidSlot(i)) {
+ this.dropItems(tItem);
+ this.setInventorySlotContents(i, (ItemStack) null);
+ }
+ }
+ }
+
+ if (this.mRecipeStuff2 != null) {
+ for (i = 0; i < 9; ++i) {
+ this.dropItems(GT_Utility.loadItem(this.mRecipeStuff2, "Ingredient." + i));
+ }
+ }
+
+ PollutionUtils.addPollution(this, 100000);
+ this.mMetaTileEntity.doExplosion(aAmount);
+ }
+ }
+
+ public void dropItems(ItemStack tItem) {
+ if (tItem != null) {
+ Random tRandom = new Random();
+ EntityItem tItemEntity = new EntityItem(
+ this.worldObj,
+ (double) ((float) this.xCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) this.yCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
+ if (tItem.hasTagCompound()) {
+ tItemEntity.getEntityItem().setTagCompound((NBTTagCompound)
+ tItem.getTagCompound().copy());
+ }
+
+ tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D;
+ tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D;
+ tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D;
+ tItemEntity.hurtResistantTime = 999999;
+ tItemEntity.lifespan = 60000;
+
+ try {
+ if (ENTITY_ITEM_HEALTH_FIELD_2 != null) {
+ ENTITY_ITEM_HEALTH_FIELD_2.setInt(tItemEntity, 99999999);
+ }
+ } catch (Exception var5) {
+ ;
+ }
+
+ this.worldObj.spawnEntityInWorld(tItemEntity);
+ tItem.stackSize = 0;
+ }
+ }
+
+ public ArrayList<ItemStack> getDrops() {
+ ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
+ ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, this.getMetaTileID());
+ // Currently not using my custom block.
+ // ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1,
+ // this.getMetaTileID());
+ boolean fail = true;
+
+ ArrayList<ItemStack> aSuperDrops = super.getDrops();
+ if (aSuperDrops != null && !aSuperDrops.isEmpty()) {
+ ItemStack aSuperStack = super.getDrops().get(0);
+ if (aSuperStack != null && aSuperStack.hasTagCompound()) {
+ NBTTagCompound aSuperNBT = aSuperStack.getTagCompound();
+ if (aSuperNBT != null && !aSuperNBT.hasNoTags()) {
+ NBTTagCompound tNBT = (NBTTagCompound) aSuperNBT.copy();
+ if (tNBT != null && !tNBT.hasNoTags()) {
+ if (this.hasValidMetaTileEntity()) {
+ this.mMetaTileEntity.setItemNBT(tNBT);
+ rStack.setTagCompound(tNBT);
+ fail = false;
+ aDrops.add(rStack);
+ }
+ }
+ }
+ }
+ }
+ if (fail) {
+ aDrops.add(rStack);
+ }
+ return aDrops;
+ }
+
+ public boolean isTeleporterCompatible(Direction aSide) {
+ return this.canAccessData() && this.mMetaTileEntity.isTeleporterCompatible();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
index d600d0baca..b3d8b8aa8c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
@@ -8,277 +8,283 @@ import net.minecraftforge.common.util.ForgeDirection;
public class BaseCustomPower_MTE extends BaseCustomTileEntity {
- public BaseCustomPower_MTE() {
- super();
- Logger.INFO("Created new BaseCustomPower_MTE");
- }
-
- public boolean doesExplode() {
- return false;
- }
-
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (mMetaTileEntity == null) {
- Logger.INFO("Bad Tile");
- }
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L
- && aVoltage > 0L && this.getStoredEU() < this.getEUCapacity()
- && this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) {
- Logger.INFO("Injecting Energy Units");
- return super.injectEnergyUnits(aSide, aVoltage, aAmperage);
- } else {
- Logger.INFO("canAccessData(): "+canAccessData());
- Logger.INFO("isElectric(): "+this.mMetaTileEntity.isElectric());
- Logger.INFO("