Skip to content

Commit 247f387

Browse files
committed
Fix ServerboundInteractPacket issues
1 parent ab6a9a1 commit 247f387

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mcv/v26_1/src/main/java/dev/geco/gholo/mcv/v26_1/event/PacketHandler.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io.netty.channel.ChannelPipeline;
88
import net.minecraft.network.protocol.game.ServerboundInteractPacket;
99
import net.minecraft.server.level.ServerPlayer;
10+
import net.minecraft.world.InteractionHand;
1011
import org.bukkit.Bukkit;
1112
import org.bukkit.craftbukkit.entity.CraftPlayer;
1213
import org.bukkit.entity.Player;
@@ -51,9 +52,9 @@ public void removePlayerPacketHandler(Player player) {
5152

5253
private boolean handlePacket(Object packet, Player player) {
5354
if(!(packet instanceof ServerboundInteractPacket serverboundInteractPacket)) return false;
54-
int targetId = serverboundInteractPacket.getEntityId();
55-
boolean mainHand = serverboundInteractPacket.isAttack();
56-
boolean secondaryAction = serverboundInteractPacket.isUsingSecondaryAction();
55+
int targetId = serverboundInteractPacket.entityId();
56+
boolean mainHand = serverboundInteractPacket.hand() == InteractionHand.MAIN_HAND;
57+
boolean secondaryAction = serverboundInteractPacket.usingSecondaryAction();
5758
return gHoloMain.getInteractionService().callInteraction(targetId, player, mainHand, secondaryAction);
5859
}
5960

0 commit comments

Comments
 (0)