aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java
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/slots/SlotBuzzSaw.java
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/slots/SlotBuzzSaw.java')
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java66
1 files changed, 66 insertions, 0 deletions
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
+ }
+
+}