geforkt von Mirrors/Paper
Boat get/set (double) occupied acceleration, (double) unoccupied deceleration, (boolean) work on land. Good values to maximize boat utility: 0.6 (fast accel.), 0.99 (no loss of boat), true/false, respectively.
Dieser Commit ist enthalten in:
Ursprung
8f8c62b71b
Commit
b7c43fbff1
@ -28,6 +28,9 @@ public class EntityBoat extends Entity {
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public double maxSpeed = 0.4D;
|
public double maxSpeed = 0.4D;
|
||||||
|
public double occupiedDeceleration = 0.2D;
|
||||||
|
public double unoccupiedDeceleration = -1;
|
||||||
|
public boolean landBoats = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(Entity entity) {
|
public void collide(Entity entity) {
|
||||||
@ -233,9 +236,22 @@ public class EntityBoat extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.passenger != null) {
|
if (this.passenger != null) {
|
||||||
this.motX += this.passenger.motX * 0.2D;
|
this.motX += this.passenger.motX * occupiedDeceleration; // CraftBukkit
|
||||||
this.motZ += this.passenger.motZ * 0.2D;
|
this.motZ += this.passenger.motZ * occupiedDeceleration; // CraftBukkit
|
||||||
}
|
}
|
||||||
|
// CraftBukkit start - block not in vanilla
|
||||||
|
else if (unoccupiedDeceleration >= 0) {
|
||||||
|
this.motX *= unoccupiedDeceleration;
|
||||||
|
this.motZ *= unoccupiedDeceleration;
|
||||||
|
// Kill lingering speed
|
||||||
|
if (motX <= 0.00001) {
|
||||||
|
motX = 0;
|
||||||
|
}
|
||||||
|
if (motZ <= 0.00001) {
|
||||||
|
motZ = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
// CraftBukkit
|
// CraftBukkit
|
||||||
d3 = this.maxSpeed;
|
d3 = this.maxSpeed;
|
||||||
@ -255,7 +271,7 @@ public class EntityBoat extends Entity {
|
|||||||
this.motZ = d3;
|
this.motZ = d3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.onGround) {
|
if (this.onGround && !landBoats) { // CraftBukkit
|
||||||
this.motX *= 0.5D;
|
this.motX *= 0.5D;
|
||||||
this.motY *= 0.5D;
|
this.motY *= 0.5D;
|
||||||
this.motZ *= 0.5D;
|
this.motZ *= 0.5D;
|
||||||
|
@ -22,6 +22,32 @@ public class CraftBoat extends CraftVehicle implements Boat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getOccupiedDeceleration() {
|
||||||
|
return boat.occupiedDeceleration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOccupiedDeceleration(double speed) {
|
||||||
|
if (speed >= 0D) {
|
||||||
|
boat.occupiedDeceleration = speed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getUnoccupiedDeceleration() {
|
||||||
|
return boat.unoccupiedDeceleration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnoccupiedDeceleration(double speed) {
|
||||||
|
boat.unoccupiedDeceleration = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getWorkOnLand() {
|
||||||
|
return boat.landBoats;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkOnLand(boolean workOnLand) {
|
||||||
|
boat.landBoats = workOnLand;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CraftBoat";
|
return "CraftBoat";
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren