geforkt von Mirrors/Paper
aa52bf9e33
Mojang made some changes to priorities in 1.17 and it seems that these changes conflict with the changes made in this patch, which in some cases appears to cause excessive rescheduling of tasks. This, however, is not confirmed as such but seems to be the behavior that we're seeing to cause this issue, if mojang has adopted the changes we suggested, then a good chunk of this patch may be unneeded, but, this needs a much better look than I'm currently able to do
30 Zeilen
2.2 KiB
Diff
30 Zeilen
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: TheMolkaPL <themolkapl@gmail.com>
|
|
Date: Sun, 21 Jun 2020 17:21:46 +0200
|
|
Subject: [PATCH] Fix interact event not being called in adventure
|
|
|
|
Call PlayerInteractEvent when left-clicking on a block in adventure mode
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
index f7aecda113cb12b6b392b26f861c8cd55b7f3ddd..08a0d92187c55dbd9d414e8e6232d0af3c865319 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
@@ -1713,7 +1713,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
|
MutableComponent ichatmutablecomponent = (new TranslatableComponent("build.tooHigh", new Object[]{i - 1})).withStyle(ChatFormatting.RED);
|
|
|
|
this.player.sendMessage((Component) ichatmutablecomponent, ChatType.GAME_INFO, Util.NIL_UUID);
|
|
- } else if (enuminteractionresult.shouldSwing()) {
|
|
+ } else if (enuminteractionresult.shouldSwing() && !this.player.gameMode.interactResult) {
|
|
this.player.swing(enumhand, true);
|
|
}
|
|
}
|
|
@@ -2185,7 +2185,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
|
Vec3 vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
|
HitResult movingobjectposition = this.player.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.player));
|
|
|
|
- if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) {
|
|
+ if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK || this.player.gameMode.getGameModeForPlayer() == GameType.ADVENTURE) { // Paper - call PlayerInteractEvent when left-clicking on a block in adventure mode
|
|
CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND);
|
|
}
|
|
|