aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2021-05-05 09:02:31 +0200
committerLéa Gris <lea.gris@noiraude.net>2021-05-21 13:38:30 +0200
commitcca2933c1d616ccbb211e1d5f2e49e7c456cee9a (patch)
treedce1cb2649f5f05cba26a2f17fa82ccf76769a34 /src/main/java/gregtech/common
parent37e18fc8c73df4f27776b7a873a355f6412ee200 (diff)
downloadGT5-Unofficial-cca2933c1d616ccbb211e1d5f2e49e7c456cee9a.tar.gz
GT5-Unofficial-cca2933c1d616ccbb211e1d5f2e49e7c456cee9a.tar.bz2
GT5-Unofficial-cca2933c1d616ccbb211e1d5f2e49e7c456cee9a.zip
feat(render): first set of glow textures
Add glowing textures to: - Qantum or Super Tanks and Chests - Active Bronze and Bricked Blast Furnaces - Active Magical Absorber Top - Fusion Reactor Control Computer Screen - Active Yellow Glass Fusion Casing used on: - Active Fusion Reactor Controller and Hatches - Plasma Generator - Lightning Rod - Computer Screen Cover
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java31
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java32
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java108
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java87
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java21
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java39
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java81
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java81
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java81
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java500
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java140
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java36
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java140
14 files changed, 766 insertions, 614 deletions
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
index 029aba7ab3..58a6e6f5ab 100644
--- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
+++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
@@ -15,6 +15,7 @@ import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Item_X32;
import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.ItemData;
import gregtech.api.objects.MaterialStack;
@@ -804,7 +805,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), new ItemStack(Blocks.crafting_table, 1), ItemList.Cover_Crafting.get(1L), 800, 16);
GT_Values.RA.addAssemblerRecipe(ItemList.Cover_Shutter.get(1L), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 2), ItemList.FluidFilter.get(1L), 800, 4);
- GregTech_API.registerCover(ItemList.Cover_Screen.get(1L), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SCREEN)), new GT_Cover_Screen());
+ GregTech_API.registerCover(ItemList.Cover_Screen.get(1L), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_MultiTexture(new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SCREEN), new GT_RenderedGlowTexture(Textures.BlockIcons.OVERLAY_SCREEN_GLOW))), new GT_Cover_Screen());
GregTech_API.registerCover(ItemList.Cover_Crafting.get(1L), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CRAFTING)), new GT_Cover_Crafting());
GregTech_API.registerCover(ItemList.Cover_Drain.get(1L), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[0][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DRAIN)), new GT_Cover_Drain());
GregTech_API.registerCover(ItemList.Cover_Shutter.get(1L), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SHUTTER)), new GT_Cover_Shutter());
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java
index 0057e87670..c233f64940 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java
@@ -1,17 +1,19 @@
package gregtech.common.tileentities.generators;
import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
@@ -30,7 +32,20 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],aSide==1?(aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)):Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]};
+ if (aSide != ForgeDirection.UP.ordinal()) {
+ return new ITexture[]{
+ BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
+ BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]};
+ }
+ if (!aActive) return new ITexture[]{
+ BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(BlockIcons.MACHINE_CASING_FUSION_GLASS)
+ };
+ return new ITexture[]{
+ BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW),
+ new GT_RenderedGlowTexture(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)
+ };
}
@Override
@@ -46,13 +61,13 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
World aWorld = aBaseMetaTileEntity.getWorld();
if (!aWorld.isRemote) {
- if(aBaseMetaTileEntity.getStoredEU()>0){
+ if (aBaseMetaTileEntity.getStoredEU() > 0) {
aBaseMetaTileEntity.setActive(true);
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU()/100+1, false);
- }else {
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU() / 100 + 1, false);
+ } else {
aBaseMetaTileEntity.setActive(false);
}
-
+
if (aTick % 256 == 0 && (aWorld.isThundering() || (aWorld.isRaining() && XSTR_INSTANCE.nextInt(10) == 0))) {
int aRodValue = 0;
boolean isRodValid = true;
@@ -60,13 +75,13 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach
int aY = aBaseMetaTileEntity.getYCoord();
int aZ = aBaseMetaTileEntity.getZCoord();
- for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight()-1; i++) {
+ for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight() - 1; i++) {
if (isRodValid && aBaseMetaTileEntity.getBlock(aX, i, aZ).getUnlocalizedName().equals("blockFenceIron")) {
aRodValue++;
} else {
isRodValid = false;
if (aBaseMetaTileEntity.getBlock(aX, i, aZ) != Blocks.air) {
- aRodValue=0;
+ aRodValue = 0;
break;
}
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
index 6521cb7a5d..11cb47aad8 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
@@ -9,8 +9,13 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDragonEgg;
import net.minecraft.enchantment.Enchantment;
@@ -27,16 +32,30 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.util.ForgeDirection;
-import thaumcraft.api.aspects.*;
+import thaumcraft.api.aspects.Aspect;
+import thaumcraft.api.aspects.AspectList;
+import thaumcraft.api.aspects.AspectSourceHelper;
+import thaumcraft.api.aspects.IAspectContainer;
import thaumcraft.api.visnet.VisNetHandler;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import static gregtech.api.enums.ConfigCategories.machineconfig;
import static gregtech.api.enums.GT_Values.MOD_ID_TC;
import static gregtech.api.enums.GT_Values.V;
-import static net.minecraft.util.EnumChatFormatting.*;
+import static net.minecraft.util.EnumChatFormatting.GRAY;
+import static net.minecraft.util.EnumChatFormatting.GREEN;
+import static net.minecraft.util.EnumChatFormatting.LIGHT_PURPLE;
+import static net.minecraft.util.EnumChatFormatting.RESET;
+import static net.minecraft.util.EnumChatFormatting.UNDERLINE;
+import static net.minecraft.util.EnumChatFormatting.YELLOW;
interface MagicalEnergyBBListener {
void onMagicalEnergyBBUpdate();
@@ -227,7 +246,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
@Override
public ITexture[] getTopActive(byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG)};
+ return new ITexture[]{super.getTopActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG),
+ new GT_RenderedGlowTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG_GLOW)
+ };
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
index 940559bac4..f804db138b 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
@@ -2,14 +2,19 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT;
+
public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGenerator {
public int mEfficiency;
@@ -29,72 +34,105 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe
onConfigLoad();
}
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{
+ super.getFront(aColor)[0],
+ new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS),
+ OVERLAYS_ENERGY_OUT[mTier]};
}
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
}
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GT_Recipe.GT_Recipe_Map.sPlasmaFuels;
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
}
- public int getCapacity() {
- return 16000;
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
}
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, Math.max(10,10 + Math.min(90,this.mTier * 10)));
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
}
-
- public int getEfficiency() {
- return this.mEfficiency;
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{
+ super.getFrontActive(aColor)[0],
+ new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW),
+ OVERLAYS_ENERGY_OUT[mTier]};
}
- public ITexture[] getFront(byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{
+ super.getBackActive(aColor)[0],
+ new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)};
}
- public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{
+ super.getBottomActive(aColor)[0],
+ new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)};
}
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{
+ super.getTopActive(aColor)[0],
+ new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)};
}
- public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ @Override
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{
+ super.getSidesActive(aColor)[0],
+ new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)};
}
- public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
}
- public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sPlasmaFuels;
}
- public ITexture[] getBackActive(byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
}
- public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ @Override
+ public int getCapacity() {
+ return 16000;
}
- public ITexture[] getTopActive(byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
}
- public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, Math.max(10, 10 + Math.min(90, this.mTier * 10)));
}
- @Override
+ @Override
public int getPollution() {
return 0;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java
index eb1ce1348f..1b8e5be61b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java
@@ -1,20 +1,24 @@
package gregtech.common.tileentities.machines.multi;
-import org.lwjgl.input.Keyboard;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import net.minecraft.block.Block;
+import org.lwjgl.input.Keyboard;
-public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace{
+public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace {
private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS)};
private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE)};
- private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE)};
+ private static final ITexture[] FACING_ACTIVE = {
+ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE),
+ new GT_RenderedGlowTexture(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW)
+ };
public GT_MetaTileEntity_BrickedBlastFurnace(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -23,33 +27,30 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri
public GT_MetaTileEntity_BrickedBlastFurnace(String aName) {
super(aName);
}
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_BrickedBlastFurnace(this.mName);
- }
public String[] getDescription() {
- final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Blast Furnace")
- .addInfo("Controller Block for the Bricked Blast Furnace")
- .addInfo("Usable for Steel and general Pyrometallurgy")
- .addInfo("Has a useful interface, unlike other gregtech multis")
- .addPollutionAmount(200)
- .addSeparator()
- .beginStructureBlock(3, 4, 3, true)
- .addController("Front center")
- .addOtherStructurePart("Firebricks", "Everything except the controller")
- .addStructureInfo("The top block is also empty")
- .addStructureInfo("You can share the walls of GT multis, so")
- .addStructureInfo("each additional one costs less, up to 4")
- .toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
-}
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Blast Furnace")
+ .addInfo("Controller Block for the Bricked Blast Furnace")
+ .addInfo("Usable for Steel and general Pyrometallurgy")
+ .addInfo("Has a useful interface, unlike other gregtech multis")
+ .addPollutionAmount(200)
+ .addSeparator()
+ .beginStructureBlock(3, 4, 3, true)
+ .addController("Front center")
+ .addOtherStructurePart("Firebricks", "Everything except the controller")
+ .addStructureInfo("The top block is also empty")
+ .addStructureInfo("You can share the walls of GT multis, so")
+ .addStructureInfo("each additional one costs less, up to 4")
+ .toolTipFinisher("Gregtech");
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ return tt.getStructureInformation();
+ } else {
+ return tt.getInformation();
+ }
+ }
+ @Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
return aActive ? FACING_ACTIVE : FACING_FRONT;
@@ -57,18 +58,24 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri
return FACING_SIDE;
}
- @Override
- protected boolean isCorrectCasingBlock(Block block) {
- return block == GregTech_API.sBlockCasings4;
- }
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BrickedBlastFurnace(this.mName);
+ }
+
+ @Override
+ protected boolean isCorrectCasingBlock(Block block) {
+ return block == GregTech_API.sBlockCasings4;
+ }
- @Override
- protected boolean isCorrectCasingMetaID(int metaID) {
- return metaID == 15;
- }
+ @Override
+ protected boolean isCorrectCasingMetaID(int metaID) {
+ return metaID == 15;
+ }
- @Override
- public String getName() {
- return "Bricked Blast Furnace";
- }
+ @Override
+ public String getName() {
+ return "Bricked Blast Furnace";
+ }
}
+
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
index 771d186158..7ba7d0dceb 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
@@ -5,13 +5,17 @@ import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.block.Block;
public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace {
private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS)};
private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE)};
- private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)};
+ private static final ITexture[] FACING_ACTIVE = {
+ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE),
+ new GT_RenderedGlowTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW)
+ };
public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -21,14 +25,12 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim
super(aName);
}
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName);
- }
-
+ @Override
public String[] getDescription() {
- return new String[]{"Disabled"};
+ return new String[]{"Disabled"};
}
+ @Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
return aActive ? FACING_ACTIVE : FACING_FRONT;
@@ -37,6 +39,11 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim
}
@Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName);
+ }
+
+ @Override
protected boolean isCorrectCasingBlock(Block block) {
return block == GregTech_API.sBlockCasings1;
}
@@ -50,6 +57,4 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim
public String getName() {
return "Bronze Blast Furnace";
}
-
-
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
index 62b6feacc7..f128ccc5e8 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
@@ -1,11 +1,9 @@
package gregtech.common.tileentities.machines.multi;
import gregtech.GT_Mod;
-import gregtech.api.enums.Dyes;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_MultiMachine;
-import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -15,6 +13,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -30,11 +30,23 @@ import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW;
+
public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_MultiBlockBase {
public GT_Recipe mLastRecipe;
public int mEUStore;
+ static {
+ Textures.BlockIcons.setCasingTextureForId(52,
+ new GT_MultiTexture(
+ new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)
+ ));
+ }
+
public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) {
super(aID, aName, aNameRegional);
}
@@ -57,8 +69,10 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity
return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName);
}
+ @Override
public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity);
+ @Override
public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
return aSide != getBaseMetaTileEntity().getFrontFacing();
@@ -220,21 +234,17 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity
public abstract String[] getDescription();
+ @Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- ITexture[] sTexture;
- if (aSide == aFacing) {
- sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)), new GT_RenderedTexture(getIconOverlay())};
- } else {
- if (!aActive) {
- sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa))};
- } else {
- sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, Dyes.getModulation(-1, Dyes._NULL.mRGBa))};
- }
- }
- return sTexture;
+ if (aSide == aFacing) return new ITexture[]{new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS), getTextureOverlay()};
+ if (aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(52)};
+ return new ITexture[]{new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
}
- public abstract IIconContainer getIconOverlay();
+ /**
+ * @return The list of textures overlay
+ */
+ public abstract ITexture getTextureOverlay();
@Override
public boolean isCorrectMachinePart(ItemStack aStack) {
@@ -420,6 +430,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity
return true;
}
+ @Override
public boolean drainEnergyInput(long aEU) {
return false;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
index 9da832c81a..cb98728cf4 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
@@ -1,17 +1,25 @@
package gregtech.common.tileentities.machines.multi;
-import org.lwjgl.input.Keyboard;
-
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedGlowTexture;
+import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import net.minecraft.block.Block;
+import org.lwjgl.input.Keyboard;
+
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1_GLOW;
public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer {
+ private static final ITexture textureOverlay = new GT_MultiTexture(
+ new GT_RenderedTexture(OVERLAY_FUSION1),
+ new GT_RenderedGlowTexture(OVERLAY_FUSION1_GLOW));
+
public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 6);
}
@@ -36,6 +44,11 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC
}
@Override
+ public Block getCasing() {
+ return GregTech_API.sBlockCasings1;
+ }
+
+ @Override
public int getCasingMeta() {
return 6;
}
@@ -50,45 +63,41 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC
return 15;
}
- public String[] getDescription() {
- final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Fusion Reactor")
- .addInfo("It's over 9000!!!")
- .addInfo("Controller block for the Fusion Reactor Mk I")
- .addInfo("2048EU/t and 10M EU capacity per Energy Hatch")
- .addInfo("If the recipe has a startup cost greater than the")
- .addInfo("number of energy hatches * cap, you can't do it")
- .addSeparator()
- .beginStructureBlock(15, 3, 15, false)
- .addController("See diagram when placed")
- .addCasingInfo("LuV Machine Casing", 79)
- .addStructureInfo("Cover the coils with casing")
- .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring")
- .addEnergyHatch("1-16, Specified casings")
- .addInputHatch("2-16, Specified casings")
- .addOutputHatch("1-16, Specified casings")
- .addStructureInfo("ALL Hatches must be LuV or better")
- .toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
- }
-
@Override
- public int tierOverclock() {
- return 1;
+ public String[] getDescription() {
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Fusion Reactor")
+ .addInfo("It's over 9000!!!")
+ .addInfo("Controller block for the Fusion Reactor Mk I")
+ .addInfo("2048EU/t and 10M EU capacity per Energy Hatch")
+ .addInfo("If the recipe has a startup cost greater than the")
+ .addInfo("number of energy hatches * cap, you can't do it")
+ .addSeparator()
+ .beginStructureBlock(15, 3, 15, false)
+ .addController("See diagram when placed")
+ .addCasingInfo("LuV Machine Casing", 79)
+ .addStructureInfo("Cover the coils with casing")
+ .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring")
+ .addEnergyHatch("1-16, Specified casings")
+ .addInputHatch("2-16, Specified casings")
+ .addOutputHatch("1-16, Specified casings")
+ .addStructureInfo("ALL Hatches must be LuV or better")
+ .toolTipFinisher("Gregtech");
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ return tt.getStructureInformation();
+ } else {
+ return tt.getInformation();
+ }
}
@Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings1;
+ public ITexture getTextureOverlay() {
+ return textureOverlay;
}
@Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION1;
+ public int tierOverclock() {
+ return 1;
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
index 7a363f8f6f..6c14199f1b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
@@ -1,17 +1,25 @@
package gregtech.common.tileentities.machines.multi;
-import org.lwjgl.input.Keyboard;
-
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedGlowTexture;
+import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import net.minecraft.block.Block;
+import org.lwjgl.input.Keyboard;
+
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2_GLOW;
public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer {
+ private static final ITexture textureOverlay = new GT_MultiTexture(
+ new GT_RenderedTexture(OVERLAY_FUSION2),
+ new GT_RenderedGlowTexture(OVERLAY_FUSION2_GLOW));
+
public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 6);
}
@@ -36,6 +44,11 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC
}
@Override
+ public Block getCasing() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
public int getCasingMeta() {
return 6;
}
@@ -50,44 +63,40 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC
return 7;
}
- public String[] getDescription() {
- final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Fusion Reactor")
- .addInfo("It's over 9000!!!")
- .addInfo("Controller block for the Fusion Reactor Mk II")
- .addInfo("4096EU/t and 20M EU capacity per Energy Hatch")
- .addInfo("If the recipe has a startup cost greater than the")
- .addInfo("number of energy hatches * cap, you can't do it")
- .addSeparator()
- .beginStructureBlock(15, 3, 15, false)
- .addController("See diagram when placed")
- .addCasingInfo("Fusion Machine Casing", 79)
- .addStructureInfo("Cover the coils with casing")
- .addOtherStructurePart("Fusion Coil Block", "Center part of the ring")
- .addEnergyHatch("1-16, Specified casings")
- .addInputHatch("2-16, Specified casings")
- .addOutputHatch("1-16, Specified casings")
- .addStructureInfo("ALL Hatches must be ZPM or better")
- .toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
- }
-
@Override
- public int tierOverclock() {
- return 2;
+ public String[] getDescription() {
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Fusion Reactor")
+ .addInfo("It's over 9000!!!")
+ .addInfo("Controller block for the Fusion Reactor Mk II")
+ .addInfo("4096EU/t and 20M EU capacity per Energy Hatch")
+ .addInfo("If the recipe has a startup cost greater than the")
+ .addInfo("number of energy hatches * cap, you can't do it")
+ .addSeparator()
+ .beginStructureBlock(15, 3, 15, false)
+ .addController("See diagram when placed")
+ .addCasingInfo("Fusion Machine Casing", 79)
+ .addStructureInfo("Cover the coils with casing")
+ .addOtherStructurePart("Fusion Coil Block", "Center part of the ring")
+ .addEnergyHatch("1-16, Specified casings")
+ .addInputHatch("2-16, Specified casings")
+ .addOutputHatch("1-16, Specified casings")
+ .addStructureInfo("ALL Hatches must be ZPM or better")
+ .toolTipFinisher("Gregtech");
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ return tt.getStructureInformation();
+ } else {
+ return tt.getInformation();
+ }
}
@Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings4;
+ public ITexture getTextureOverlay() {
+ return textureOverlay;
}
@Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION2;
+ public int tierOverclock() {
+ return 2;
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
index a575427791..7b732a55a0 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
@@ -1,17 +1,25 @@
package gregtech.common.tileentities.machines.multi;
-import org.lwjgl.input.Keyboard;
-
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedGlowTexture;
+import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import net.minecraft.block.Block;
+import org.lwjgl.input.Keyboard;
+
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3_GLOW;
public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer {
+ private static final ITexture textureOverlay = new GT_MultiTexture(
+ new GT_RenderedTexture(OVERLAY_FUSION3),
+ new GT_RenderedGlowTexture(OVERLAY_FUSION3_GLOW));
+
public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 6);
}
@@ -36,6 +44,11 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC
}
@Override
+ public Block getCasing() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
public int getCasingMeta() {
return 8;
}
@@ -50,45 +63,41 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC
return 7;
}
- public String[] getDescription() {
- final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Fusion Reactor")
- .addInfo("A SUN DOWN ON EARTH")
- .addInfo("Controller block for the Fusion Reactor Mk III")
- .addInfo("8192EU/t and 40M EU capacity per Energy Hatch")
- .addInfo("If the recipe has a startup cost greater than the")
- .addInfo("number of energy hatches * cap, you can't do it")
- .addSeparator()
- .beginStructureBlock(15, 3, 15, false)
- .addController("See diagram when placed")
- .addCasingInfo("Fusion Machine Casing Mk II", 79)
- .addStructureInfo("Cover the coils with casing")
- .addOtherStructurePart("Fusion Coil Block", "Center part of the ring")
- .addEnergyHatch("1-16, Specified casings")
- .addInputHatch("2-16, Specified casings")
- .addOutputHatch("1-16, Specified casings")
- .addStructureInfo("ALL Hatches must be UV or better")
- .toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
- }
-
@Override
- public int tierOverclock() {
- return 4;
+ public String[] getDescription() {
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Fusion Reactor")
+ .addInfo("A SUN DOWN ON EARTH")
+ .addInfo("Controller block for the Fusion Reactor Mk III")
+ .addInfo("8192EU/t and 40M EU capacity per Energy Hatch")
+ .addInfo("If the recipe has a startup cost greater than the")
+ .addInfo("number of energy hatches * cap, you can't do it")
+ .addSeparator()
+ .beginStructureBlock(15, 3, 15, false)
+ .addController("See diagram when placed")
+ .addCasingInfo("Fusion Machine Casing Mk II", 79)
+ .addStructureInfo("Cover the coils with casing")
+ .addOtherStructurePart("Fusion Coil Block", "Center part of the ring")
+ .addEnergyHatch("1-16, Specified casings")
+ .addInputHatch("2-16, Specified casings")
+ .addOutputHatch("1-16, Specified casings")
+ .addStructureInfo("ALL Hatches must be UV or better")
+ .toolTipFinisher("Gregtech");
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ return tt.getStructureInformation();
+ } else {
+ return tt.getInformation();
+ }
}
@Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings4;
+ public ITexture getTextureOverlay() {
+ return textureOverlay;
}
@Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION3;
+ public int tierOverclock() {
+ return 4;
}
}
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
index 1876a16c1b..057d19af7e 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
@@ -1,15 +1,12 @@
package gregtech.common.tileentities.storage;
-import java.util.HashMap;
-import java.util.Map;
-
import cpw.mods.fml.common.Optional;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.objects.AE2DigitalChestHandler;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_QuantumChest;
@@ -21,11 +18,51 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
+import java.util.HashMap;
+import java.util.Map;
+
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST_GLOW;
+
@Optional.Interface(iface = "appeng.api.storage.IMEMonitor", modid = "appliedenergistics2", striprefs = true)
public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack> {
+ protected boolean mVoidOverflow = false;
private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners = null;
+
public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks Use a screwdriver to enable voiding items on overflow");
+ super(aID, aName, aNameRegional, aTier, 3, new String[]{
+ "This Chest stores " + commonSizeCompute(aTier) + " Blocks",
+ "Use a screwdriver to enable",
+ "voiding items on overflow"
+ });
+ }
+
+ protected static int commonSizeCompute(int tier) {
+ switch (tier) {
+ case 1:
+ return 4000000;
+ case 2:
+ return 8000000;
+ case 3:
+ return 16000000;
+ case 4:
+ return 32000000;
+ case 5:
+ return 64000000;
+ case 6:
+ return 128000000;
+ case 7:
+ return 256000000;
+ case 8:
+ return 512000000;
+ case 9:
+ return 1024000000;
+ case 10:
+ return 2147483640;
+ default:
+ return 0;
+ }
}
public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -36,199 +73,111 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
super(aName, aTier, 3, aDescription, aTextures);
}
- @Override
- public boolean isSimpleMachine() {
- return true;
+ @Optional.Method(modid = "appliedenergistics2")
+ public static void registerAEIntegration() {
+ appeng.api.AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AE2DigitalChestHandler());
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public boolean isFacingValid(byte aFacing) {
- return true;
+ public void addListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver, Object o) {
+ if (listeners == null)
+ listeners = new HashMap<>();
+ listeners.put(imeMonitorHandlerReceiver, o);
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
+ public void removeListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver) {
+ if (listeners == null)
+ listeners = new HashMap<>();
+ listeners.remove(imeMonitorHandlerReceiver);
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public boolean isValidSlot(int aIndex) {
- return true;
+ public appeng.api.config.AccessRestriction getAccess() {
+ return appeng.api.config.AccessRestriction.READ_WRITE;
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
+ public boolean isPrioritized(appeng.api.storage.data.IAEItemStack iaeItemStack) {
+ return false;
}
-
- protected boolean mVoidOverflow = false;
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mVoidOverflow = !mVoidOverflow;
- GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled"));
+ public boolean canAccept(appeng.api.storage.data.IAEItemStack iaeItemStack) {
+ ItemStack s = getItemStack();
+ if (s == null || iaeItemStack == null)
+ return true;
+ return iaeItemStack.isSameType(s);
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_QuantumChest(aPlayerInventory, aBaseMetaTileEntity);
+ public int getPriority() {
+ return 0;
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_QuantumChest(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ public int getSlot() {
+ return 0;
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
-
- if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork()) {
- if ((getItemCount() <= 0)) {
- setItemStack(null);
- setItemCount(0);
- }
- if (getItemStack() == null && mInventory[0] != null) {
- setItemStack(mInventory[0].copy());
- }
- int count = getItemCount();
- ItemStack stack = getItemStack();
- int savedCount = count;
-
- if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) {
- count += mInventory[0].stackSize;
- if (count <= getMaxItemCount()) {
- mInventory[0] = null;
- } else {
- if (mVoidOverflow) {
- mInventory[0] = null;
- } else {
- mInventory[0].stackSize = (count - getMaxItemCount());
- }
- count = getMaxItemCount();
- }
- }
- if (mInventory[1] == null && stack != null) {
- mInventory[1] = stack.copy();
- mInventory[1].stackSize = Math.min(stack.getMaxStackSize(), count);
- count -= mInventory[1].stackSize;
- } else if ((count > 0) && GT_Utility.areStacksEqual(mInventory[1], stack) && mInventory[1].getMaxStackSize() > mInventory[1].stackSize) {
- int tmp = Math.min(count, mInventory[1].getMaxStackSize() - mInventory[1].stackSize);
- mInventory[1].stackSize += tmp;
- count -= tmp;
- }
- setItemCount(count);
- if (stack != null) {
- mInventory[2] = stack.copy();
- mInventory[2].stackSize = Math.min(stack.getMaxStackSize(), count);
- } else {
- mInventory[2] = null;
- }
-
- if (GregTech_API.mAE2)
- notifyListeners(count - savedCount, stack);
- if (count != savedCount)
- getBaseMetaTileEntity().markDirty();
- }
+ public boolean validForPass(int i) {
+ return true;
}
- abstract protected int getItemCount();
- abstract public void setItemCount(int aCount);
- abstract protected ItemStack getItemStack();
- abstract protected void setItemStack(ItemStack s);
-
- @Override
- public int getProgresstime() {
- return getItemCount() + (mInventory[0] == null ? 0 : mInventory[0].stackSize) + (mInventory[1] == null ? 0 : mInventory[1].stackSize);
- }
+ protected abstract ItemStack getItemStack();
- @Override
- public int maxProgresstime() {
- return getMaxItemCount();
- }
+ protected abstract void setItemStack(ItemStack s);
- protected static int CommonSizeCompute(int tier){
- switch(tier){
- case 1:
- return 4000000;
- case 2:
- return 8000000;
- case 3:
- return 16000000;
- case 4:
- return 32000000;
- case 5:
- return 64000000;
- case 6:
- return 128000000;
- case 7:
- return 256000000;
- case 8:
- return 512000000;
- case 9:
- return 1024000000;
- case 10:
- return 2147483640;
- default:
- return 0;
+ @Optional.Method(modid = "appliedenergistics2")
+ public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems(final appeng.api.storage.data.IItemList out) {
+ ItemStack storedStack = getItemStack();
+ if (storedStack != null) {
+ appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack);
+ s.setStackSize(getItemCount());
+ out.add(s);
}
+ return out;
}
+ @Optional.Method(modid = "appliedenergistics2")
@Override
- public int getMaxItemCount() {
- return CommonSizeCompute(mTier);
- }
- @Override
- public ItemStack[] getStoredItemData() {
- return mInventory;
- }
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex == 1;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex == 0 && (mInventory[0] == null || GT_Utility.areStacksEqual(mInventory[0], aStack));
+ public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getStorageList() {
+ appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> res = new appeng.util.item.ItemList();
+ ItemStack storedStack = getItemStack();
+ if (storedStack != null) {
+ appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack);
+ s.setStackSize(getItemCount());
+ res.add(s);
+ }
+ return res;
}
- abstract protected String chestName();
+ protected abstract int getItemCount();
- @Optional.Method(modid = "appliedenergistics2")
- public static void registerAEIntegration() {
- appeng.api.AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AE2DigitalChestHandler());
- }
+ public abstract void setItemCount(int aCount);
@Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mItemCount", getItemCount());
- if (getItemStack() != null)
- aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound()));
- aNBT.setBoolean("mVoidOverflow", mVoidOverflow);
+ public int getMaxItemCount() {
+ return commonSizeCompute(mTier);
}
@Override
- public void loadNBTData(NBTTagCompound aNBT) {
- if (aNBT.hasKey("mItemCount"))
- setItemCount(aNBT.getInteger("mItemCount"));
- if (aNBT.hasKey("mItemStack"))
- setItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack")));
- mVoidOverflow = aNBT.getBoolean("mVoidOverflow");
-
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_QuantumChest(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)};
- }
- return aSide == aBaseMetaTileEntity.getFrontFacing() ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]};//aSide != aFacing ? mMachineBlock != 0 ? new ITexture[] {Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]} : new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]} : mMachineBlock != 0 ? aActive ? getTexturesActive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : getTexturesInactive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : aActive ? getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]) : getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]);
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_QuantumChest(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
}
@Override
@@ -236,27 +185,6 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
return new ITexture[0][0][0];
}
- @Override
- public String[] getInfoData() {
-
- if (getItemStack() == null) {
- return new String[]{
- EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET,
- "Stored Items:",
- EnumChatFormatting.GOLD + "No Items" + EnumChatFormatting.RESET,
- EnumChatFormatting.GREEN + "0" + EnumChatFormatting.RESET + " " +
- EnumChatFormatting.YELLOW + getMaxItemCount() + EnumChatFormatting.RESET
- };
- }
- return new String[]{
- EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET,
- "Stored Items:",
- EnumChatFormatting.GOLD + getItemStack().getDisplayName() + EnumChatFormatting.RESET,
- EnumChatFormatting.GREEN + Integer.toString(getItemCount()) + EnumChatFormatting.RESET + " " +
- EnumChatFormatting.YELLOW + getMaxItemCount() + EnumChatFormatting.RESET
- };
- }
-
@Optional.Method(modid = "appliedenergistics2")
public appeng.api.storage.data.IAEItemStack injectItems(final appeng.api.storage.data.IAEItemStack input, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) {
final ItemStack inputStack = input.getItemStack();
@@ -267,35 +195,27 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
ItemStack storedStack = getItemStack();
if (storedStack != null) {
if (GT_Utility.areStacksEqual(storedStack, inputStack)) {
- if (input.getStackSize() + getItemCount() > getMaxItemCount())
- {
- if (mVoidOverflow)
- {
+ if (input.getStackSize() + getItemCount() > getMaxItemCount()) {
+ if (mVoidOverflow) {
if (mode != appeng.api.config.Actionable.SIMULATE)
setItemCount(getMaxItemCount());
return null;
}
- else
- {
- return createOverflowStack(input.getStackSize() + getItemCount(), mode);
- }
- }
- else {
- if (mode != appeng.api.config.Actionable.SIMULATE)
- setItemCount(getItemCount() + (int) input.getStackSize());
+ return createOverflowStack(input.getStackSize() + getItemCount(), mode);
}
+ if (mode != appeng.api.config.Actionable.SIMULATE)
+ setItemCount(getItemCount() + (int) input.getStackSize());
return null;
- } else
- return input;
- } else {
- if (mode != appeng.api.config.Actionable.SIMULATE)
- setItemStack(inputStack.copy());
- if (input.getStackSize() > getMaxItemCount())
- return createOverflowStack(input.getStackSize(), mode);
- else if (mode != appeng.api.config.Actionable.SIMULATE)
- setItemCount((int) input.getStackSize());
- return null;
+ }
+ return input;
}
+ if (mode != appeng.api.config.Actionable.SIMULATE)
+ setItemStack(inputStack.copy());
+ if (input.getStackSize() > getMaxItemCount())
+ return createOverflowStack(input.getStackSize(), mode);
+ if (mode != appeng.api.config.Actionable.SIMULATE)
+ setItemCount((int) input.getStackSize());
+ return null;
}
@Optional.Method(modid = "appliedenergistics2")
@@ -332,85 +252,133 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
return appeng.api.storage.StorageChannel.ITEMS;
}
- @Optional.Method(modid = "appliedenergistics2")
- public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems(final appeng.api.storage.data.IItemList out) {
- ItemStack storedStack = getItemStack();
- if (storedStack != null) {
- appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack);
- s.setStackSize(getItemCount());
- out.add(s);
- }
- return out;
+ @Override
+ public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mVoidOverflow = !mVoidOverflow;
+ GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled"));
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getStorageList() {
- appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> res = new appeng.util.item.ItemList();
- ItemStack storedStack = getItemStack();
- if (storedStack != null) {
- appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack);
- s.setStackSize(getItemCount());
- res.add(s);
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+
+ if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork()) {
+ if ((getItemCount() <= 0)) {
+ setItemStack(null);
+ setItemCount(0);
+ }
+ if (getItemStack() == null && mInventory[0] != null) {
+ setItemStack(mInventory[0].copy());
+ }
+ int count = getItemCount();
+ ItemStack stack = getItemStack();
+ int savedCount = count;
+
+ if ((mInventory[0] != null) && ((count < getMaxItemCount()) || mVoidOverflow) && GT_Utility.areStacksEqual(mInventory[0], stack)) {
+ count += mInventory[0].stackSize;
+ if (count <= getMaxItemCount()) {
+ mInventory[0] = null;
+ } else {
+ if (mVoidOverflow) {
+ mInventory[0] = null;
+ } else {
+ mInventory[0].stackSize = (count - getMaxItemCount());
+ }
+ count = getMaxItemCount();
+ }
+ }
+ if (mInventory[1] == null && stack != null) {
+ mInventory[1] = stack.copy();
+ mInventory[1].stackSize = Math.min(stack.getMaxStackSize(), count);
+ count -= mInventory[1].stackSize;
+ } else if ((count > 0) && GT_Utility.areStacksEqual(mInventory[1], stack) && mInventory[1].getMaxStackSize() > mInventory[1].stackSize) {
+ int tmp = Math.min(count, mInventory[1].getMaxStackSize() - mInventory[1].stackSize);
+ mInventory[1].stackSize += tmp;
+ count -= tmp;
+ }
+ setItemCount(count);
+ if (stack != null) {
+ mInventory[2] = stack.copy();
+ mInventory[2].stackSize = Math.min(stack.getMaxStackSize(), count);
+ } else {
+ mInventory[2] = null;
+ }
+
+ if (GregTech_API.mAE2)
+ notifyListeners(count - savedCount, stack);
+ if (count != savedCount)
+ getBaseMetaTileEntity().markDirty();
}
- return res;
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public void addListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver, Object o) {
- if (listeners == null)
- listeners = new HashMap<>();
- listeners.put(imeMonitorHandlerReceiver, o);
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (!aBaseMetaTileEntity.isClientSide()) aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public void removeListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver) {
- if (listeners == null)
- listeners = new HashMap<>();
- listeners.remove(imeMonitorHandlerReceiver);
+ public boolean isFacingValid(byte aFacing) {
+ return true;
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public appeng.api.config.AccessRestriction getAccess() {
- return appeng.api.config.AccessRestriction.READ_WRITE;
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public boolean isPrioritized(appeng.api.storage.data.IAEItemStack iaeItemStack) {
- return false;
+ public boolean isValidSlot(int aIndex) {
+ return true;
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public boolean canAccept(appeng.api.storage.data.IAEItemStack iaeItemStack) {
- ItemStack s = getItemStack();
- if (s == null || iaeItemStack == null)
- return true;
- return iaeItemStack.isSameType(s);
+ public boolean isSimpleMachine() {
+ return true;
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public int getPriority() {
- return 0;
+ public int getProgresstime() {
+ return getItemCount() + (mInventory[0] == null ? 0 : mInventory[0].stackSize) + (mInventory[1] == null ? 0 : mInventory[1].stackSize);
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public int getSlot() {
- return 0;
+ public int maxProgresstime() {
+ return getMaxItemCount();
}
- @Optional.Method(modid = "appliedenergistics2")
@Override
- public boolean validForPass(int i) {
+ public boolean isGivingInformation() {
return true;
}
+ @Override
+ public String[] getInfoData() {
+
+ if (getItemStack() == null) {
+ return new String[]{
+ EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET,
+ "Stored Items:",
+ EnumChatFormatting.GOLD + "No Items" + EnumChatFormatting.RESET,
+ EnumChatFormatting.GREEN + "0" + EnumChatFormatting.RESET + " " +
+ EnumChatFormatting.YELLOW + getMaxItemCount() + EnumChatFormatting.RESET
+ };
+ }
+ return new String[]{
+ EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET,
+ "Stored Items:",
+ EnumChatFormatting.GOLD + getItemStack().getDisplayName() + EnumChatFormatting.RESET,
+ EnumChatFormatting.GREEN + Integer.toString(getItemCount()) + EnumChatFormatting.RESET + " " +
+ EnumChatFormatting.YELLOW + getMaxItemCount() + EnumChatFormatting.RESET
+ };
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData() {
+ return mInventory;
+ }
+
+ protected abstract String chestName();
+
@Optional.Method(modid = "appliedenergistics2")
private void notifyListeners(int count, ItemStack stack) {
if (listeners == null) {
@@ -423,11 +391,49 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(stack);
s.setStackSize(count);
change.add(s);
- listeners.forEach((l,o) ->{
+ listeners.forEach((l, o) -> {
if (l.isValid(o))
l.postChange(this, change, null);
else
removeListener(l);
});
}
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mItemCount", getItemCount());
+ if (getItemStack() != null)
+ aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound()));
+ aNBT.setBoolean("mVoidOverflow", mVoidOverflow);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (aNBT.hasKey("mItemCount"))
+ setItemCount(aNBT.getInteger("mItemCount"));
+ if (aNBT.hasKey("mItemStack"))
+ setItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack")));
+ mVoidOverflow = aNBT.getBoolean("mVoidOverflow");
+
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 1;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 0 && (mInventory[0] == null || GT_Utility.areStacksEqual(mInventory[0], aStack));
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide != aFacing) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]};
+ return new ITexture[]{
+ MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(OVERLAY_SCHEST),
+ new GT_RenderedGlowTexture(OVERLAY_SCHEST_GLOW)
+ };
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java
index 812f9970ea..6484e541f9 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java
@@ -1,18 +1,39 @@
package gregtech.common.tileentities.storage;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK_GLOW;
public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_BasicTank {
public GT_MetaTileEntity_QuantumTank(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "Stores " + CommonSizeCompute(aTier) + "L of fluid");
+ super(aID, aName, aNameRegional, aTier, 3, "Stores " + commonSizeCompute(aTier) + "L of fluid");
+ }
+
+ private static int commonSizeCompute(int tier) {
+ switch (tier) {
+ case 6:
+ return 128000000;
+ case 7:
+ return 256000000;
+ case 8:
+ return 512000000;
+ case 9:
+ return 1024000000;
+ case 10:
+ return 2147483640;
+ default:
+ return 0;
+ }
}
public GT_MetaTileEntity_QuantumTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -29,96 +50,84 @@ public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_BasicTank {
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QTANK)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]};
+ public boolean isSimpleMachine() {
+ return true;
}
@Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
+ public boolean doesFillContainers() {
+ return true;
}
@Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
+ public boolean doesEmptyContainers() {
return true;
}
@Override
- public boolean isSimpleMachine() {
+ public boolean canTankBeFilled() {
return true;
}
@Override
- public boolean isFacingValid(byte aFacing) {
+ public boolean canTankBeEmptied() {
return true;
}
@Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ public boolean displaysItemStack() {
return true;
}
@Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
+ public boolean displaysStackSize() {
+ return false;
}
@Override
- public final byte getUpdateData() {
- return 0x00;
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescriptionArray, mTextures);
}
@Override
- public boolean doesFillContainers() {
- return true;
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]};
+ return new ITexture[]{
+ MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(OVERLAY_QTANK),
+ new GT_RenderedGlowTexture(OVERLAY_QTANK_GLOW)
+ };
}
@Override
- public boolean doesEmptyContainers() {
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (!aBaseMetaTileEntity.isClientSide()) aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}
@Override
- public boolean canTankBeFilled() {
- return true;
+ public final byte getUpdateData() {
+ return 0x00;
}
@Override
- public boolean canTankBeEmptied() {
+ public boolean isFacingValid(byte aFacing) {
return true;
}
@Override
- public boolean displaysItemStack() {
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}
@Override
- public boolean displaysStackSize() {
- return false;
+ public int getTankPressure() {
+ return 100;
}
@Override
- public String[] getInfoData() {
-
- if (mFluid == null) {
- return new String[]{
- EnumChatFormatting.BLUE + "Quantum Tank"+ EnumChatFormatting.RESET,
- "Stored Fluid:",
- EnumChatFormatting.GOLD + "No Fluid"+ EnumChatFormatting.RESET,
- EnumChatFormatting.GREEN + Integer.toString(0) + " L"+ EnumChatFormatting.RESET+" "+
- EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET
- };
- }
- return new String[]{
- EnumChatFormatting.BLUE + "Quantum Tank"+ EnumChatFormatting.RESET,
- "Stored Fluid:",
- EnumChatFormatting.GOLD + mFluid.getLocalizedName()+ EnumChatFormatting.RESET,
- EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L"+ EnumChatFormatting.RESET+" "+
- EnumChatFormatting.YELLOW+ Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET
- };
+ public int getCapacity() {
+ return commonSizeCompute(mTier);
}
@Override
@@ -127,35 +136,24 @@ public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_BasicTank {
}
@Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescriptionArray, mTextures);
- }
+ public String[] getInfoData() {
- private static int CommonSizeCompute(int tier){
- switch(tier){
- case 6:
- return 128000000;
- case 7:
- return 256000000;
- case 8:
- return 512000000;
- case 9:
- return 1024000000;
- case 10:
- return 2147483640;
- default:
- return 0;
+ if (mFluid == null) {
+ return new String[]{
+ EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET,
+ "Stored Fluid:",
+ EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET,
+ EnumChatFormatting.GREEN + Integer.toString(0) + " L" + EnumChatFormatting.RESET + " " +
+ EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L" + EnumChatFormatting.RESET
+ };
}
- }
-
- @Override
- public int getCapacity() {
- return CommonSizeCompute(mTier);
- }
-
- @Override
- public int getTankPressure() {
- return 100;
+ return new String[]{
+ EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET,
+ "Stored Fluid:",
+ EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET,
+ EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " +
+ EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L" + EnumChatFormatting.RESET
+ };
}
}
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java
index 3f53058f8d..373cfa731a 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java
@@ -3,7 +3,17 @@ package gregtech.common.tileentities.storage;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_RenderedGlowTexture;
+import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST_GLOW;
public class GT_MetaTileEntity_SuperChest extends GT_MetaTileEntity_DigitalChestBase {
public int mItemCount = 0;
@@ -20,20 +30,34 @@ public class GT_MetaTileEntity_SuperChest extends GT_MetaTileEntity_DigitalChest
public GT_MetaTileEntity_SuperChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
+
@Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperChest(mName, mTier, mDescriptionArray, mTextures);
+ protected ItemStack getItemStack() {
+ return mItemStack;
}
+
@Override
- protected String chestName(){ return "Super Chest"; }
+ protected void setItemStack(ItemStack s) {
+ mItemStack = s;
+ }
+
@Override
- protected int getItemCount() { return mItemCount; }
+ protected int getItemCount() {
+ return mItemCount;
+ }
+
@Override
public void setItemCount(int aCount) {
mItemCount = aCount;
}
+
@Override
- protected ItemStack getItemStack(){ return mItemStack; }
+ protected String chestName() {
+ return "Super Chest";
+ }
+
@Override
- protected void setItemStack(ItemStack s){ mItemStack = s; }
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SuperChest(mName, mTier, mDescriptionArray, mTextures);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java
index c8b4bf20d8..65de4b3362 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java
@@ -1,18 +1,39 @@
package gregtech.common.tileentities.storage;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK_GLOW;
public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_BasicTank {
public GT_MetaTileEntity_SuperTank(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "Stores " + CommonSizeCompute(aTier) + "L of fluid");
+ super(aID, aName, aNameRegional, aTier, 3, "Stores " + commonSizeCompute(aTier) + "L of fluid");
+ }
+
+ private static int commonSizeCompute(int tier) {
+ switch (tier) {
+ case 1:
+ return 4000000;
+ case 2:
+ return 8000000;
+ case 3:
+ return 16000000;
+ case 4:
+ return 32000000;
+ case 5:
+ return 64000000;
+ default:
+ return 0;
+ }
}
public GT_MetaTileEntity_SuperTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -29,96 +50,84 @@ public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_BasicTank {
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_STANK)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]};
+ public boolean isSimpleMachine() {
+ return true;
}
@Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
+ public boolean doesFillContainers() {
+ return true;
}
@Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
+ public boolean doesEmptyContainers() {
return true;
}
@Override
- public boolean isSimpleMachine() {
+ public boolean canTankBeFilled() {
return true;
}
@Override
- public boolean isFacingValid(byte aFacing) {
+ public boolean canTankBeEmptied() {
return true;
}
@Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ public boolean displaysItemStack() {
return true;
}
@Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
+ public boolean displaysStackSize() {
+ return false;
}
@Override
- public final byte getUpdateData() {
- return 0x00;
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SuperTank(mName, mTier, mDescription, mTextures);
}
@Override
- public boolean doesFillContainers() {
- return true;
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]};
+ return new ITexture[]{
+ MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(OVERLAY_QTANK),
+ new GT_RenderedGlowTexture(OVERLAY_QTANK_GLOW)
+ };
}
@Override
- public boolean doesEmptyContainers() {
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (!aBaseMetaTileEntity.isClientSide()) aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}
@Override
- public boolean canTankBeFilled() {
- return true;
+ public final byte getUpdateData() {
+ return 0x00;
}
@Override
- public boolean canTankBeEmptied() {
+ public boolean isFacingValid(byte aFacing) {
return true;
}
@Override
- public boolean displaysItemStack() {
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}
@Override
- public boolean displaysStackSize() {
- return false;
+ public int getTankPressure() {
+ return 100;
}
@Override
- public String[] getInfoData() {
-
- if (mFluid == null) {
- return new String[]{
- EnumChatFormatting.BLUE + "Super Tank"+ EnumChatFormatting.RESET,
- "Stored Fluid:",
- EnumChatFormatting.GOLD + "No Fluid"+ EnumChatFormatting.RESET,
- EnumChatFormatting.GREEN + Integer.toString(0) + " L"+ EnumChatFormatting.RESET+" "+
- EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET
- };
- }
- return new String[]{
- EnumChatFormatting.BLUE + "Super Tank"+ EnumChatFormatting.RESET,
- "Stored Fluid:",
- EnumChatFormatting.GOLD + mFluid.getLocalizedName()+ EnumChatFormatting.RESET,
- EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L"+ EnumChatFormatting.RESET+" "+
- EnumChatFormatting.YELLOW+ Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET
- };
+ public int getCapacity() {
+ return commonSizeCompute(mTier);
}
@Override
@@ -127,35 +136,24 @@ public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_BasicTank {
}
@Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperTank(mName, mTier, mDescription, mTextures);
- }
+ public String[] getInfoData() {
- private static int CommonSizeCompute(int tier){
- switch(tier){
- case 1:
- return 4000000;
- case 2:
- return 8000000;
- case 3:
- return 16000000;
- case 4:
- return 32000000;
- case 5:
- return 64000000;
- default:
- return 0;
+ if (mFluid == null) {
+ return new String[]{
+ EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET,
+ "Stored Fluid:",
+ EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET,
+ EnumChatFormatting.GREEN + "0 L" + EnumChatFormatting.RESET + " " +
+ EnumChatFormatting.YELLOW + getCapacity() + " L" + EnumChatFormatting.RESET
+ };
}
- }
-
- @Override
- public int getCapacity() {
- return CommonSizeCompute(mTier);
- }
-
- @Override
- public int getTankPressure() {
- return 100;
+ return new String[]{
+ EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET,
+ "Stored Fluid:",
+ EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET,
+ EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " +
+ EnumChatFormatting.YELLOW + getCapacity() + " L" + EnumChatFormatting.RESET
+ };
}
}