geforkt von Mirrors/Paper
SkeletonHorse Additions (#1283)
Dieser Commit ist enthalten in:
Ursprung
c44f8e3b57
Commit
720f7d920e
74
Spigot-API-Patches/SkeletonHorse-Additions.patch
Normale Datei
74
Spigot-API-Patches/SkeletonHorse-Additions.patch
Normale Datei
@ -0,0 +1,74 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||||
|
Date: Fri, 27 Jul 2018 22:36:17 -0500
|
||||||
|
Subject: [PATCH] SkeletonHorse Additions
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..55bae018
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java
|
||||||
|
@@ -0,0 +0,0 @@
|
||||||
|
+package com.destroystokyo.paper.event.entity;
|
||||||
|
+
|
||||||
|
+import org.bukkit.entity.SkeletonHorse;
|
||||||
|
+import org.bukkit.event.Cancellable;
|
||||||
|
+import org.bukkit.event.HandlerList;
|
||||||
|
+import org.bukkit.event.entity.EntityEvent;
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * Event called when a player gets close to a skeleton horse and triggers the lightning trap
|
||||||
|
+ */
|
||||||
|
+public class SkeletonHorseTrapEvent extends EntityEvent implements Cancellable {
|
||||||
|
+ private static final HandlerList handlers = new HandlerList();
|
||||||
|
+ private boolean cancelled;
|
||||||
|
+
|
||||||
|
+ public SkeletonHorseTrapEvent(SkeletonHorse horse) {
|
||||||
|
+ super(horse);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public SkeletonHorse getEntity() {
|
||||||
|
+ return (SkeletonHorse) super.getEntity();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isCancelled() {
|
||||||
|
+ return cancelled;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void setCancelled(boolean cancel) {
|
||||||
|
+ this.cancelled = cancel;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public HandlerList getHandlers() {
|
||||||
|
+ return handlers;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static HandlerList getHandlerList() {
|
||||||
|
+ return handlers;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/org/bukkit/entity/SkeletonHorse.java
|
||||||
|
index b2c6b6a8..ba998346 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/SkeletonHorse.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java
|
||||||
|
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||||
|
/**
|
||||||
|
* Represents a SkeletonHorse - variant of {@link AbstractHorse}.
|
||||||
|
*/
|
||||||
|
-public interface SkeletonHorse extends AbstractHorse { }
|
||||||
|
+public interface SkeletonHorse extends AbstractHorse {
|
||||||
|
+ // Paper start
|
||||||
|
+ int getTrapTime();
|
||||||
|
+
|
||||||
|
+ boolean isTrap();
|
||||||
|
+
|
||||||
|
+ void setTrap(boolean trap);
|
||||||
|
+ // Paper end
|
||||||
|
+}
|
||||||
|
--
|
73
Spigot-Server-Patches/SkeletonHorse-Additions.patch
Normale Datei
73
Spigot-Server-Patches/SkeletonHorse-Additions.patch
Normale Datei
@ -0,0 +1,73 @@
|
|||||||
|
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 70985bf52..9fb86eefd 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
|
||||||
|
@@ -0,0 +0,0 @@ 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);
|
||||||
|
@@ -0,0 +0,0 @@ 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 f69170559..cba8b91e5 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||||
|
@@ -0,0 +0,0 @@ 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 e822c2200..496d0c0ca 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java
|
||||||
|
@@ -0,0 +0,0 @@ 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
|
||||||
|
}
|
||||||
|
--
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren