From e05ca09dfe1430e1a726039df2b0203a493306d9 Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:20:07 -0400 Subject: [PATCH] tried fixing torch placement issue --- .../antimatter/tool/behaviour/BehaviourTorchPlacing.java | 5 ++--- common/src/main/resources/antimatter.accesswidener | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/muramasa/antimatter/tool/behaviour/BehaviourTorchPlacing.java b/common/src/main/java/muramasa/antimatter/tool/behaviour/BehaviourTorchPlacing.java index 29ef78579..f03a069d7 100644 --- a/common/src/main/java/muramasa/antimatter/tool/behaviour/BehaviourTorchPlacing.java +++ b/common/src/main/java/muramasa/antimatter/tool/behaviour/BehaviourTorchPlacing.java @@ -48,10 +48,9 @@ public InteractionResult onItemUse(IBasicAntimatterTool instance, UseOnContext c break; } } - if (!stack.isEmpty() || c.getPlayer().isCreative()) { - InteractionResult resultType = tryPlace(new BlockPlaceContext(c), stack); + if (!stack.isEmpty()) { + InteractionResult resultType = stack.useOn(new UseOnContext(c.getPlayer().getLevel(), c.getPlayer(), c.getHand(), stack, c.getHitResult())); if (resultType.consumesAction()) { - if (!c.getPlayer().isCreative()) stack.shrink(1); return resultType; } } diff --git a/common/src/main/resources/antimatter.accesswidener b/common/src/main/resources/antimatter.accesswidener index f59ae680e..f44aabe29 100644 --- a/common/src/main/resources/antimatter.accesswidener +++ b/common/src/main/resources/antimatter.accesswidener @@ -15,4 +15,6 @@ accessible method net/minecraft/world/level/levelgen/feature/foliageplacers/Foli accessible method net/minecraft/world/item/crafting/ShapedRecipe dissolvePattern ([Ljava/lang/String;Ljava/util/Map;II)Lnet/minecraft/core/NonNullList; accessible method net/minecraft/world/item/crafting/ShapedRecipe patternFromJson (Lcom/google/gson/JsonArray;)[Ljava/lang/String; accessible method net/minecraft/world/item/crafting/ShapedRecipe keyFromJson (Lcom/google/gson/JsonObject;)Ljava/util/Map; -accessible method net/minecraft/world/item/crafting/ShapedRecipe matches (Lnet/minecraft/world/inventory/CraftingContainer;IIZ)Z \ No newline at end of file +accessible method net/minecraft/world/item/crafting/ShapedRecipe matches (Lnet/minecraft/world/inventory/CraftingContainer;IIZ)Z +accessible method net/minecraft/world/item/context/UseOnContext (Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/phys/BlockHitResult;)V +accessible method net/minecraft/world/item/context/UseOnContext getHitResult ()Lnet/minecraft/world/phys/BlockHitResult; \ No newline at end of file