From 5a85ae039bad992b3eaec018ecb14b9ad0ccf3ee Mon Sep 17 00:00:00 2001 From: Harro van der Klauw Date: Sun, 20 Dec 2020 14:14:43 +0100 Subject: [PATCH] Made the copypaste and exchanging gadget keep the anchor when used. - Useful for quickly trying out different blocks (exchanging) - Useful when you can't keep all the blocks in your inventory, then you can just paste multiple times (copypaste) --- .../buildinggadgets/common/items/GadgetCopyPaste.java | 1 - .../buildinggadgets/common/items/GadgetExchanger.java | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetCopyPaste.java b/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetCopyPaste.java index e33ec4b4f..271e67a9e 100644 --- a/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetCopyPaste.java +++ b/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetCopyPaste.java @@ -468,7 +468,6 @@ private void schedulePlacement(ItemStack stack, IBuildView view, PlayerEntity pl private void onBuildFinished(ItemStack stack, PlayerEntity player, Region bounds) { if (! Additions.sizeInvalid(player, bounds)) sendMessage(stack, player, MessageTranslation.TEMPLATE_BUILD, Styles.DK_GREEN); - onAnchorRemoved(stack, player); //clear the anchor after a successful build } private void sendMessage(ItemStack stack, PlayerEntity player, ITranslationProvider messageSource, Style style) { diff --git a/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetExchanger.java b/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetExchanger.java index f23670d98..e7f7fad3c 100644 --- a/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetExchanger.java +++ b/src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetExchanger.java @@ -228,10 +228,6 @@ private void exchange(ServerPlayerEntity player, ItemStack stack) { () -> getToolMode(stack).getMode().getCollection(new AbstractMode.UseContext(world, blockData.getState(), lookingAt.getPos(), heldItem, lookingAt.getFace(), getConnectedArea(heldItem)), player) ); - if (anchor.isPresent()) { - setAnchor(stack); // Remove the anchor - } - IItemIndex index = InventoryHelper.index(stack, player); //TODO replace fakeWorld