mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 19:15:32 +01:00
Updated Upstream (Bukkit/CraftBukkit) (#11626)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 36b11391 Fix copy pasting in UseCooldownComponent CraftBukkit Changes: a71a7e1f5 SPIGOT-7957: Fix setTarget method for Breeze 5bc0a094b SPIGOT-7955: Failure teleporting players between worlds using Player#teleport() when player has attribute modifiers 2e09c7a36 SPIGOT-7953: Item cooldown must be greater than 0 8ef9079fa Increase outdated build delay
This commit is contained in:
parent
be886cf4e7
commit
7b13d936de
@ -1702,10 +1702,10 @@ index 43f0df04f3cdff7d7db73321a2886f3a737e3c9f..5c741228b2338a7c4de2fe736eb78951
|
||||
public interface OminousBottleMeta extends ItemMeta {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/components/UseCooldownComponent.java b/src/main/java/org/bukkit/inventory/meta/components/UseCooldownComponent.java
|
||||
index 04b4b08021a841542b3d5e6f3f1c465af3899281..8eb18671dd0f93eac143e8449dbee43d49e50621 100644
|
||||
index 4086a413895f82b51bf192ceffdfee4a939c6fed..172032e56ee8e4e1b13ec6b41a5122a33b18bc64 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/components/UseCooldownComponent.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/components/UseCooldownComponent.java
|
||||
@@ -6,25 +6,24 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
@@ -6,8 +6,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@ -1715,29 +1715,7 @@ index 04b4b08021a841542b3d5e6f3f1c465af3899281..8eb18671dd0f93eac143e8449dbee43d
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public interface UseCooldownComponent extends ConfigurationSerializable {
|
||||
|
||||
/**
|
||||
- * Gets the time in seconds it will take for this item to be eaten.
|
||||
+ * Gets the time in seconds it will take for this item to be available for use again.
|
||||
*
|
||||
- * @return eat time
|
||||
+ * @return cooldown time
|
||||
*/
|
||||
float getCooldownSeconds();
|
||||
|
||||
/**
|
||||
- * Sets the time in seconds it will take for this item to be eaten.
|
||||
+ * Sets the time in seconds it will take for this item to be available for use again.
|
||||
*
|
||||
- * @param eatSeconds new eat time, must be positive
|
||||
+ * @param cooldownSeconds new cooldown time, must be positive
|
||||
*/
|
||||
- void setCooldownSeconds(float eatSeconds);
|
||||
+ void setCooldownSeconds(float cooldownSeconds);
|
||||
|
||||
/**
|
||||
* Gets the custom cooldown group to be used for similar items, if set.
|
||||
@@ -37,7 +36,7 @@ public interface UseCooldownComponent extends ConfigurationSerializable {
|
||||
@@ -39,7 +38,7 @@ public interface UseCooldownComponent extends ConfigurationSerializable {
|
||||
/**
|
||||
* Sets the custom cooldown group to be used for similar items.
|
||||
*
|
||||
|
@ -131,7 +131,7 @@ index feca36209fd2405fab70f564f63e627b8b78ac18..396ec10a76bdadbf5be2f0e15e88eed4
|
||||
|
||||
public static PackRepository createPackRepository(Path dataPacksPath, DirectoryValidator symlinkFinder) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index ec2854226de69ce87e1a9bb0b5483775ed192044..17e10c4373b4281cc74b748c4a1e173e36eb9196 100644
|
||||
index cc9700073b6431742b2709f25267028cc8407686..5e75839c0620f94e5b58942c984938e564d3b936 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -199,7 +199,7 @@ public class Main {
|
||||
@ -142,7 +142,7 @@ index ec2854226de69ce87e1a9bb0b5483775ed192044..17e10c4373b4281cc74b748c4a1e173e
|
||||
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 93046379d0cefd5d3236fc59e698809acdc18f80..774556a62eb240da42e84db4502e2ed43495be17 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
|
@ -590,7 +590,7 @@ index f077b8ff0bf0d96628db3569132696b68fd79921..5f11f5b16766f9d1d5640ae037e259be
|
||||
value.append("\n Plugins: {");
|
||||
for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index f4c36880ca29d657d0b443d9578265bd84e007c7..f0ae14146015d8145cf873788559b8f0666f7f33 100644
|
||||
index 16d2b3e59b8a6ef65b411afb9d94c61e6d797e36..e4335bfc98272c5499651977625e1f0ca671fbec 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -11,8 +11,6 @@ import com.google.common.collect.MapMaker;
|
||||
@ -659,7 +659,7 @@ index f4c36880ca29d657d0b443d9578265bd84e007c7..f0ae14146015d8145cf873788559b8f0
|
||||
public List<CraftPlayer> getOnlinePlayers() {
|
||||
return this.playerView;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 03790abcc3474999db6d8986e50ebc2caf6eba0c..13f811173c67533ee02f70cc4b6b398cd527c84b 100644
|
||||
index 6a3331eb45fdd2199fe41ab624d6dbb85bc04711..15ea3363127f315dc3aeb1482dd8a8637cc1a9e0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -15,6 +15,7 @@ import joptsimple.OptionSet;
|
||||
@ -671,7 +671,7 @@ index 03790abcc3474999db6d8986e50ebc2caf6eba0c..13f811173c67533ee02f70cc4b6b398c
|
||||
public static boolean useConsole = true;
|
||||
|
||||
@@ -241,15 +242,17 @@ public class Main {
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
System.err.println("*** Error, this build is outdated ***");
|
||||
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");
|
||||
|
@ -31,12 +31,12 @@ index 9abd1dea58ffc612114d5fd8e8944d4aa8c68236..4840893082cbcd9b00f79149df1a7805
|
||||
Bootstrap.isBootstrapped = true;
|
||||
Instant instant = Instant.now();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index fc9e56427dc04a6ef7286bf027fef6b7ff0bac0c..1efb42f7ad357f9b4185dea79106ccd38c9f5325 100644
|
||||
index b2044a90a4f3b3e16227915269527c4ea47e0747..3dd6beb874df92056c127e2436576adb125d4ed1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -249,10 +249,12 @@ public class Main {
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
- System.err.println("*** Error, this build is outdated ***");
|
||||
+ // Paper start - This is some stupid bullshit
|
||||
|
@ -1049,7 +1049,7 @@ index 566d893a413fd04b99e83dc2da8fe958a48492a8..a944803771d514572f94b4e98a6d4435
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 14aab3a2adfde7a236610be2b928651bc01067f5..069c79aecc190f62f2d217b3e9868677845b5dc9 100644
|
||||
index c42a6ced8c04dc04c918550ab8f9722d89183cca..29946404ed7fe29c9f7457fcf5650111cd6411a9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -199,9 +199,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@ -1193,15 +1193,6 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..069c79aecc190f62f2d217b3e9868677
|
||||
this.useRemainder = useRemainder;
|
||||
}
|
||||
|
||||
@@ -1606,7 +1615,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public UseCooldownComponent getUseCooldown() {
|
||||
- return (this.hasUseCooldown()) ? new CraftUseCooldownComponent(this.useCooldown) : new CraftUseCooldownComponent(new UseCooldown(0));
|
||||
+ return (this.hasUseCooldown()) ? new CraftUseCooldownComponent(this.useCooldown) : new CraftUseCooldownComponent(new UseCooldown(1.0F)); // Paper - Create a valid use_cooldown component
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1692,7 +1701,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
@ -2109,19 +2100,6 @@ index 9a4a1d903c22e9d2a0cbda95ceb8b1dcfb29112e..4f7914f96207feda67cd910213bb624d
|
||||
this.handle = new Tool.Rule(this.handle.blocks(), Optional.ofNullable(speed), this.handle.correctForDrops());
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftUseCooldownComponent.java b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftUseCooldownComponent.java
|
||||
index 952e7fa022161d1d21ba1a4f43abe5ee221dee4b..0f86ff23cc6a2f617fc5ef67e576e1e3cb29034c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftUseCooldownComponent.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftUseCooldownComponent.java
|
||||
@@ -55,7 +55,7 @@ public final class CraftUseCooldownComponent implements UseCooldownComponent {
|
||||
|
||||
@Override
|
||||
public void setCooldownSeconds(float eatSeconds) {
|
||||
- Preconditions.checkArgument(eatSeconds >= 0, "eatSeconds cannot be less than 0");
|
||||
+ Preconditions.checkArgument(eatSeconds > 0, "eatSeconds must be positive"); // Paper
|
||||
|
||||
this.handle = new UseCooldown(eatSeconds, this.handle.cooldownGroup());
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java
|
||||
index 9cc1ef5c9221dd7d2069b280f0c91ce9439a995a..1c80fe7549d70ae16c7b755c22752549261f072a 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit a6aba46fe6679624f7c9cbeb6c2d1be63156e6bb
|
||||
Subproject commit 36b11391a2c0213669acfa9b863a3a3704374fbc
|
@ -1 +1 @@
|
||||
Subproject commit 2702c5c8e5e1a9e3d231d9006afa80333c84caa4
|
||||
Subproject commit a71a7e1f57653334d66e389d162a437b1491bfc8
|
Loading…
Reference in New Issue
Block a user