mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-09 06:50:32 +08:00
Moved some minecart flags that don't belong in the event out of the event.
This commit is contained in:
parent
544bd76b13
commit
592f510228
@ -155,28 +155,11 @@ public class EntityMinecart extends Entity
|
||||
|
||||
// CraftBukkit start
|
||||
private void handleMinecartCreation(World world) {
|
||||
Vector derailedVelocityVector =
|
||||
new Vector(derailedX, derailedY, derailedZ);
|
||||
Vector flyingVelocityVector = new Vector(flyingX, flyingY, flyingZ);
|
||||
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
minecart = CraftMinecart.getCraftMinecart(server, this);
|
||||
VehicleCreateEvent event = new VehicleCreateEvent(
|
||||
Type.VEHICLE_CREATE, minecart, slowWhenEmpty,
|
||||
derailedVelocityVector, flyingVelocityVector);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
slowWhenEmpty = event.shouldSlowWhenEmpty();
|
||||
|
||||
Vector vec = event.getDerailedVelocityFactor();
|
||||
derailedX = vec.getX();
|
||||
derailedY = vec.getY();
|
||||
derailedZ = vec.getZ();
|
||||
|
||||
vec = event.getFlyingVelocityFactor();
|
||||
flyingX = vec.getX();
|
||||
flyingY = vec.getY();
|
||||
flyingZ = vec.getZ();
|
||||
Type.VEHICLE_CREATE, minecart);
|
||||
server.getPluginManager().callEvent(event);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user