mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 10:57:47 +01:00
Added Creature.setTarget per jlogsdon
This commit is contained in:
parent
7988345368
commit
e3011157b1
@ -13,8 +13,8 @@ import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
|||||||
|
|
||||||
public class EntityCreature extends EntityLiving {
|
public class EntityCreature extends EntityLiving {
|
||||||
|
|
||||||
private PathEntity a;
|
public PathEntity a; // Craftbukkit - public
|
||||||
protected Entity d;
|
public Entity d; // Craftbukkit - public
|
||||||
protected boolean e = false;
|
protected boolean e = false;
|
||||||
|
|
||||||
public EntityCreature(World world) {
|
public EntityCreature(World world) {
|
||||||
|
@ -1,18 +1,36 @@
|
|||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import net.minecraft.server.EntityCreature;
|
import net.minecraft.server.EntityCreature;
|
||||||
|
import net.minecraft.server.EntityLiving;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
public class CraftCreature extends CraftLivingEntity implements Creature{
|
public class CraftCreature extends CraftLivingEntity implements Creature{
|
||||||
|
private EntityCreature entity;
|
||||||
|
|
||||||
public CraftCreature(CraftServer server, EntityCreature entity) {
|
public CraftCreature(CraftServer server, EntityCreature entity) {
|
||||||
super(server, entity);
|
super(server, entity);
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTarget(LivingEntity target) {
|
||||||
|
if (target == null) {
|
||||||
|
entity.d = null;
|
||||||
|
} else if (target instanceof CraftLivingEntity) {
|
||||||
|
EntityLiving victim = ((CraftLivingEntity)target).getHandle();
|
||||||
|
entity.d = victim;
|
||||||
|
entity.a = entity.world.a(entity, entity.d, 16.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityCreature getHandle() {
|
||||||
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CraftCreature";
|
return "CraftCreature";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user