mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
Add get/set wait time for fish hooks. (#5595)
This commit is contained in:
parent
2451b8df1d
commit
5fbf2f883d
3 changed files with 48 additions and 0 deletions
|
@ -324,3 +324,6 @@ protected net.minecraft.world.entity.projectile.Projectile hitCancelled
|
|||
|
||||
# Expose firework item directly + manually setting flight ticks
|
||||
public net.minecraft.world.entity.projectile.FireworkRocketEntity life
|
||||
|
||||
# More Projectile API
|
||||
public net.minecraft.world.entity.projectile.FishingHook timeUntilLured
|
||||
|
|
|
@ -70,6 +70,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ void setTicksToDetonate(int ticks);
|
||||
+ // Paper stop
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/FishHook.java b/src/main/java/org/bukkit/entity/FishHook.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/FishHook.java
|
||||
+++ b/src/main/java/org/bukkit/entity/FishHook.java
|
||||
@@ -0,0 +0,0 @@ public interface FishHook extends Projectile {
|
||||
*/
|
||||
BOBBING;
|
||||
}
|
||||
+
|
||||
+ // Paper start - More FishHook API
|
||||
+ /**
|
||||
+ * Get the number of ticks the hook needs to wait for a fish to bite.
|
||||
+ *
|
||||
+ * @return Number of ticks
|
||||
+ */
|
||||
+ int getWaitTime();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the number of ticks the hook needs to wait for a fish to bite.
|
||||
+ *
|
||||
+ * @param ticks Number of ticks
|
||||
+ */
|
||||
+ void setWaitTime(int ticks);
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/ThrownPotion.java
|
||||
|
|
|
@ -111,6 +111,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end - Expose firework item directly + manually setting flight
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
|
||||
@@ -0,0 +0,0 @@ public class CraftFishHook extends CraftProjectile implements FishHook {
|
||||
public HookState getState() {
|
||||
return HookState.values()[this.getHandle().currentState.ordinal()];
|
||||
}
|
||||
+ // Paper start - More FishHook API
|
||||
+ @Override
|
||||
+ public int getWaitTime() {
|
||||
+ return this.getHandle().timeUntilLured;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setWaitTime(int ticks) {
|
||||
+ this.getHandle().timeUntilLured = ticks;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
|
||||
|
|
Loading…
Reference in a new issue