#373: Add trap related methods to SkeletonHorse

This commit is contained in:
Matthew 2022-01-01 09:58:04 +11:00 committed by md_5
parent b8a25cbd20
commit 19f2af066e
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
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() { public Variant getVariant() {
return Variant.SKELETON_HORSE; 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;
}
} }