Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
7ae47d4eb3
Mojang fixed it in MC-63720
76 Zeilen
3.3 KiB
Diff
76 Zeilen
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 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 bb23e313b236ceb81c60d62833dc6f5afee044eb..a53d335f3af9df80bec3f94f81fb5ff0e0e5ebb5 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 bw = new PathfinderGoalHorseTrap(this);
|
|
private boolean bx;
|
|
- private int by;
|
|
+ private int by; public int getTrapTime() { return this.by; } // Paper - OBFHELPER
|
|
|
|
public EntityHorseSkeleton(EntityTypes<? extends EntityHorseSkeleton> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
@@ -125,10 +125,12 @@ public class EntityHorseSkeleton extends EntityHorseAbstract {
|
|
return 0.96F;
|
|
}
|
|
|
|
+ public boolean isTrap() { return this.eM(); } // Paper - OBFHELPER
|
|
public boolean eM() {
|
|
return this.bx;
|
|
}
|
|
|
|
+ public void setTrap(boolean trap) { this.t(trap); } // Paper - OBFHELPER
|
|
public void t(boolean flag) {
|
|
if (flag != this.bx) {
|
|
this.bx = flag;
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
|
index 8433a1a9a7de6a705a7fbecb593742ffa2e544f0..6a9af67d03737041a8f78c85a166c79a841ec8e5 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
|
@@ -16,6 +16,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal {
|
|
@Override
|
|
public void e() {
|
|
WorldServer worldserver = (WorldServer) this.a.world;
|
|
+ if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity()).callEvent()) return; // Paper
|
|
DifficultyDamageScaler difficultydamagescaler = worldserver.getDamageScaler(this.a.getChunkCoordinates());
|
|
|
|
this.a.t(false);
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
|
index e822c2200d6270ca538eadd9637b748fc3602cb6..2a7d1d4ec2c1ff16840614165c6f0c37dc534d87 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
|
@@ -26,4 +26,26 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo
|
|
public Variant getVariant() {
|
|
return Variant.SKELETON_HORSE;
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public EntityHorseSkeleton getHandle() {
|
|
+ return (EntityHorseSkeleton) super.getHandle();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public int getTrapTime() {
|
|
+ return getHandle().getTrapTime();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isTrap() {
|
|
+ return getHandle().isTrap();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setTrap(boolean trap) {
|
|
+ getHandle().setTrap(trap);
|
|
+ }
|
|
+ // Paper end
|
|
}
|