From ede15c7b24f5d10fbd2e16d449ce119c6bc9675d Mon Sep 17 00:00:00 2001 From: reobf <2215595288@qq.com> Date: Mon, 22 Jul 2024 18:50:39 +0800 Subject: [PATCH] update --- build.gradle | 2 +- .../gt/metatileentity/MultiCircuitInputBus.java | 3 ++- .../gt/metatileentity/PatternDualInputHatch.java | 14 +++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 6c09481..b8e7318 100644 --- a/build.gradle +++ b/build.gradle @@ -373,7 +373,7 @@ catch (Exception ignored) { // Pulls version first from the VERSION env and then git tag String identifiedVersion = null -String versionOverride = '0.0.17p11' +String versionOverride = '0.0.17p12' try { // Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty if (versionOverride == null) { diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/MultiCircuitInputBus.java b/src/main/java/reobf/proghatches/gt/metatileentity/MultiCircuitInputBus.java index 1e56427..1456e09 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/MultiCircuitInputBus.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/MultiCircuitInputBus.java @@ -26,6 +26,7 @@ import reobf.proghatches.gt.metatileentity.util.IMultiCircuitSupport; import reobf.proghatches.lang.LangManager; import reobf.proghatches.main.registration.Registration; +import reobf.proghatches.util.ProghatchesUtil; public class MultiCircuitInputBus extends GT_MetaTileEntity_Hatch_InputBus implements IMultiCircuitSupport{ @Override @@ -37,7 +38,7 @@ public ItemStackHandler getInventoryHandler() { public void addUIWidgets(Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); - + ProghatchesUtil.attachZeroSizedStackRemover(builder, buildContext); for(int i=1;i<4;i++) builder.widget( new SlotWidget(new BaseSlot(inventoryHandler, getCircuitSlot()+i) { diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java b/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java index 87d1e96..768d8bf 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java @@ -373,9 +373,15 @@ protected ModularWindow createPatternWindow(final EntityPlayer player) { builder.setGuiTint(getGUIColorization()); builder.setDraggable(true); builder.setPos((a, b) -> new Pos2d(PARENT_WIDTH + b.getPos().getX(), PARENT_HEIGHT * 0 + b.getPos().getY())); - for (int i = 0; i < 36; i++) { + MappingItemHandler shared_handler=new MappingItemHandler(pattern, 0, 36); + //use shared handler + //or shift clicking a pattern in pattern slot will just transfer it to another pattern slot + //instead of player inventory! + for (int i = 0; i < 36; i++) { + BaseSlot bs; - builder.widget(new SlotWidget(bs = new BaseSlot(new MappingItemHandler(pattern, 0, 36), i) + + builder.widget( new SlotWidget(bs = new BaseSlot(shared_handler, i) ) { @@ -389,10 +395,12 @@ protected ItemStack getItemStackForRendering(Slot slotIn) { return output != null ? output : stack; } - }.setFilter(itemStack -> itemStack.getItem() instanceof ICraftingPatternItem).setChangeListener(() -> { + }.setShiftClickPriority(-1) + .setFilter(itemStack -> itemStack.getItem() instanceof ICraftingPatternItem).setChangeListener(() -> { onPatternChange(); }).setPos((i % 4) * 18 + 3, (i / 4) * 18 + 3).setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_PATTERN_ME)); + }