mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-05 15:11:28 +01:00
Clean vehicle code.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
db46d059ce
commit
6a7e7141f8
@ -1,19 +0,0 @@
|
|||||||
package org.bukkit.craftbukkit;
|
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates that an object has a method to get its CraftBukkit-equivalent
|
|
||||||
* CraftEntity object from its Minecraft net.minecraft.server.Entity object.
|
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
|
||||||
/**@deprecated*/
|
|
||||||
public interface CraftMappable {
|
|
||||||
/**
|
|
||||||
* Gets the CraftEntity version.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public CraftEntity getCraftEntity();
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ import org.bukkit.entity.Minecart;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A minecart.
|
* A minecart.
|
||||||
*
|
*
|
||||||
* @author sk89q
|
* @author sk89q
|
||||||
*/
|
*/
|
||||||
public class CraftMinecart extends CraftVehicle implements Minecart {
|
public class CraftMinecart extends CraftVehicle implements Minecart {
|
||||||
@ -18,18 +18,18 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
|
|||||||
Minecart(0),
|
Minecart(0),
|
||||||
StorageMinecart(1),
|
StorageMinecart(1),
|
||||||
PoweredMinecart(2);
|
PoweredMinecart(2);
|
||||||
|
|
||||||
private final int id;
|
private final int id;
|
||||||
|
|
||||||
private Type(int id) {
|
private Type(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityMinecart minecart;
|
protected EntityMinecart minecart;
|
||||||
|
|
||||||
public CraftMinecart(CraftServer server, EntityMinecart entity) {
|
public CraftMinecart(CraftServer server, EntityMinecart entity) {
|
||||||
@ -44,27 +44,6 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
|
|||||||
public int getDamage() {
|
public int getDamage() {
|
||||||
return minecart.a;
|
return minecart.a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal function to convert an MC entity to an appropriate CraftBukkit
|
|
||||||
* entity.
|
|
||||||
*
|
|
||||||
* @param server
|
|
||||||
* @param minecart
|
|
||||||
* @return
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
public static CraftMinecart getCraftMinecart(CraftServer server,
|
|
||||||
EntityMinecart minecart) {
|
|
||||||
if (minecart.d == Type.StorageMinecart.getId()) {
|
|
||||||
return new CraftStorageMinecart(server, minecart);
|
|
||||||
} else if (minecart.d == Type.PoweredMinecart.getId()) {
|
|
||||||
return new CraftPoweredMinecart(server, minecart);
|
|
||||||
} else {
|
|
||||||
return new CraftMinecart(server, minecart);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
Loading…
Reference in New Issue
Block a user