aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/forestry/trees
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/xmod/forestry/trees
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/xmod/forestry/trees')
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java b/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java
index e00a7ad1a4..9579d0b846 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.forestry.trees;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.common.items.GT_MetaGenerated_Item_02;
import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.slots.SlotBuzzSaw.SAWTOOL;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
@@ -63,16 +66,16 @@ public class TreefarmManager {
public static boolean isWoodLog(Block log){
String tTool = log.getHarvestTool(0);
-
+
if (log == Blocks.log || log == Blocks.log2){
return true;
}
-
+
//IC2 Rubber Tree Compat
if (log.getClass().getName().toLowerCase().contains("rubwood") || log.getClass().getName().toLowerCase().contains("rubleaves")){
return true;
}
-
+
return OrePrefixes.log.contains(new ItemStack(log, 1))&& ((tTool != null) && (tTool.equals("axe"))) || (log.getMaterial() != Material.wood) ? false : (OrePrefixes.fence.contains(new ItemStack(log, 1)) ? false : true);
}
@@ -106,11 +109,11 @@ public class TreefarmManager {
if (air.getLocalizedName().toLowerCase().contains("air")){
return true;
}
-
+
if (air.getClass().getName().toLowerCase().contains("residual") || air.getClass().getName().toLowerCase().contains("heat")){
return true;
}
-
+
//Utils.LOG_INFO("Found "+air.getLocalizedName());
return (air == Blocks.air ? true : (air instanceof BlockAir ? true : false));
@@ -120,4 +123,25 @@ public class TreefarmManager {
return (sapling == Blocks.sapling ? true : (sapling == Blocks.))
}*/
+ public static SAWTOOL isCorrectMachinePart(final ItemStack aStack) {
+ if (aStack != null){
+ if (aStack.getItem() instanceof GT_MetaGenerated_Item_02 || aStack.getItem() instanceof GT_MetaGenerated_Tool){
+ if (OrePrefixes.craftingTool.contains(aStack)){
+ if (aStack.getDisplayName().toLowerCase().contains("saw")){
+ if (aStack.getItemDamage() == 10){
+ return SAWTOOL.NONE;
+ }
+ else if (aStack.getItemDamage() == 140){
+ return SAWTOOL.NONE;
+ }
+ else {
+ return SAWTOOL.NONE;
+ }
+ }
+ }
+ }
+ }
+ return SAWTOOL.NONE;
+ }
+
}