Andrew Ardill 2759809ecb Fix Craft Entity constructors and toStrings.
Also, standardise getHandle and clean up in general.
getHandle is now using the 'entity' member variable instead of
super.getHandle, as this reduces the number of chained calls needed.
2011-11-29 21:22:35 +11:00

59 lines
1.3 KiB
Java

package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityBoat;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Boat;
public class CraftBoat extends CraftVehicle implements Boat {
public CraftBoat(CraftServer server, EntityBoat entity) {
super(server, entity);
}
public double getMaxSpeed() {
return getHandle().maxSpeed;
}
public void setMaxSpeed(double speed) {
if (speed >= 0D) {
getHandle().maxSpeed = speed;
}
}
public double getOccupiedDeceleration() {
return getHandle().occupiedDeceleration;
}
public void setOccupiedDeceleration(double speed) {
if (speed >= 0D) {
getHandle().occupiedDeceleration = speed;
}
}
public double getUnoccupiedDeceleration() {
return getHandle().unoccupiedDeceleration;
}
public void setUnoccupiedDeceleration(double speed) {
getHandle().unoccupiedDeceleration = speed;
}
public boolean getWorkOnLand() {
return getHandle().landBoats;
}
public void setWorkOnLand(boolean workOnLand) {
getHandle().landBoats = workOnLand;
}
@Override
public EntityBoat getHandle() {
return (EntityBoat) entity;
}
@Override
public String toString() {
return "CraftBoat";
}
}