Skip to content

Commit

Permalink
Prevent non-patterns being pumped into the patternchest.
Browse files Browse the repository at this point in the history
Partially fixes #1684, but duping patterns is not a big deal.
  • Loading branch information
bonii-xx committed Aug 7, 2015
1 parent 9277180 commit 50441d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/tconstruct/tools/logic/PatternChestLogic.java
Expand Up @@ -3,7 +3,9 @@
import mantle.blocks.abstracts.InventoryLogic;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import tconstruct.library.util.IPattern;
import tconstruct.tools.inventory.PatternChestContainer;

public class PatternChestLogic extends InventoryLogic
Expand Down Expand Up @@ -43,6 +45,11 @@ public boolean hasCustomInventoryName ()
return true;
}

@Override
public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
return itemstack != null && itemstack.getItem() instanceof IPattern;
}

@Override
public void openInventory ()
{
Expand Down

0 comments on commit 50441d7

Please sign in to comment.