Skip to content

Commit

Permalink
Fix #1553
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 19, 2024
1 parent 9f66655 commit 86ce69d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ private static void activateInner(DeployerFakePlayer player, Vec3 vec, BlockPos
!(player.isShiftKeyDown() && holdingSomething)/* || (stack.doesSneakBypassUse(world, clickedPos, player))*/;

// Use on block
if (useBlock != null && flag1
if (useBlock != InteractionResult.FAIL && flag1
&& safeOnUse(clickedState, world, clickedPos, player, hand, result).consumesAction())
return;
if (stack.isEmpty())
return;
if (useItem == null)
if (useItem == InteractionResult.FAIL)
return;
if (item instanceof CartAssemblerBlockItem
&& clickedState.canBeReplaced(new BlockPlaceContext(itemusecontext)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public static InteractionResult onBlockActivated(Player player, Level world, Int

if (!valueSettingsBehaviour.acceptsValueSettings() || fakePlayer) {
valueSettingsBehaviour.onShortInteract(player, hand, ray.getDirection());
return InteractionResult.SUCCESS;
// fabric: https://github.com/Fabricators-of-Create/Create/issues/1553
// Fabric api doesn't have a replacement for Forge's Event.Result so we need to hackily set this
// to fail so that other code isn't run, this just simulates the same behavior as create forge since we
// skip running further stuff if InteractionResult is FAIL
return fakePlayer ? InteractionResult.FAIL : InteractionResult.SUCCESS;
}

if (world.isClientSide) {
Expand Down

0 comments on commit 86ce69d

Please sign in to comment.