OSDN Git Service

修正・変更
[chemicraft/chemicraft.git] / common / pcc / chemicraft / core / slot / SlotPyrolysisTableFuel.java
index 72fbb99..3ab1389 100644 (file)
@@ -1,7 +1,11 @@
 package pcc.chemicraft.core.slot;
 
+import java.util.Iterator;
+
 import net.minecraft.inventory.IInventory;
 import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import pcc.chemicraft.core.ChemiCraftAPI;
 
 public class SlotPyrolysisTableFuel extends Slot {
 
@@ -9,4 +13,16 @@ public class SlotPyrolysisTableFuel extends Slot {
                super(par1IInventory, par2, par3, par4);
        }
 
+       @Override
+       public boolean isItemValid(ItemStack par1ItemStack) {
+               Iterator<ItemStack> itFuel = ChemiCraftAPI.getPyrolysisFuelList().keySet().iterator();
+               while (itFuel.hasNext()) {
+                       ItemStack fuel = itFuel.next();
+                       if (par1ItemStack != null && par1ItemStack.itemID == fuel.itemID) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
 }