Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
Implemented pig zombie get/set anger functions.
Dieser Commit ist enthalten in:
Ursprung
c9979169b9
Commit
cc94325b28
@ -9,7 +9,7 @@ import org.bukkit.event.entity.EntityTargetEvent;
|
|||||||
|
|
||||||
public class EntityPigZombie extends EntityZombie {
|
public class EntityPigZombie extends EntityZombie {
|
||||||
|
|
||||||
private int angerLevel = 0;
|
public int angerLevel = 0; // CraftBukkit - private -> public
|
||||||
private int soundDelay = 0;
|
private int soundDelay = 0;
|
||||||
private static final ItemStack f = new ItemStack(Item.GOLD_SWORD, 1);
|
private static final ItemStack f = new ItemStack(Item.GOLD_SWORD, 1);
|
||||||
|
|
||||||
|
@ -11,9 +11,30 @@ public class CraftPigZombie extends CraftZombie implements PigZombie {
|
|||||||
super(server, entity);
|
super(server, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityPigZombie getHandle() {
|
||||||
|
return (EntityPigZombie) super.getHandle();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CraftPigZombie";
|
return "CraftPigZombie";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAnger() {
|
||||||
|
return getHandle().angerLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnger(int level) {
|
||||||
|
getHandle().angerLevel = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAngry(boolean angry) {
|
||||||
|
setAnger(angry ? 400 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAngry() {
|
||||||
|
return getAnger() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren