aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-08-26 15:45:26 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-08-26 15:45:26 +1000
commitd8068556c49aee29368be0955228e4b937f761de (patch)
tree22f5b3bc3f58411e63a4cc010496ece0927b0b5a /src/Java
parent5fc4bb0b2c75e156fc1ab896b6a4fbd0dd7ec747 (diff)
downloadGT5-Unofficial-d8068556c49aee29368be0955228e4b937f761de.tar.gz
GT5-Unofficial-d8068556c49aee29368be0955228e4b937f761de.tar.bz2
GT5-Unofficial-d8068556c49aee29368be0955228e4b937f761de.zip
+ Added new GUIs for more multiblocks.
% Rewrote the way multiblocks in GT++ handle GUIs, to allow for more flexibility.
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/gtPlusPlus/RoadMap.java47
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/ObjMap.java281
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java96
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java25
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java11
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java17
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java7
37 files changed, 588 insertions, 137 deletions
diff --git a/src/Java/gtPlusPlus/RoadMap.java b/src/Java/gtPlusPlus/RoadMap.java
index bbd602cab4..11714ef2cb 100644
--- a/src/Java/gtPlusPlus/RoadMap.java
+++ b/src/Java/gtPlusPlus/RoadMap.java
@@ -1,5 +1,12 @@
package gtPlusPlus;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.data.ObjMap;
+import net.minecraft.item.ItemStack;
+
/**
* This Class purely exists to note down ideas and or plans to (re)implement things.
*
@@ -14,7 +21,7 @@ public class RoadMap {
* Issues occur where Classes like CI.java try access the GregtechItemList.java objects before they're actually set.
* A plan should be created to organize the best scheme to load things in the best order.
*/
-
+
//Recreation of GUIs for all Multiblocks
/*
* Most Multi's use generic or straight out wrong GUI's on the controller.
@@ -23,7 +30,7 @@ public class RoadMap {
* Some could even benefit from a totally new type of UI (Instead of Text issues, just change a 2x2px area between red and green for status lights)
* These advanced GUIs are probably out of my capability, but if anyone thinks they're a good idea, I'll give them a go.
*/
-
+
//Better Integration with GTNH
/*
* Refactor things to be more common, refactor things to automatically switch between GTNH and standard variants
@@ -31,6 +38,38 @@ public class RoadMap {
* Most of this can be done via expanding CI.java, so that we have automated handlers for everything
* (IE. getX(5) will get 5x of the correct version of X)
*/
-
-
+
+
+ /*private static final LinkedHashMap<String, ObjMap<Integer, Boolean>>mCachedResults = new LinkedHashMap<String, ObjMap<Integer, Boolean>>();
+ public boolean contains(ItemStack aStack) {
+ if (aStack == null){
+ return false;
+ }
+ ObjMap<Integer, Boolean> aCurrentSet;
+ if (mCachedResults.get(this.toString()) != null){
+ aCurrentSet = mCachedResults.get(this.toString());
+ }
+
+ else {
+ aCurrentSet = new ObjMap<Integer, Boolean>(mPrefixedItems.size(), 0.5f);
+ mCachedResults.put(this.toString(), aCurrentSet);
+ }
+
+ if (aCurrentSet.get(aStack.hashCode()) != null){
+ return aCurrentSet.get(aStack.hashCode());
+ }
+ else {
+ for (ItemStack tStack : mPrefixedItems){
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())){
+ aCurrentSet.put(aStack.hashCode(), true);
+ return true;
+ }
+ }
+ }
+ aCurrentSet.put(aStack.hashCode(), false);
+ return false;
+ }*/
+
+
+
}
diff --git a/src/Java/gtPlusPlus/api/objects/data/ObjMap.java b/src/Java/gtPlusPlus/api/objects/data/ObjMap.java
new file mode 100644
index 0000000000..e611dacc2a
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/data/ObjMap.java
@@ -0,0 +1,281 @@
+package gtPlusPlus.api.objects.data;
+
+import java.util.Arrays;
+
+/**
+ * Object-2-object map based on IntIntMap4a
+ */
+public class ObjMap<K, V>
+{
+ private static final Object FREE_KEY = new Object();
+ private static final Object REMOVED_KEY = new Object();
+
+ /** Keys and values */
+ private Object[] m_data;
+
+ /** Value for the null key (if inserted into a map) */
+ private Object m_nullValue;
+ private boolean m_hasNull;
+
+ /** Fill factor, must be between (0 and 1) */
+ private final float m_fillFactor;
+ /** We will resize a map once it reaches this size */
+ private int m_threshold;
+ /** Current map size */
+ private int m_size;
+ /** Mask to calculate the original position */
+ private int m_mask;
+ /** Mask to wrap the actual array pointer */
+ private int m_mask2;
+
+ public ObjMap( final int size, final float fillFactor )
+ {
+ if ( fillFactor <= 0 || fillFactor >= 1 )
+ throw new IllegalArgumentException( "FillFactor must be in (0, 1)" );
+ if ( size <= 0 )
+ throw new IllegalArgumentException( "Size must be positive!" );
+ final int capacity = arraySize(size, fillFactor);
+ m_mask = capacity - 1;
+ m_mask2 = capacity * 2 - 1;
+ m_fillFactor = fillFactor;
+
+ m_data = new Object[capacity * 2];
+ Arrays.fill( m_data, FREE_KEY );
+
+ m_threshold = (int) (capacity * fillFactor);
+ }
+
+ @SuppressWarnings("unchecked")
+ public V get( final K key )
+ {
+ if ( key == null )
+ return (V) m_nullValue; //we null it on remove, so safe not to check a flag here
+
+ int ptr = (key.hashCode() & m_mask) << 1;
+ Object k = m_data[ ptr ];
+
+ if ( k == FREE_KEY )
+ return null; //end of chain already
+ if ( k.equals( key ) ) //we check FREE and REMOVED prior to this call
+ return (V) m_data[ ptr + 1 ];
+ while ( true )
+ {
+ ptr = (ptr + 2) & m_mask2; //that's next index
+ k = m_data[ ptr ];
+ if ( k == FREE_KEY )
+ return null;
+ if ( k.equals( key ) )
+ return (V) m_data[ ptr + 1 ];
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public V put( final K key, final V value )
+ {
+ if ( key == null )
+ return insertNullKey(value);
+
+ int ptr = getStartIndex(key) << 1;
+ Object k = m_data[ptr];
+
+ if ( k == FREE_KEY ) //end of chain already
+ {
+ m_data[ ptr ] = key;
+ m_data[ ptr + 1 ] = value;
+ if ( m_size >= m_threshold )
+ rehash( m_data.length * 2 ); //size is set inside
+ else
+ ++m_size;
+ return null;
+ }
+ else if ( k.equals( key ) ) //we check FREE and REMOVED prior to this call
+ {
+ final Object ret = m_data[ ptr + 1 ];
+ m_data[ ptr + 1 ] = value;
+ return (V) ret;
+ }
+
+ int firstRemoved = -1;
+ if ( k == REMOVED_KEY )
+ firstRemoved = ptr; //we may find a key later
+
+ while ( true )
+ {
+ ptr = ( ptr + 2 ) & m_mask2; //that's next index calculation
+ k = m_data[ ptr ];
+ if ( k == FREE_KEY )
+ {
+ if ( firstRemoved != -1 )
+ ptr = firstRemoved;
+ m_data[ ptr ] = key;
+ m_data[ ptr + 1 ] = value;
+ if ( m_size >= m_threshold )
+ rehash( m_data.length * 2 ); //size is set inside
+ else
+ ++m_size;
+ return null;
+ }
+ else if ( k.equals( key ) )
+ {
+ final Object ret = m_data[ ptr + 1 ];
+ m_data[ ptr + 1 ] = value;
+ return (V) ret;
+ }
+ else if ( k == REMOVED_KEY )
+ {
+ if ( firstRemoved == -1 )
+ firstRemoved = ptr;
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public V remove( final K key )
+ {
+ if ( key == null )
+ return removeNullKey();
+
+ int ptr = getStartIndex(key) << 1;
+ Object k = m_data[ ptr ];
+ if ( k == FREE_KEY )
+ return null; //end of chain already
+ else if ( k.equals( key ) ) //we check FREE and REMOVED prior to this call
+ {
+ --m_size;
+ if ( m_data[ ( ptr + 2 ) & m_mask2 ] == FREE_KEY )
+ m_data[ ptr ] = FREE_KEY;
+ else
+ m_data[ ptr ] = REMOVED_KEY;
+ final V ret = (V) m_data[ ptr + 1 ];
+ m_data[ ptr + 1 ] = null;
+ return ret;
+ }
+ while ( true )
+ {
+ ptr = ( ptr + 2 ) & m_mask2; //that's next index calculation
+ k = m_data[ ptr ];
+ if ( k == FREE_KEY )
+ return null;
+ else if ( k.equals( key ) )
+ {
+ --m_size;
+ if ( m_data[ ( ptr + 2 ) & m_mask2 ] == FREE_KEY )
+ m_data[ ptr ] = FREE_KEY;
+ else
+ m_data[ ptr ] = REMOVED_KEY;
+ final V ret = (V) m_data[ ptr + 1 ];
+ m_data[ ptr + 1 ] = null;
+ return ret;
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private V insertNullKey(final V value)
+ {
+ if ( m_hasNull )
+ {
+ final Object ret = m_nullValue;
+ m_nullValue = value;
+ return (V) ret;
+ }
+ else
+ {
+ m_nullValue = value;
+ ++m_size;
+ return null;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private V removeNullKey()
+ {
+ if ( m_hasNull )
+ {
+ final Object ret = m_nullValue;
+ m_nullValue = null;
+ m_hasNull = false;
+ --m_size;
+ return (V) ret;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public int size()
+ {
+ return m_size;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void rehash( final int newCapacity )
+ {
+ m_threshold = (int) (newCapacity/2 * m_fillFactor);
+ m_mask = newCapacity/2 - 1;
+ m_mask2 = newCapacity - 1;
+
+ final int oldCapacity = m_data.length;
+ final Object[] oldData = m_data;
+
+ m_data = new Object[ newCapacity ];
+ Arrays.fill( m_data, FREE_KEY );
+
+ m_size = m_hasNull ? 1 : 0;
+
+ for ( int i = 0; i < oldCapacity; i += 2 ) {
+ final Object oldKey = oldData[ i ];
+ if( oldKey != FREE_KEY && oldKey != REMOVED_KEY )
+ put( (K)oldKey, (V)oldData[ i + 1 ]);
+ }
+ }
+
+ public int getStartIndex( final Object key )
+ {
+ //key is not null here
+ return key.hashCode() & m_mask;
+ }
+
+ /** Taken from FastUtil implementation */
+
+ /** Return the least power of two greater than or equal to the specified value.
+ *
+ * <p>Note that this function will return 1 when the argument is 0.
+ *
+ * @param x a long integer smaller than or equal to 2<sup>62</sup>.
+ * @return the least power of two greater than or equal to the specified value.
+ */
+ public static long nextPowerOfTwo( long x ) {
+ if ( x == 0 ) return 1;
+ x--;
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+ return ( x | x >> 32 ) + 1;
+ }
+
+ /** Returns the least power of two smaller than or equal to 2<sup>30</sup> and larger than or equal to <code>Math.ceil( expected / f )</code>.
+ *
+ * @param expected the expected number of elements in a hash table.
+ * @param f the load factor.
+ * @return the minimum possible size for a backing array.
+ * @throws IllegalArgumentException if the necessary size is larger than 2<sup>30</sup>.
+ */
+ public static int arraySize( final int expected, final float f ) {
+ final long s = Math.max( 2, nextPowerOfTwo( (long)Math.ceil( expected / f ) ) );
+ if ( s > (1 << 30) ) throw new IllegalArgumentException( "Too large (" + expected + " expected elements with load factor " + f + ")" );
+ return (int)s;
+ }
+
+ //taken from FastUtil
+ private static final int INT_PHI = 0x9E3779B9;
+
+ public static int phiMix( final int x ) {
+ final int h = x * INT_PHI;
+ return h ^ (h >> 16);
+}
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index b818abdd21..d64fecb032 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -121,7 +121,7 @@ public class HANDLER_GT {
long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(aI);
//Logger.INFO("Found "+aType+"Turbine made out of "+getMaterialName(aMainMaterial)+", using "+getMaterialName(aSecondaryMaterial));
if (rotorDurabilityMax < aCutoff) {
- Logger.INFO("[Turbine Cleanup]"+getMaterialName(aMainMaterial)+" "+aType+"Turbines have "+rotorDurabilityMax+", which is below the cutoff durability of "+aCutoff+", disabling.");
+ Logger.INFO("[Turbine Cleanup] "+getMaterialName(aMainMaterial)+" "+aType+"Turbines have "+rotorDurabilityMax+", which is below the cutoff durability of "+aCutoff+", disabling.");
aG.mEnabled = false;
aG.mHidden = true;
aG.mCanBeBuffered = false;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
index ff75ff3ca8..a3f48ffd30 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
@@ -4,7 +4,7 @@ import net.minecraft.entity.player.InventoryPlayer;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
+import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_MassFabricator;
/**
@@ -24,11 +24,10 @@ public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine {
public CONTAINER_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
super(aInventoryPlayer, aTileEntity, bindInventory);
}
-}
-/*@Override
+ @Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 1, 152, 5));
+ addSlotToContainer(new SlotNoInput(mTileEntity, 1, 152, 5));
}
@Override
@@ -40,4 +39,4 @@ public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine {
public int getShiftClickSlotCount() {
return 0;
}
-}*/
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java
new file mode 100644
index 0000000000..9d38295d4e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java
@@ -0,0 +1,96 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_Container_MultiMachine;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase;
+import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GUI_Multi_Basic_Slotted extends GT_GUIContainerMetaTile_Machine {
+ String mName = "";
+
+ public GUI_Multi_Basic_Slotted(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
+ String aTextureFile) {
+ super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName;
+ }
+
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
+ if (this.mContainer != null) {
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0) {
+ this.fontRendererObj.drawString(this.trans("132", "Pipe is loose."), 10, 16, 16448255);
+ }
+
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0) {
+ this.fontRendererObj.drawString(this.trans("133", "Screws are missing."), 10, 24, 16448255);
+ }
+
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0) {
+ this.fontRendererObj.drawString(this.trans("134", "Something is stuck."), 10, 32, 16448255);
+ }
+
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0) {
+ this.fontRendererObj.drawString(this.trans("135", "Platings are dented."), 10, 40, 16448255);
+ }
+
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0) {
+ this.fontRendererObj.drawString(this.trans("136", "Circuitry burned out."), 10, 48, 16448255);
+ }
+
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0) {
+ this.fontRendererObj.drawString(this.trans("137", "That doesn\'t belong there."), 10, 56, 16448255);
+ }
+
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 10, 64, 16448255);
+ }
+
+ if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
+ if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString(this.trans("139", "Hit with Soft Hammer"), 10, 16, 16448255);
+ this.fontRendererObj.drawString(this.trans("140", "to (re-)start the Machine"), 10, 24, 16448255);
+ this.fontRendererObj.drawString(this.trans("141", "if it doesn\'t start."), 10, 32, 16448255);
+ } else {
+ this.fontRendererObj.drawString(this.trans("142", "Running perfectly."), 10, 16, 16448255);
+ }
+
+ ItemStack tItem;
+ if (this.mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DrillerBase) {
+ tItem = this.mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1);
+ if (tItem == null
+ || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ this.fontRendererObj.drawString(this.trans("143", "Missing Mining Pipe"), 10,
+ ((GT_Container_MultiMachine) this.mContainer).mActive == 0 ? 40 : 24, 16448255);
+ }
+ } else if (this.mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) {
+ tItem = this.mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1);
+ if (tItem == null || tItem.getItem() != GT_MetaGenerated_Tool_01.INSTANCE
+ || tItem.getItemDamage() < 170 || tItem.getItemDamage() > 177) {
+ this.fontRendererObj.drawString(this.trans("144", "Missing Turbine Rotor"), 10,
+ ((GT_Container_MultiMachine) this.mContainer).mActive == 0 ? 40 : 24, 16448255);
+ }
+ }
+ }
+ }
+
+ }
+
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index d046ff48f8..7a26e695ab 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -39,6 +39,7 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery;
import net.minecraft.entity.player.EntityPlayer;
@@ -89,14 +90,28 @@ GT_MetaTileEntity_MultiBlockBase {
return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
}
}
+
+ public abstract String getCustomGUIResourceName();
+
+ public boolean requiresVanillaGtGUI() {
+ return false;
+ }
@Override
public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ String aCustomGUI = getCustomGUIResourceName();
+ aCustomGUI = aCustomGUI != null ? aCustomGUI : "MultiblockDisplay";
+ aCustomGUI = aCustomGUI + ".png";
if (hasSlotInGUI()) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png");
+ if (!requiresVanillaGtGUI()) {
+ return new GUI_Multi_Basic_Slotted(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ }
+ else {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ }
}
else {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png");
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
index 339290f8dd..733bdab683 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
@@ -16,12 +16,10 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.ItemStackData;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementat