#373: Add trap related methods to SkeletonHorse

By: Matthew <stteg@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot 2022-01-01 09:58:04 +11:00
parent 751a5601b8
commit 179dbe9592
2 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,11 @@
--- a/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java
+++ b/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java
@@ -24,7 +24,7 @@
private final PathfinderGoalHorseTrap skeletonTrapGoal = new PathfinderGoalHorseTrap(this);
private static final int TRAP_MAX_LIFE = 18000;
private boolean isTrap;
- private int trapTime;
+ public int trapTime; // PAIL
public EntityHorseSkeleton(EntityTypes<? extends EntityHorseSkeleton> entitytypes, World world) {
super(entitytypes, world);

View file

@ -26,4 +26,29 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo
public Variant getVariant() {
return Variant.SKELETON_HORSE;
}
@Override
public EntityHorseSkeleton getHandle() {
return (EntityHorseSkeleton) entity;
}
@Override
public boolean isTrapped() {
return getHandle().isTrap();
}
@Override
public void setTrapped(boolean trapped) {
getHandle().setTrap(trapped);
}
@Override
public int getTrapTime() {
return getHandle().trapTime;
}
@Override
public void setTrapTime(int trapTime) {
getHandle().trapTime = trapTime;
}
}