2019-04-22 23:36:14 +02:00
From a7467abe0696ee5861f5778e965678098b7189b2 Mon Sep 17 00:00:00 2001
2018-08-05 03:12:41 +02:00
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 27 Jul 2018 22:36:31 -0500
Subject: [PATCH] SkeletonHorse Additions
diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
2019-04-22 23:36:14 +02:00
index 06f37f28af..eae2b26655 100644
2018-08-05 03:12:41 +02:00
--- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
2019-01-01 04:15:55 +01:00
@@ -6,7 +6,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract {
2018-08-05 03:12:41 +02:00
private final PathfinderGoalHorseTrap bM = new PathfinderGoalHorseTrap(this);
private boolean bN;
- private int bO;
+ private int bO; public int getTrapTime() { return this.bO; } // Paper - OBFHELPER
public EntityHorseSkeleton(World world) {
super(EntityTypes.SKELETON_HORSE, world);
@@ -114,10 +114,12 @@ public class EntityHorseSkeleton extends EntityHorseAbstract {
return 0.96F;
}
2018-08-26 20:11:49 +02:00
+ public boolean isTrap() { return this.dy(); } // Paper - OBFHELPER
public boolean dy() {
2018-08-05 03:12:41 +02:00
return this.bN;
}
+ public void setTrap(boolean trap) { this.s(trap); } // Paper - OBFHELPER
public void s(boolean flag) {
if (flag != this.bN) {
this.bN = flag;
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
2019-04-22 23:36:14 +02:00
index a6979fe859..d4fdcbdfd6 100644
2018-08-05 03:12:41 +02:00
--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
@@ -13,6 +13,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal {
}
public void e() {
+ if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity()).callEvent()) return; // Paper
DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(new BlockPosition(this.a));
this.a.s(false);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
2019-04-22 23:36:14 +02:00
index e822c2200d..496d0c0cac 100644
2018-08-05 03:12:41 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
@@ -26,4 +26,23 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo
public Variant getVariant() {
return Variant.SKELETON_HORSE;
}
+
+ // Paper start
+ @Override
+ public EntityHorseSkeleton getHandle() {
+ return (EntityHorseSkeleton) super.getHandle();
+ }
+
+ public int getTrapTime() {
+ return getHandle().getTrapTime();
+ }
+
+ public boolean isTrap() {
+ return getHandle().isTrap();
+ }
+
+ public void setTrap(boolean trap) {
+ getHandle().setTrap(trap);
+ }
+ // Paper end
}
--
2019-03-20 02:46:00 +01:00
2.21.0
2018-08-05 03:12:41 +02:00