add early escape for crafter pattern insertion (#2978)
This commit is contained in:
@@ -30,6 +30,7 @@ import net.minecraftforge.items.IItemHandler;
|
|||||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||||
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -67,6 +68,16 @@ public class CrafterNetworkNode extends NetworkNode implements ICraftingPatternC
|
|||||||
public int getSlotLimit(int slot) {
|
public int getSlotLimit(int slot) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
|
||||||
|
if (!stacks.get(slot).isEmpty()) {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.insertItem(slot, stack, simulate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.addValidator(new PatternItemValidator(world))
|
.addValidator(new PatternItemValidator(world))
|
||||||
.addListener(new NetworkNodeInventoryListener(this))
|
.addListener(new NetworkNodeInventoryListener(this))
|
||||||
|
Reference in New Issue
Block a user