fluid packet decoder add slot restricted input

This commit is contained in:
asdflj committed 2022-11-17 10:55:21 +08:00
1 parent dc7c33bfa0
commit 7a18bed394
4 files changed
+32 -3

No files matched your search

@@ -0,0 +1,23 @@
package com.glodblock.github.inventory.slot;
import appeng.container.slot.SlotRestrictedInput;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class FCSlotRestrictedInput extends SlotRestrictedInput {
private ItemStack valid;
public FCSlotRestrictedInput(ItemStack valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p) {
super(PlacableItemType.INSCRIBER_PLATE, i, slotIndex, x, y, p);
this.valid = valid;
}
@Override
public boolean isItemValid(final ItemStack i) {
if (i.getItem().getClass().isAssignableFrom(valid.getItem().getClass())) {
return true;
}
return false;
}
}