@Override public void change(Event e, Object[] delta, Changer.ChangeMode mode) { Block b = getExpr().getSingle(e); if (b == null) { return; } if (b.getState() instanceof BeaconInventory) { ((BeaconInventory) b.getState()).setItem((ItemStack) delta[0]); } }
@Nullable @Override public ItemStack convert(@NotNull Block block) { BlockState state = block.getState(); return state instanceof BeaconInventory ? ((BeaconInventory) state).getItem() : null; }