mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 01:41:05 +01:00
Implemented VEHICLE_UPDATE
This commit is contained in:
parent
2b0ab5a130
commit
24f140d1f4
2 changed files with 6 additions and 5 deletions
|
@ -14,6 +14,7 @@ import org.bukkit.event.vehicle.VehicleCreateEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
|
import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
|
||||||
|
import org.bukkit.event.vehicle.VehicleEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleMoveEvent;
|
import org.bukkit.event.vehicle.VehicleMoveEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
|
@ -326,9 +327,9 @@ public class EntityBoat extends Entity {
|
||||||
CraftWorld world = ((WorldServer) this.world).getWorld();
|
CraftWorld world = ((WorldServer) this.world).getWorld();
|
||||||
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||||
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||||
|
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||||
|
server.getPluginManager().callEvent(new VehicleEvent(Type.VEHICLE_UPDATE, vehicle));
|
||||||
if (!from.equals(to)) {
|
if (!from.equals(to)) {
|
||||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
|
||||||
|
|
||||||
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,14 +480,14 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||||
|
|
||||||
this.b(this.yaw, this.pitch);
|
this.b(this.yaw, this.pitch);
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
CraftServer server = ((WorldServer) this.world).getServer();
|
CraftServer server = ((WorldServer) this.world).getServer();
|
||||||
CraftWorld world = ((WorldServer) this.world).getWorld();
|
CraftWorld world = ((WorldServer) this.world).getWorld();
|
||||||
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||||
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||||
|
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||||
|
server.getPluginManager().callEvent(new VehicleEvent(Type.VEHICLE_UPDATE, vehicle));
|
||||||
if (!from.equals(to)) {
|
if (!from.equals(to)) {
|
||||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
|
||||||
|
|
||||||
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue