Restore some SANITY around nullability annotations

Some of these were wrong (scoreboard manager), others are counter to
everything everyone expects (Locations world being null, which wasnt ever safe EVER)
others are just too noisy.

Replace some with Contract to get rid of the nullability constraint and go back to
the old days of IDE not considering it strictly one way or the other.

Also, stop requiring annotations on package-private.

Introduces the next Developer Perk for Paper-API: Your plugin isn't yellow anymore.

Also fixed random dupe code in ensureServerConversions that got mistakenly set in the update.
This commit is contained in:
Aikar 2019-03-24 19:13:07 -04:00
parent b1777724a5
commit 4ae1989c4f
No known key found for this signature in database
GPG key ID: 401ADFC9891FAAFE
6 changed files with 166 additions and 18 deletions

View file

@ -1,4 +1,4 @@
From 4c5a58a93cd324de4bbb929a3feac630cd3a758d Mon Sep 17 00:00:00 2001
From 20eb853456b944fc4eb760f9ee5c6bfa3433513b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 May 2016 23:55:48 -0400
Subject: [PATCH] ensureServerConversions API
@ -29,24 +29,19 @@ index cbcbe8c8a..8e602cf51 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 7b709457f..e8f97c949 100644
index 7b709457f..4ee01be5f 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -517,7 +517,12 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
@@ -517,7 +517,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
}
}
- return result;
+ // Set damage again incase meta overwrote it
+ if (args.containsKey("damage")) {
+ result.setDurability(damage);
+ }
+
+ return result.ensureServerConversions(); // Paper
}
/**
@@ -576,4 +581,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
@@ -576,4 +576,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
return true;
}