aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2016-10-03 23:33:28 +1000
committerGitHub <noreply@github.com>2016-10-03 23:33:28 +1000
commite3f4a410ef0867359cab3ade72a20c3679aaad06 (patch)
tree2f008c251c080a216b0fcf3d03667f7233edceca /src/Java/gtPlusPlus/xmod
parent10aee9adf7a1ab793a05fd9327cec6fcc1b267d2 (diff)
parentbdb6fc4a5410d68cf517dbe90fa49cec45bbda5a (diff)
downloadGT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.tar.gz
GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.tar.bz2
GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.zip
Merge pull request #19 from draknyte1/DesktopPC
+ Added some Buttons to the workbench (WIP) $ Workbench now uses the vanilla recipe handler. $ Fixed the tool slots on the Workbench accepting the wrong items in certain cases. + Added hundreds of new machine recipes for all of the materials, due to below. $ Rewrote recipe generation classes, things like plate bending and extrusion recipes now fall in line with GT tiering. + Added more functions to Materials.java, now you can get any item from them. (getDustSmall(5)) % Changed tool handling to better support older versions of Gregtech that don't allow Wrenchs to work as a BC/EIO wrench. % Moved more GT related content to HANDLER_GT. + Added a basic re-implementation of the Meta Tile Entity system for GT Machines, using my own blocks as a base. In a feeble attempt to store NBT data to Itemblocks on drop/break. % Changed lots of debug logging to only show in debug mode, if I missed anything, let me know.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java29
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java16
5 files changed, 38 insertions, 34 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 0808eab6b3..8140839cac 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -1,10 +1,12 @@
package gtPlusPlus.xmod.gregtech;
import gregtech.api.util.GT_Config;
+import gtPlusPlus.core.handler.COMPAT_HANDLER;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
+import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks;
import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
@@ -12,40 +14,33 @@ public class HANDLER_GT {
public static GT_Config mMaterialProperties = null;
+ @SuppressWarnings("unused")
public static void preInit(){
new MetaGeneratedGregtechItems();
if (mMaterialProperties != null){
GT_Materials.init(mMaterialProperties);
}
GregtechFluidHandler.run();
- //new Processing_Ingot1();
- //new Processing_Plate1();
- //new Processing_Block();
- //new Processing_HotIngots();
}
+ @SuppressWarnings("unused")
public static void init(){
+ //Load General Blocks and set up some Basic Meta Tile Entitie states
+ Gregtech_Blocks.run();
+
+ //Register Tile Entities
+ COMPAT_HANDLER.registerGregtechMachines();
+
//Add Custom Pipes, Wires and Cables.
GregtechConduits.run();
new MetaGeneratedGregtechTools();
new ProcessingToolHeadChoocher().run();
- /*if (Meta_GT_Proxy.mSortToTheEnd) {
- new GT_ItemIterator().run();
- Meta_GT_Proxy.registerUnificationEntries();
- new GT_FuelLoader().run();
- }*/
+
}
public static void postInit(){
- /*Meta_GT_Proxy.activateOreDictHandler();
- if (Meta_GT_Proxy.mSortToTheEnd) {
- Meta_GT_Proxy.registerUnificationEntries();
- } else {
- new GT_ItemIterator().run();
- Meta_GT_Proxy.registerUnificationEntries();
- new GT_FuelLoader().run();
- }*/
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java
index a0bf55a39a..c199114daa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java
@@ -5,7 +5,6 @@ import gregtech.api.gui.GT_Container_BasicTank;
import gregtech.api.gui.GT_GUIContainer_BasicTank;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -17,7 +16,7 @@ import net.minecraftforge.fluids.FluidStack;
* <p/>
* This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually
*/
-public abstract class GregtechMetaBasicTank extends GT_MetaTileEntity_TieredMachineBlock {
+public abstract class GregtechMetaBasicTank extends GregtechMetaTieredMachineBlock {
public FluidStack mFluid;
public FluidStack mInternal;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
index 15bd666b53..05abaa00da 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -10,6 +10,7 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.ToolDictNames;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.objects.ItemData;
import gregtech.api.objects.MaterialStack;
import gregtech.api.util.GT_Log;
@@ -42,6 +43,9 @@ import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class Meta_GT_Proxy {
+
+ //Store Some MetaTileEntity Data here, why not?
+ public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[GregTech_API.MAXIMUM_METATILE_IDS];
//Silly Vars
private static final Collection<String> mIgnoredItems = new HashSet<String>(Arrays.asList(new String[]{"itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater",
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java
index b78980f3e3..7d6c3caec7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java
@@ -77,9 +77,9 @@ public class GregtechMetaTileEntityMultiTank
private long getMaximumTankStorage(){
int multiplier = getStorageMultiplier();
- Utils.LOG_INFO("x = "+multiplier+" * 96000");
+ Utils.LOG_WARNING("x = "+multiplier+" * 96000");
long tempTankStorageMax = (96000*multiplier);
- Utils.LOG_INFO("x = "+tempTankStorageMax);
+ Utils.LOG_WARNING("x = "+tempTankStorageMax);
if (tempTankStorageMax <= 0){
return 96000;
}
@@ -207,7 +207,7 @@ public class GregtechMetaTileEntityMultiTank
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- Utils.LOG_INFO("Must be hollow.");
+ Utils.LOG_WARNING("Must be hollow.");
return false;
}
int tAmount = 0;
@@ -219,20 +219,20 @@ public class GregtechMetaTileEntityMultiTank
if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17))) {
if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
if (h < 3){
- Utils.LOG_INFO("Casing Expected.");
+ Utils.LOG_WARNING("Casing Expected.");
return false;
}
else if (h >= 3){
- //Utils.LOG_INFO("Your Multitank can be 20 blocks tall.");
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
}
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
if (h < 3){
- Utils.LOG_INFO("Wrong Meta.");
+ Utils.LOG_WARNING("Wrong Meta.");
return false;
}
else if (h >= 3){
- //Utils.LOG_INFO("Your Multitank can be 20 blocks tall.");
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
}
}
if (h < 3){
@@ -240,10 +240,10 @@ public class GregtechMetaTileEntityMultiTank
}
else if (h >= 3){
if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){
- Utils.LOG_INFO("Found air");
+ Utils.LOG_WARNING("Found air");
}
else {
- Utils.LOG_INFO("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank.");
+ Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank.");
tAmount++;
}
}
@@ -253,7 +253,7 @@ public class GregtechMetaTileEntityMultiTank
}
}
multiblockCasingCount = (short) tAmount;
- Utils.LOG_INFO("Your Multitank can be 20 blocks tall.");
+ Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+getMaximumTankStorage()+"L");
return tAmount >= 16;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
index 7a2e49492d..6bce3b9f67 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
@@ -16,10 +16,10 @@ public class GT_MetaTileEntity_TieredTank
extends GregtechMetaBasicTank {
protected FluidStack internalTank = getInternalStack();
- protected String fluidName = getFluidName();
- protected int fluidAmount = getInternalFluidAmount();
+ /*protected String fluidName = getFluidName();
+ protected int fluidAmount = getInternalFluidAmount();*/
- private String getFluidName(){
+ /*private String getFluidName(){
String x;
if (internalTank != null){
x = internalTank.getFluid().getName();
@@ -39,7 +39,7 @@ public class GT_MetaTileEntity_TieredTank
x = 0;
}
return x;
- }
+ }*/
public GT_MetaTileEntity_TieredTank(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid");
@@ -89,8 +89,14 @@ public class GT_MetaTileEntity_TieredTank
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
+ Utils.LOG_INFO("Right Click on Block");
+ if (aBaseMetaTileEntity.isClientSide()){
+ Utils.LOG_INFO("MTE is ClientSide");
+ return true;
+ }
+ Utils.LOG_INFO("MTE is not ClientSide");
aBaseMetaTileEntity.openGUI(aPlayer);
+ Utils.LOG_INFO("MTE is now has an open GUI");
return true;
}