From 0c1a164c70ef5e330ac623fe1bf6462986ba02b2 Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:07:44 +0300 Subject: [PATCH 1/3] fix jsonthings compatibility (#1616) Co-authored-by: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> --- src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java b/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java index cd31cebbbf..d5ba5a21db 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java +++ b/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java @@ -252,7 +252,7 @@ public void registerPackFinders(AddPackFindersEvent event) { event.getPackType(), Pack.Position.BOTTOM, GTDynamicResourcePack::new)); - } else { + } else if (event.getPackType() == PackType.SERVER_DATA) { // Clear old data GTDynamicDataPack.clearServer(); From 9ba935258ad29b49a3488e59e0736c85a51254b3 Mon Sep 17 00:00:00 2001 From: Rundas <38040866+Rundas01@users.noreply.github.com> Date: Tue, 30 Jul 2024 08:13:14 +0200 Subject: [PATCH 2/3] Small QoL KJS Update (#1613) Co-authored-by: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> --- .../gtceu/api/data/chemical/material/Material.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/Material.java b/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/Material.java index ab0c60445b..57b834ae7e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/Material.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/Material.java @@ -985,6 +985,11 @@ public Builder componentStacks(ImmutableList components) { return this; } + public Builder kjs$components(ImmutableList components) { + compositionSupplier = components; + return this; + } + /** * Add {@link MaterialFlags} to this Material.
* Dependent Flags (for example, {@link MaterialFlags#GENERATE_LONG_ROD} requiring From d24ec376f6dcc92994df5035b16822ddccd0e3d8 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Tue, 30 Jul 2024 00:23:47 -0600 Subject: [PATCH 3/3] Animations for various tool interactions (#1622) --- .../gtceu/api/blockentity/PipeBlockEntity.java | 7 +++++-- .../com/gregtechceu/gtceu/api/cover/CoverBehavior.java | 3 ++- .../com/gregtechceu/gtceu/api/machine/MetaMachine.java | 9 ++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/blockentity/PipeBlockEntity.java b/src/main/java/com/gregtechceu/gtceu/api/blockentity/PipeBlockEntity.java index 533351229e..9cc035b70d 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/blockentity/PipeBlockEntity.java +++ b/src/main/java/com/gregtechceu/gtceu/api/blockentity/PipeBlockEntity.java @@ -391,20 +391,23 @@ public Pair onToolClick(Set toolTypes boolean isOpen = this.isConnected(gridSide); this.setConnection(gridSide, !isOpen, false); } + playerIn.swing(hand); return Pair.of(getPipeTuneTool(), InteractionResult.CONSUME); } else if (toolTypes.contains(GTToolType.CROWBAR)) { if (coverBehavior != null) { if (!isRemote()) { getCoverContainer().removeCover(gridSide, playerIn); + playerIn.swing(hand); + return Pair.of(GTToolType.CROWBAR, InteractionResult.CONSUME); } - return Pair.of(GTToolType.CROWBAR, InteractionResult.CONSUME); } else { if (frameMaterial != null) { Block.popResource(getLevel(), getPipePos(), GTBlocks.MATERIAL_BLOCKS.get(TagPrefix.frameGt, frameMaterial).asStack()); frameMaterial = null; + playerIn.swing(hand); + return Pair.of(GTToolType.CROWBAR, InteractionResult.CONSUME); } - return Pair.of(GTToolType.CROWBAR, InteractionResult.CONSUME); } } diff --git a/src/main/java/com/gregtechceu/gtceu/api/cover/CoverBehavior.java b/src/main/java/com/gregtechceu/gtceu/api/cover/CoverBehavior.java index 518854b9ea..be29ee27ee 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/cover/CoverBehavior.java +++ b/src/main/java/com/gregtechceu/gtceu/api/cover/CoverBehavior.java @@ -152,7 +152,8 @@ public InteractionResult onScrewdriverClick(Player playerIn, InteractionHand han if (playerIn instanceof ServerPlayer serverPlayer) { CoverUIFactory.INSTANCE.openUI(this, serverPlayer); } - return InteractionResult.SUCCESS; + playerIn.swing(hand); + return InteractionResult.CONSUME; } return InteractionResult.PASS; } diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/MetaMachine.java b/src/main/java/com/gregtechceu/gtceu/api/machine/MetaMachine.java index 8b2f376cb1..0e5f036bda 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/MetaMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/MetaMachine.java @@ -345,8 +345,10 @@ protected InteractionResult onHardHammerClick(Player playerIn, InteractionHand h if (this instanceof IMufflableMachine mufflableMachine) { if (!isRemote()) { mufflableMachine.setMuffled(!mufflableMachine.isMuffled()); + playerIn.sendSystemMessage(Component.translatable(mufflableMachine.isMuffled() ? + "gtceu.machine.muffle.on" : "gtceu.machine.muffle.off")); } - + playerIn.swing(hand); return InteractionResult.CONSUME; } return InteractionResult.PASS; @@ -366,6 +368,7 @@ protected InteractionResult onWrenchClick(Player playerIn, InteractionHand hand, if (!isRemote()) { setFrontFacing(gridSide); } + playerIn.swing(hand); return InteractionResult.CONSUME; } else { if (isRemote()) @@ -387,6 +390,7 @@ protected InteractionResult onWrenchClick(Player playerIn, InteractionHand hand, autoOutputFluid.setOutputFacingFluids(gridSide); } } + playerIn.swing(hand); return InteractionResult.CONSUME; } } @@ -400,6 +404,7 @@ protected InteractionResult onSoftMalletClick(Player playerIn, InteractionHand h playerIn.sendSystemMessage(Component.translatable(controllable.isWorkingEnabled() ? "behaviour.soft_hammer.enabled" : "behaviour.soft_hammer.disabled")); } + playerIn.swing(hand); return InteractionResult.CONSUME; } return InteractionResult.PASS; @@ -435,6 +440,7 @@ protected InteractionResult onScrewdriverClick(Player playerIn, InteractionHand } } if (flag) { + playerIn.swing(hand); return InteractionResult.SUCCESS; } } else { @@ -453,6 +459,7 @@ protected InteractionResult onScrewdriverClick(Player playerIn, InteractionHand } } if (flag) { + playerIn.swing(hand); return InteractionResult.SUCCESS; } }