From 2786022b26269185d2134e7a4aca6c5cc7d1e5e2 Mon Sep 17 00:00:00 2001 From: Shadows_of_Fire Date: Sun, 28 Oct 2018 13:38:26 -0400 Subject: [PATCH] Closes #1198 --- .../mod/tile/TileEntityPhantomBreaker.java | 4 ++-- .../mod/tile/TileEntityPhantomPlacer.java | 2 +- .../actuallyadditions/mod/util/ItemStackHandlerAA.java | 8 +------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBreaker.java index 8a73bd117..5aa079c2f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBreaker.java @@ -23,7 +23,7 @@ public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer { @Override public IAcceptor getAcceptor() { - return ItemStackHandlerAA.ACCEPT_FALSE; + return (slot, stack, automation) -> !automation; } @Override @@ -31,4 +31,4 @@ public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer { return ItemStackHandlerAA.REMOVE_TRUE; } -} +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 81b18db4e..9141737bf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -196,7 +196,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements @Override public IRemover getRemover() { - return ItemStackHandlerAA.REMOVE_FALSE; + return (slot, automation) -> !automation; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java index b97ff658d..39ecb2899 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java @@ -73,13 +73,7 @@ public class ItemStackHandlerAA extends ItemStackHandler { } public final boolean canAccept(int slot, ItemStack stack, boolean automation) { - IAcceptor acceptor = getAcceptor(); - try { - return acceptor.canAccept(slot, stack, automation); - } catch (NullPointerException e) { - e.printStackTrace(); - return false; - } + return getAcceptor().canAccept(slot, stack, automation); } public final boolean canRemove(int slot, boolean automation) {