mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 20:07:41 +01:00
removed all instances of new CraftEntity* where appropriate.
Entity.getBukkitEntity() is now used instead. By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
parent
b49ed260f6
commit
d85ad792fb
@ -8,6 +8,7 @@ import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
/**@deprecated*/
|
||||
public interface CraftMappable {
|
||||
/**
|
||||
* Gets the CraftEntity version.
|
||||
|
@ -151,7 +151,7 @@ public class CraftWorld implements World {
|
||||
CraftMinecart.Type.Minecart.getId()
|
||||
);
|
||||
world.a(minecart);
|
||||
return new CraftMinecart(world.getServer(), minecart);
|
||||
return (Minecart) minecart.getBukkitEntity();
|
||||
}
|
||||
|
||||
public StorageMinecart spawnStorageMinecart(Location loc) {
|
||||
@ -163,7 +163,7 @@ public class CraftWorld implements World {
|
||||
CraftMinecart.Type.StorageMinecart.getId()
|
||||
);
|
||||
world.a(minecart);
|
||||
return new CraftStorageMinecart(world.getServer(), minecart);
|
||||
return (StorageMinecart) minecart.getBukkitEntity();
|
||||
}
|
||||
|
||||
public PoweredMinecart spawnPoweredMinecart(Location loc) {
|
||||
|
@ -52,6 +52,8 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
|
||||
* @param server
|
||||
* @param minecart
|
||||
* @return
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static CraftMinecart getCraftMinecart(CraftServer server,
|
||||
EntityMinecart minecart) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
|
||||
@ -20,8 +19,12 @@ public abstract class CraftVehicle extends CraftEntity implements Vehicle {
|
||||
}
|
||||
|
||||
public boolean setPassenger(Entity passenger) {
|
||||
((CraftEntity)passenger).getHandle().setPassengerOf(getHandle());
|
||||
return true;
|
||||
if(passenger instanceof CraftEntity){
|
||||
((CraftEntity)passenger).getHandle().setPassengerOf(getHandle());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
|
Loading…
Reference in New Issue
Block a user