aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java142
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java16
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java50
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java161
4 files changed, 229 insertions, 140 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java
index 2c7e24e584..9105685742 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java
@@ -1,5 +1,8 @@
package goodgenerator.blocks.tileEntity.GTMetaTileEntity;
+import static gregtech.api.enums.Textures.BlockIcons.*;
+import static gregtech.api.enums.Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE_GLOW;
+
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.GT_Mod;
import gregtech.api.enums.ItemList;
@@ -14,17 +17,16 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
-import static gregtech.api.enums.Textures.BlockIcons.*;
-import static gregtech.api.enums.Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE_GLOW;
-
public class DieselGenerator extends GT_MetaTileEntity_BasicGenerator {
public int mEfficiency;
public DieselGenerator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, new String[]{
- "Requires liquid Fuel",
- "Causes " + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * (1.1 - aTier * 0.1)) + " Pollution per second"});
+ super(aID, aName, aNameRegional, aTier, new String[] {
+ "Requires liquid Fuel",
+ "Causes " + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * (1.1 - aTier * 0.1))
+ + " Pollution per second"
+ });
mEfficiency = 100 - aTier * 10;
}
@@ -74,7 +76,9 @@ public class DieselGenerator extends GT_MetaTileEntity_BasicGenerator {
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aTick % 100 == 0 && mFluid != null && mFluid.amount > this.getCapacity()) {
- GT_Log.err.println("Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + " Coords: " + aBaseMetaTileEntity.getXCoord() + " " + aBaseMetaTileEntity.getYCoord() + " " + aBaseMetaTileEntity.getZCoord());
+ GT_Log.err.println(
+ "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + " Coords: " + aBaseMetaTileEntity.getXCoord()
+ + " " + aBaseMetaTileEntity.getYCoord() + " " + aBaseMetaTileEntity.getZCoord());
aBaseMetaTileEntity.setToFire();
}
super.onPostTick(aBaseMetaTileEntity, aTick);
@@ -82,74 +86,134 @@ public class DieselGenerator extends GT_MetaTileEntity_BasicGenerator {
@Override
public ITexture[] getFront(byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_FRONT),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_GLOW).glow().build()),
- OVERLAYS_ENERGY_OUT[this.mTier]};
+ return new ITexture[] {
+ super.getFront(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_FRONT),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_FRONT_GLOW)
+ .glow()
+ .build()),
+ OVERLAYS_ENERGY_OUT[this.mTier]
+ };
}
@Override
public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_BACK),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getBack(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_BACK),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_BACK_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_BOTTOM),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getBottom(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_BOTTOM),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_BOTTOM_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_TOP),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getTop(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_TOP),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_TOP_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_SIDE),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getSides(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_SIDE),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_SIDE_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW).glow().build()),
- OVERLAYS_ENERGY_OUT[this.mTier]};
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW)
+ .glow()
+ .build()),
+ OVERLAYS_ENERGY_OUT[this.mTier]
+ };
}
@Override
public ITexture[] getBackActive(byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getBackActive(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getBottomActive(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
public ITexture[] getTopActive(byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getTopActive(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of(
- TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE),
- TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW).glow().build())};
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0],
+ TextureFactory.of(
+ TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE),
+ TextureFactory.builder()
+ .addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW)
+ .glow()
+ .build())
+ };
}
@Override
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java
index 18d663e5a5..dc049e69c7 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java
@@ -1,12 +1,12 @@
package goodgenerator.blocks.tileEntity.GTMetaTileEntity;
+import static gregtech.api.enums.GT_Values.V;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-import static gregtech.api.enums.GT_Values.V;
-
public class NeutronAccelerator extends GT_MetaTileEntity_Hatch_Energy {
public NeutronAccelerator(int aID, String aName, String aNameRegional, int aTier) {
@@ -18,7 +18,7 @@ public class NeutronAccelerator extends GT_MetaTileEntity_Hatch_Energy {
}
public int getMaxEUConsume() {
- return (int)(V[mTier] * 8 / 10);
+ return (int) (V[mTier] * 8 / 10);
}
@Override
@@ -28,11 +28,11 @@ public class NeutronAccelerator extends GT_MetaTileEntity_Hatch_Energy {
@Override
public String[] getDescription() {
- return new String[]{
- "Input EU to Accelerate the Neutron!",
- "Max EU input: " + this.maxEUInput(),
- "Max EU consumption: " + this.getMaxEUConsume(),
- "Every EU can be transformed into 10~20 eV Neutron Kinetic Energy."
+ return new String[] {
+ "Input EU to Accelerate the Neutron!",
+ "Max EU input: " + this.maxEUInput(),
+ "Max EU consumption: " + this.getMaxEUConsume(),
+ "Every EU can be transformed into 10~20 eV Neutron Kinetic Energy."
};
}
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java
index d69f0b75f8..6a0f7d5d8f 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java
@@ -20,7 +20,8 @@ import net.minecraft.nbt.NBTTagCompound;
public class NeutronSensor extends GT_MetaTileEntity_Hatch {
private static final IIconContainer textureFont = new Textures.BlockIcons.CustomIcon("icons/NeutronSensorFont");
- private static final IIconContainer textureFont_Glow = new Textures.BlockIcons.CustomIcon("icons/NeutronSensorFont_GLOW");
+ private static final IIconContainer textureFont_Glow =
+ new Textures.BlockIcons.CustomIcon("icons/NeutronSensorFont_GLOW");
protected String texts = "";
boolean isOn = false;
@@ -35,10 +36,10 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch {
@Override
public String[] getDescription() {
- return new String[]{
- "Can be installed in Neutron Activator.",
- "Output Redstone Signal according to the Neutron Kinetic Energy.",
- "Right click to open the GUI and setting."
+ return new String[] {
+ "Can be installed in Neutron Activator.",
+ "Output Redstone Signal according to the Neutron Kinetic Energy.",
+ "Right click to open the GUI and setting."
};
}
@@ -81,7 +82,11 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch {
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new NeutronSensorGUIClient(aPlayerInventory, aBaseMetaTileEntity, GoodGenerator.MOD_ID + ":textures/gui/NeutronSensorGUI.png", this.texts);
+ return new NeutronSensorGUIClient(
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ GoodGenerator.MOD_ID + ":textures/gui/NeutronSensorGUI.png",
+ this.texts);
}
@Override
@@ -90,10 +95,12 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch {
}
@Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
if (aBaseMetaTileEntity.isClientSide()) return true;
if (aSide == aBaseMetaTileEntity.getFrontFacing() && aPlayer instanceof EntityPlayerMP) {
- GoodGenerator.CHANNEL.sendTo(new MessageOpenNeutronSensorGUI(aBaseMetaTileEntity, texts), (EntityPlayerMP) aPlayer);
+ GoodGenerator.CHANNEL.sendTo(
+ new MessageOpenNeutronSensorGUI(aBaseMetaTileEntity, texts), (EntityPlayerMP) aPlayer);
return true;
}
return false;
@@ -107,45 +114,39 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch {
return texts == null ? "" : texts;
}
- public void outputRedstoneSignal(){
+ public void outputRedstoneSignal() {
isOn = true;
}
- public void stopOutputRedstoneSignal(){
+ public void stopOutputRedstoneSignal() {
isOn = false;
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return new ITexture[] {
- aBaseTexture,
- TextureFactory.of(textureFont),
- TextureFactory.builder().addIcon(textureFont_Glow).glow().build()
+ aBaseTexture,
+ TextureFactory.of(textureFont),
+ TextureFactory.builder().addIcon(textureFont_Glow).glow().build()
};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {
- aBaseTexture,
- TextureFactory.of(textureFont)
- };
+ return new ITexture[] {aBaseTexture, TextureFactory.of(textureFont)};
}
@Override
- public boolean allowGeneralRedstoneOutput(){
+ public boolean allowGeneralRedstoneOutput() {
return true;
}
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (isOn) {
- for (byte i = 0; i < 6; i ++)
- aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, (byte) 15);
- }
- else {
- for (byte i = 0; i < 6; i ++)
- aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, (byte) 0);
+ for (byte i = 0; i < 6; i++) aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, (byte) 15);
+ } else {
+ for (byte i = 0; i < 6; i++) aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, (byte) 0);
}
super.onPostTick(aBaseMetaTileEntity, aTick);
}
@@ -164,5 +165,4 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch {
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
-
}
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java
index bb9022764c..52a58f42b3 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java
@@ -29,6 +29,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
@@ -37,19 +40,35 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-
-@Optional.InterfaceList(value = {
- @Optional.Interface(iface = "appeng.api.networking.security.IActionHost", modid = "appliedenergistics2", striprefs = true),
- @Optional.Interface(iface = "appeng.me.helpers.IGridProxyable", modid = "appliedenergistics2", striprefs = true),
- @Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2", striprefs = true),
- @Optional.Interface(iface = "appeng.api.storage.IMEInventoryHandler", modid = "appliedenergistics2", striprefs = true),
- @Optional.Interface(iface = "appeng.api.storage.ICellContainer", modid = "appliedenergistics2", striprefs = true),
-})
-public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyable, IActionHost, ICellContainer,
- IMEInventory<IAEFluidStack>, IMEInventoryHandler<IAEFluidStack> {
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(
+ iface = "appeng.api.networking.security.IActionHost",
+ modid = "appliedenergistics2",
+ striprefs = true),
+ @Optional.Interface(
+ iface = "appeng.me.helpers.IGridProxyable",
+ modid = "appliedenergistics2",
+ striprefs = true),
+ @Optional.Interface(
+ iface = "appeng.api.storage.IMEInventory",
+ modid = "appliedenergistics2",
+ striprefs = true),
+ @Optional.Interface(
+ iface = "appeng.api.storage.IMEInventoryHandler",
+ modid = "appliedenergistics2",
+ striprefs = true),
+ @Optional.Interface(
+ iface = "appeng.api.storage.ICellContainer",
+ modid = "appliedenergistics2",
+ striprefs = true),
+ })
+public class YOTTAHatch extends GT_MetaTileEntity_Hatch
+ implements IGridProxyable,
+ IActionHost,
+ ICellContainer,
+ IMEInventory<IAEFluidStack>,
+ IMEInventoryHandler<IAEFluidStack> {
private static final IIconContainer textureFont = new Textures.BlockIcons.CustomIcon("icons/YOTTAHatch");
@@ -57,14 +76,17 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
private AENetworkProxy gridProxy = null;
private int priority;
private AccessRestriction readMode = AccessRestriction.READ_WRITE;
- private final AccessRestriction[] AEModes = new AccessRestriction[]{AccessRestriction.NO_ACCESS, AccessRestriction.READ, AccessRestriction.WRITE, AccessRestriction.READ_WRITE};
+ private final AccessRestriction[] AEModes = new AccessRestriction[] {
+ AccessRestriction.NO_ACCESS, AccessRestriction.READ, AccessRestriction.WRITE, AccessRestriction.READ_WRITE
+ };
public YOTTAHatch(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 0,
- new String[] {"Special I/O port for EC2.",
- "Directly connected YOTTank with AE fluid storage system.",
- "Use screwdriver to set storage priority",
- "Use soldering iron to set read/write mode"});
+ super(aID, aName, aNameRegional, aTier, 0, new String[] {
+ "Special I/O port for EC2.",
+ "Directly connected YOTTank with AE fluid storage system.",
+ "Use screwdriver to set storage priority",
+ "Use soldering iron to set read/write mode"
+ });
}
public YOTTAHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
@@ -101,17 +123,18 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
@Override
public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aPlayer.isSneaking())
- this.priority -= 10;
- else
- this.priority += 10;
- GT_Utility.sendChatToPlayer(aPlayer, String.format(StatCollector.translateToLocal("yothatch.chat.0"), this.priority));
+ if (aPlayer.isSneaking()) this.priority -= 10;
+ else this.priority += 10;
+ GT_Utility.sendChatToPlayer(
+ aPlayer, String.format(StatCollector.translateToLocal("yothatch.chat.0"), this.priority));
}
@Override
- public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
this.readMode = AEModes[(readMode.ordinal() + 1) % 4];
- GT_Utility.sendChatToPlayer(aPlayer, String.format(StatCollector.translateToLocal("yothatch.chat.1"), this.readMode));
+ GT_Utility.sendChatToPlayer(
+ aPlayer, String.format(StatCollector.translateToLocal("yothatch.chat.1"), this.readMode));
return true;
}
@@ -151,15 +174,16 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
@Override
@Optional.Method(modid = "appliedenergistics2")
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out) {
- if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive())
- return out;
- if (host.mFluidName == null || host.mFluidName.equals("") || host.mStorageCurrent.compareTo(BigInteger.ZERO) <= 0)
- return out;
+ if (host == null
+ || host.getBaseMetaTileEntity() == null
+ || !host.getBaseMetaTileEntity().isActive()) return out;
+ if (host.mFluidName == null
+ || host.mFluidName.equals("")
+ || host.mStorageCurrent.compareTo(BigInteger.ZERO) <= 0) return out;
int ready;
if (host.mStorageCurrent.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) > 0) {
ready = Integer.MAX_VALUE;
- }
- else ready = host.mStorageCurrent.intValue();
+ } else ready = host.mStorageCurrent.intValue();
out.add(FluidUtil.createAEFluidStack(FluidRegistry.getFluid(host.mFluidName), ready));
return out;
}
@@ -183,8 +207,7 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
if (ready != null) {
if (mode.equals(Actionable.MODULATE)) drain(null, request.getFluidStack(), true);
return FluidUtil.createAEFluidStack(ready.getFluid(), ready.amount);
- }
- else return null;
+ } else return null;
}
@Override
@@ -209,9 +232,10 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
IStorageGrid storageGrid = grid.getCache(IStorageGrid.class);
if (storageGrid == null) {
node.getGrid().postEvent(new MENetworkStorageEvent(null, StorageChannel.FLUIDS));
- }
- else {
- node.getGrid().postEvent(new MENetworkStorageEvent(storageGrid.getFluidInventory(), StorageChannel.FLUIDS));
+ } else {
+ node.getGrid()
+ .postEvent(
+ new MENetworkStorageEvent(storageGrid.getFluidInventory(), StorageChannel.FLUIDS));
}
node.getGrid().postEvent(new MENetworkCellArrayUpdate());
}
@@ -221,27 +245,29 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
@Override
public int getCapacity() {
- if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) return 0;
+ if (host == null
+ || host.getBaseMetaTileEntity() == null
+ || !host.getBaseMetaTileEntity().isActive()) return 0;
if (host.mStorage.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) >= 0) {
return Integer.MAX_VALUE;
- }
- else return host.mStorage.intValue();
+ } else return host.mStorage.intValue();
}
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
- if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) return 0;
- if (host.mFluidName == null || host.mFluidName.equals("") || host.mFluidName.equals(resource.getFluid().getName())) {
+ if (host == null
+ || host.getBaseMetaTileEntity() == null
+ || !host.getBaseMetaTileEntity().isActive()) return 0;
+ if (host.mFluidName == null
+ || host.mFluidName.equals("")
+ || host.mFluidName.equals(resource.getFluid().getName())) {
host.mFluidName = resource.getFluid().getName();
if (host.mStorage.subtract(host.mStorageCurrent).compareTo(BigInteger.valueOf(resource.amount)) >= 0) {
- if (doFill)
- host.addFluid(resource.amount);
+ if (doFill) host.addFluid(resource.amount);
return resource.amount;
- }
- else {
+ } else {
int added = host.mStorage.subtract(host.mStorageCurrent).intValue();
- if (doFill)
- host.addFluid(added);
+ if (doFill) host.addFluid(added);
return added;
}
}
@@ -250,15 +276,16 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
- if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive())
- return null;
- if (host.mFluidName == null || host.mFluidName.equals("") || !host.mFluidName.equals(resource.getFluid().getName()))
- return null;
+ if (host == null
+ || host.getBaseMetaTileEntity() == null
+ || !host.getBaseMetaTileEntity().isActive()) return null;
+ if (host.mFluidName == null
+ || host.mFluidName.equals("")
+ || !host.mFluidName.equals(resource.getFluid().getName())) return null;
int ready;
if (host.mStorageCurrent.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) > 0) {
ready = Integer.MAX_VALUE;
- }
- else ready = host.mStorageCurrent.intValue();
+ } else ready = host.mStorageCurrent.intValue();
ready = Math.min(ready, resource.amount);
if (doDrain) {
host.reduceFluid(ready);
@@ -268,10 +295,10 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
- if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive())
- return null;
- if (host.mFluidName == null || host.mFluidName.equals(""))
- return null;
+ if (host == null
+ || host.getBaseMetaTileEntity() == null
+ || !host.getBaseMetaTileEntity().isActive()) return null;
+ if (host.mFluidName == null || host.mFluidName.equals("")) return null;
return this.drain(from, FluidRegistry.getFluidStack(host.mFluidName, maxDrain), doDrain);
}
@@ -279,13 +306,13 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
FluidTankInfo[] tankInfo = new FluidTankInfo[1];
tankInfo[0] = new FluidTankInfo(null, 0);
- if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive())
- return tankInfo;
+ if (host == null
+ || host.getBaseMetaTileEntity() == null
+ || !host.getBaseMetaTileEntity().isActive()) return tankInfo;
FluidStack fluid = null;
if (host.mFluidName != null && !host.mFluidName.equals("")) {
int camt;
- if (host.mStorageCurrent.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) > 0)
- camt = Integer.MAX_VALUE;
+ if (host.mStorageCurrent.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) > 0) camt = Integer.MAX_VALUE;
else camt = host.mStorageCurrent.intValue();
fluid = FluidRegistry.getFluidStack(host.mFluidName, camt);
}
@@ -307,16 +334,14 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return new ITexture[] {
- aBaseTexture,
- TextureFactory.of(textureFont),
+ aBaseTexture, TextureFactory.of(textureFont),
};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return new ITexture[] {
- aBaseTexture,
- TextureFactory.of(textureFont),
+ aBaseTexture, TextureFactory.of(textureFont),
};
}
@@ -380,10 +405,10 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
}
@Override
- public void blinkCell(int slot) { }
+ public void blinkCell(int slot) {}
@Override
public void saveChanges(IMEInventory cellInventory) {
- //This is handled by host itself.
+ // This is handled by host itself.
}
}