Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bedrock Compatibility #170

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public class NetworkQuantumStorage extends SlimefunItem implements DistinctiveIt

public static final int INPUT_SLOT = 1;
public static final int ITEM_SLOT = 4;
public static final int ITEM_SET_SLOT = 13;
public static final int ITEM_SET_SLOT = 12;
public static final int VOIDING_SET_SLOT = 14;
public static final int OUTPUT_SLOT = 7;

private static final ItemStack BACK_INPUT = new CustomItemStack(
Expand All @@ -84,8 +85,13 @@ public class NetworkQuantumStorage extends SlimefunItem implements DistinctiveIt
private static final ItemStack SET_ITEM = new CustomItemStack(
Material.LIME_STAINED_GLASS_PANE,
Theme.SUCCESS + "Set Item",
Theme.PASSIVE + "Drag an item on top of this pane to register it.",
Theme.PASSIVE + "Shift Click to change voiding"
Theme.PASSIVE + "Drag an item on top of this pane to register it."
);

private static final ItemStack SET_VOIDING = new CustomItemStack(
Material.BLACK_STAINED_GLASS_PANE,
Theme.SUCCESS + "Toggle Voiding",
Theme.PASSIVE + "Click to toggle voiding."
);

private static final ItemStack BACK_OUTPUT = new CustomItemStack(
Expand All @@ -96,7 +102,7 @@ public class NetworkQuantumStorage extends SlimefunItem implements DistinctiveIt
private static final int[] INPUT_SLOTS = new int[]{0, 2};
private static final int[] ITEM_SLOTS = new int[]{3, 5};
private static final int[] OUTPUT_SLOTS = new int[]{6, 8};
private static final int[] BACKGROUND_SLOTS = new int[]{9, 10, 11, 12, 14, 15, 16, 17};
private static final int[] BACKGROUND_SLOTS = new int[]{9, 10, 11, 13, 15, 16, 17};

private static final Map<Location, QuantumCache> CACHES = new HashMap<>();

Expand Down Expand Up @@ -233,6 +239,7 @@ public void init() {
addItem(i, BACK_OUTPUT, (p, slot, item, action) -> false);
}
addItem(ITEM_SET_SLOT, SET_ITEM, (p, slot, item, action) -> false);
addItem(VOIDING_SET_SLOT, SET_VOIDING, (p, slot, item, action) -> false);
addMenuClickHandler(ITEM_SLOT, ChestMenuUtils.getEmptyClickHandler());
drawBackground(BACKGROUND_SLOTS);
}
Expand All @@ -255,11 +262,12 @@ public int[] getSlotsAccessedByItemTransport(ItemTransportFlow flow) {
@Override
public void newInstance(@Nonnull BlockMenu menu, @Nonnull Block block) {
menu.addMenuClickHandler(ITEM_SET_SLOT, (p, slot, item, action) -> {
if (action.isShiftClicked()) {
toggleVoid(menu);
} else {
setItem(menu, p);
}
setItem(menu, p);
return false;
});

menu.addMenuClickHandler(VOIDING_SET_SLOT, (p, slot, item, action) -> {
toggleVoid(menu);
return false;
});

Expand Down
Loading