Expose attack cooldown methods for Player (#1412)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 4 Sep 2018 15:01:54 -0500
|
||||
Subject: [PATCH] Expose attack cooldown methods for Player
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 6da68835..ae2b9752 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* @param profile The new profile to use
|
||||
*/
|
||||
void setPlayerProfile(PlayerProfile profile);
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the amount of ticks the current cooldown lasts
|
||||
+ *
|
||||
+ * @return Amount of ticks cooldown will last
|
||||
+ */
|
||||
+ float getCooldownPeriod();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the percentage of attack power available based on the cooldown (zero to one).
|
||||
+ *
|
||||
+ * @param adjustTicks Amount of ticks to add to cooldown counter for this calculation
|
||||
+ * @return Percentage of attack power available
|
||||
+ */
|
||||
+ float getCooledAttackStrength(float adjustTicks);
|
||||
+
|
||||
+ /**
|
||||
+ * Reset the cooldown counter to 0, effectively starting the cooldown period.
|
||||
+ */
|
||||
+ void resetCooldown();
|
||||
// Paper end
|
||||
|
||||
// Spigot start
|
||||
--
|
||||
@@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using
|
||||
internal code.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
||||
index ab9e81fd..a7b8f869 100644
|
||||
index ab9e81fd2..a7b8f869c 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@@ -13,7 +13,7 @@ You can use EntityPathfindEvent to cancel new pathfinds from overriding your cur
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
|
||||
new file mode 100644
|
||||
index 00000000..d6953b39
|
||||
index 000000000..d6953b390
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -185,7 +185,7 @@ index 00000000..d6953b39
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
|
||||
index d029d34e..48eddcd3 100644
|
||||
index d029d34ea..48eddcd30 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Mob.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Mob.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.loot.Lootable;
|
||||
|
||||
@@ -10,7 +10,7 @@ spawners.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java
|
||||
new file mode 100644
|
||||
index 00000000..d7221210
|
||||
index 000000000..d72212105
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
||||
Reference in New Issue
Block a user