3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/Spigot-Server-Patches/0314-SkeletonHorse-Additions.patch
Aikar f835a91d15
Updated Upstream (Bukkit/CraftBukkit), deprecate SentientNPC API
Upstream has added the equivalent of our SentientNPC API, with exception to the EnderDragon.

We've added Mob to the EnderDragon, and our SentientNPC API should behave the same.

Vex#getOwner has been deprecated and a replacement Vex#getSummoner has been added using Mob.

However, since 1.13 is not production ready, SentientNPC API is subject for removal in 1.13.1 since
1.13 API is not compatible with 1.12.

Please move to the Mob interface ASAP.

This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
c5ab54d8 Expand GameRule API
ab9a606c Improve entity hierarchy by adding Mob interface.

CraftBukkit Changes:
29e75648 Expand GameRule API
50e6858b Improve entity hierarchy by adding Mob interface.
0e1d79b4 Correct error in previous patch
2018-08-10 22:20:59 -04:00

76 Zeilen
2.9 KiB
Diff

From 2912fb59c837b423ee607b068fbbbcbc258d7615 Mon Sep 17 00:00:00 2001
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
index 70985bf528..9fb86eefde 100644
--- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
@@ -6,7 +6,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract {
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;
}
+ public boolean isTrap() { return this.dz(); } // Paper - OBFHELPER
public boolean dz() {
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
index f69170559c..cba8b91e55 100644
--- 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
index e822c2200d..496d0c0cac 100644
--- 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
}
--
2.18.0