aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-01-20 16:56:01 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-01-20 16:56:01 +1000
commit6d609f499069ed4ae4e808ccc446c6acda51cdec (patch)
tree001f5b44c6326911a4c765725cc7820628c4ffab /src/Java/gtPlusPlus/core
parenta6bb1b33da251f4a2ec7a6d6facb4864e9905341 (diff)
downloadGT5-Unofficial-6d609f499069ed4ae4e808ccc446c6acda51cdec.tar.gz
GT5-Unofficial-6d609f499069ed4ae4e808ccc446c6acda51cdec.tar.bz2
GT5-Unofficial-6d609f499069ed4ae4e808ccc446c6acda51cdec.zip
+ Added a new kind of logging message, just for machines, so that people may debug them easily without TOTAL DEBUG mode.
+ Added support for the TreeFarmer to use Saws/Buzzsaws to cut things. They are now required. + Added a GUI for the Tree Farmer. + Added a custom slot class just for Buzzsaw and Saw items. % Tweaked power handling for findLogs() in the Tree Farmer class, it wasn't checking the internal power buffer.
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java4
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java2
-rw-r--r--src/Java/gtPlusPlus/core/proxy/ClientProxy.java2
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java66
-rw-r--r--src/Java/gtPlusPlus/core/util/Utils.java12
5 files changed, 84 insertions, 2 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
index a50524122b..d5764fa86b 100644
--- a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.handler.events;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.proxy.ClientProxy;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.core.util.player.PlayerUtils;
@@ -24,6 +25,9 @@ public class LoginEventHandler {
this.localPlayerRef = event.player;
this.localPlayersName = event.player.getDisplayName();
this.localPlayersUUID = event.player.getUniqueID();
+
+ //Set this for easier use elsewhere.
+ ClientProxy.playerName = this.localPlayersName;
try {
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index e81c5bc4a9..4988db3402 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -79,12 +79,14 @@ public class CORE {
RES_PATH_FLUIDS = MODID + ":" + TEX_DIR_FLUIDS;
+
//public static final Materials2[] MiscGeneratedMaterials = new Materials2[1000];
public static class configSwitches {
//Debug
public static boolean disableEnderIOIntegration = false;
+ public static boolean MACHINE_INFO = false;
//Tools
public static boolean enableSkookumChoochers = true;
diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
index 12b99e76da..11e7f9853a 100644
--- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
+++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
@@ -26,6 +26,8 @@ public class ClientProxy extends CommonProxy{
}
*/
+ public static String playerName = "";
+
@Override
public void preInit(FMLPreInitializationEvent e) {
// TODO Auto-generated method stub
diff --git a/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java b/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java
new file mode 100644
index 0000000000..0d8ce34ab5
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java
@@ -0,0 +1,66 @@
+package gtPlusPlus.core.slots;
+
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.common.items.GT_MetaGenerated_Item_02;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotBuzzSaw extends Slot{
+
+ public SAWTOOL currentTool = SAWTOOL.NONE;
+
+ public SlotBuzzSaw(IInventory inventory, int slot, int x, int y) {
+ super(inventory, slot, x, y);
+
+ }
+
+ @Override
+ public boolean isItemValid(ItemStack itemstack) {
+ boolean isValid = false;
+
+ if (itemstack != null){
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Item_02 || itemstack.getItem() instanceof GT_MetaGenerated_Tool){
+ //Buzzsaw Blade //TODO
+ /*if (OrePrefixes.toolHeadBuzzSaw.contains(itemstack)){
+ isValid = false;
+ }*/
+ if (OrePrefixes.craftingTool.contains(itemstack)){
+ if (itemstack.getDisplayName().toLowerCase().contains("saw")){
+ if (itemstack.getItemDamage() == 10){
+ isValid = true;
+ currentTool = SAWTOOL.SAW;
+ }
+ if (itemstack.getItemDamage() == 140){
+ isValid = true;
+ currentTool = SAWTOOL.BUZZSAW;
+ }
+ }
+ }
+ else {
+ currentTool = SAWTOOL.NONE;
+ }
+ }
+ else {
+ currentTool = SAWTOOL.NONE;
+ }
+ }
+ else {
+ currentTool = SAWTOOL.NONE;
+ }
+ return isValid;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+ public enum SAWTOOL {
+ NONE,
+ SAW,
+ BUZZSAW
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java
index 4d944788dd..1e9661dd30 100644
--- a/src/Java/gtPlusPlus/core/util/Utils.java
+++ b/src/Java/gtPlusPlus/core/util/Utils.java
@@ -5,6 +5,7 @@ import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.proxy.ClientProxy;
import gtPlusPlus.core.util.fluid.FluidUtils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
@@ -163,6 +164,13 @@ public class Utils {
//}
}
+ //Non-Dev Comments
+ public static void LOG_MACHINE_INFO(String s){
+ if (CORE.configSwitches.MACHINE_INFO || ClientProxy.playerName.toLowerCase().contains("draknyte1")){
+ FMLLog.info("GT++: Machine Info: "+s);
+ }
+ }
+
//Developer Comments
public static void LOG_WARNING(String s){
if (CORE.DEBUG){
@@ -180,7 +188,7 @@ public class Utils {
//Developer Logger
public static void LOG_SPECIFIC_WARNING(String whatToLog, String msg, int line){
//if (!CORE.DEBUG){
- FMLLog.warning("GT++ |"+line+"| "+whatToLog+" | "+msg);
+ FMLLog.warning("GT++ |"+line+"| "+whatToLog+" | "+msg);
//}
}
@@ -540,7 +548,7 @@ public class Utils {
return temp;
}
-
+
public static ToolMaterial generateToolMaterial(Material material){
String name = material.getLocalizedName();
int harvestLevel = material.vHarvestLevel;