mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +01:00
Fix boat listener
This commit is contained in:
parent
9e23085c34
commit
97ebf6923e
@ -2,6 +2,7 @@ package net.minestom.server.listener;
|
|||||||
|
|
||||||
import net.minestom.server.entity.Entity;
|
import net.minestom.server.entity.Entity;
|
||||||
import net.minestom.server.entity.Player;
|
import net.minestom.server.entity.Player;
|
||||||
|
import net.minestom.server.entity.metadata.other.BoatMeta;
|
||||||
import net.minestom.server.entity.type.vehicle.EntityBoat;
|
import net.minestom.server.entity.type.vehicle.EntityBoat;
|
||||||
import net.minestom.server.network.packet.client.play.ClientSteerBoatPacket;
|
import net.minestom.server.network.packet.client.play.ClientSteerBoatPacket;
|
||||||
import net.minestom.server.network.packet.client.play.ClientSteerVehiclePacket;
|
import net.minestom.server.network.packet.client.play.ClientSteerVehiclePacket;
|
||||||
@ -40,11 +41,12 @@ public class PlayerVehicleListener {
|
|||||||
public static void boatSteerListener(ClientSteerBoatPacket packet, Player player) {
|
public static void boatSteerListener(ClientSteerBoatPacket packet, Player player) {
|
||||||
final Entity vehicle = player.getVehicle();
|
final Entity vehicle = player.getVehicle();
|
||||||
|
|
||||||
if (!(vehicle instanceof EntityBoat))
|
if (!(vehicle.getEntityMeta() instanceof BoatMeta))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EntityBoat boat = (EntityBoat) vehicle;
|
BoatMeta boat = (BoatMeta) vehicle.getEntityMeta();
|
||||||
boat.refreshPaddle(packet.leftPaddleTurning, packet.rightPaddleTurning);
|
boat.setLeftPaddleTurning(packet.leftPaddleTurning);
|
||||||
|
boat.setRightPaddleTurning(packet.rightPaddleTurning);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user