13
0
geforkt von Mirrors/Paper

Added MaxSpeed methods to minecarts. Added MaxSpeed methods to boats. Added SlowWhenEmpty, FlyingMod, and DerailedMod methods to minecarts.

By: afforess <afforess@gmail.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2011-02-12 15:57:16 +01:00
Ursprung 05035305f4
Commit c5f9d74807
2 geänderte Dateien mit 49 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -17,6 +17,16 @@ public class CraftBoat extends CraftVehicle implements Boat {
boat = entity;
}
public double getMaxSpeed() {
return boat.maxSpeed;
}
public void setMaxSpeed(double speed) {
if (speed >= 0D) {
boat.maxSpeed = speed;
}
}
@Override
public String toString() {
return "CraftBoat";

Datei anzeigen

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityMinecart;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
/**
* A minecart.
@ -45,6 +46,44 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
return minecart.a;
}
public double getMaxSpeed() {
return minecart.maxSpeed;
}
public void setMaxSpeed(double speed) {
if (speed >= 0D) {
minecart.maxSpeed = speed;
}
}
public boolean isSlowWhenEmpty() {
return minecart.slowWhenEmpty;
}
public void setSlowWhenEmpty(boolean slow) {
minecart.slowWhenEmpty = slow;
}
public Vector getFlyingVelocityMod() {
return new Vector(minecart.flyingX, minecart.flyingY, minecart.flyingZ);
}
public void setFlyingVelocityMod(Vector flying) {
minecart.flyingX = flying.getX();
minecart.flyingY = flying.getY();
minecart.flyingZ = flying.getZ();
}
public Vector getDerailedVelocityMod() {
return new Vector(minecart.derailedX, minecart.derailedY, minecart.derailedZ);
}
public void setDerailedVelocityMod(Vector derailed) {
minecart.derailedX = derailed.getX();
minecart.derailedY = derailed.getY();
minecart.derailedZ = derailed.getZ();
}
@Override
public String toString() {
return "CraftMinecart";