Some jd fixes (#9781)

This commit is contained in:
Lulu13022002 2023-10-01 02:20:51 +02:00
parent 696a5041a0
commit 9b7863a607
7 changed files with 26 additions and 41 deletions

View file

@ -1082,7 +1082,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ /**
+ * Covers undead mobs
+ * @see <a href="https://minecraft.gamepedia.com/Mob#Undead_mobs">https://minecraft.gamepedia.com/Mob#Undead_mobs</a>
+ * @see <a href="https://minecraft.wiki/wiki/Mob#Undead_mobs">https://minecraft.wiki/wiki/Mob#Undead_mobs</a>
+ */
+ public static final EntitySetTag UNDEADS = new EntitySetTag(keyFor("undeads"))
+ .add(DROWNED, HUSK, PHANTOM, SKELETON, SKELETON_HORSE, STRAY, WITHER, WITHER_SKELETON, ZOGLIN, ZOMBIE, ZOMBIE_HORSE, ZOMBIE_VILLAGER, ZOMBIFIED_PIGLIN)
@ -1111,7 +1111,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ /**
+ * Covers all water based mobs
+ * @see <a href="https://minecraft.gamepedia.com/Mob#Water-based_mobs">https://minecraft.gamepedia.com/Mob#Water-based_mobs</a>
+ * @see <a href="https://minecraft.wiki/wiki/Mob#Aquatic_mobs">https://minecraft.wiki/wiki/Mob#Aquatic_mobs</a>
+ */
+ public static final EntitySetTag WATER_BASED = new EntitySetTag(keyFor("water_based"))
+ .add(AXOLOTL, DOLPHIN, SQUID, GLOW_SQUID, GUARDIAN, ELDER_GUARDIAN, TURTLE, COD, SALMON, PUFFERFISH, TROPICAL_FISH)

View file

@ -42,6 +42,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return an immutable list of dropped items for the block state
+ */
+ @NotNull
+ java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops(@NotNull org.bukkit.inventory.ItemStack tool, @Nullable org.bukkit.entity.Entity entity);
+ java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops(@Nullable org.bukkit.inventory.ItemStack tool, @Nullable org.bukkit.entity.Entity entity);
// Paper end
}

View file

@ -1591,9 +1591,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Gets all the lines of text currently on the {@link Side#FRONT} of this sign.
+ *
+ * @return List of components containing each line of text
+ * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#lines()}.
+ * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#lines()}.
+ */
+ @NotNull
+ @Deprecated
+ public java.util.List<net.kyori.adventure.text.Component> lines();
+
+ /**

View file

@ -354,6 +354,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Spigot spigot();
// Spigot end
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable {
* @return a list of dropped items for this type of block
*/
@NotNull
- Collection<ItemStack> getDrops(@NotNull ItemStack tool, @Nullable Entity entity);
+ Collection<ItemStack> getDrops(@Nullable ItemStack tool, @Nullable Entity entity); // Paper
/**
* Returns if the given item is a preferred choice to break this Block.
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/BlockState.java

View file

@ -224,43 +224,14 @@ diff --git a/src/test/java/org/bukkit/BukkitMirrorTest.java b/src/test/java/org/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/BukkitMirrorTest.java
+++ b/src/test/java/org/bukkit/BukkitMirrorTest.java
@@ -0,0 +0,0 @@ public class BukkitMirrorTest {
@@ -0,0 +0,0 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@ParameterizedTest
@MethodSource("data")
+ @org.junit.jupiter.api.Disabled // Paper
public void isStatic(Method server, String name, Method bukkit) throws Throwable {
assertThat(Modifier.isStatic(bukkit.getModifiers()), is(true));
}
+@org.junit.jupiter.api.Disabled // Paper
public class BukkitMirrorTest {
@ParameterizedTest
@MethodSource("data")
+ @org.junit.jupiter.api.Disabled // Paper
public void isDeprecated(Method server, String name, Method bukkit) throws Throwable {
assertThat(bukkit.isAnnotationPresent(Deprecated.class), is(server.isAnnotationPresent(Deprecated.class)));
}
@ParameterizedTest
@MethodSource("data")
+ @org.junit.jupiter.api.Disabled // Paper
public void returnType(Method server, String name, Method bukkit) throws Throwable {
assertThat(bukkit.getReturnType(), is((Object) server.getReturnType()));
// assertThat(bukkit.getGenericReturnType(), is(server.getGenericReturnType())); // too strict on <T> type generics
@@ -0,0 +0,0 @@ public class BukkitMirrorTest {
@ParameterizedTest
@MethodSource("data")
+ @org.junit.jupiter.api.Disabled // Paper
public void parameterTypes(Method server, String name, Method bukkit) throws Throwable {
// assertThat(bukkit.getGenericParameterTypes(), is(server.getGenericParameterTypes())); // too strict on <T> type generics
}
@ParameterizedTest
@MethodSource("data")
+ @org.junit.jupiter.api.Disabled // Paper
public void declaredException(Method server, String name, Method bukkit) throws Throwable {
assertThat(bukkit.getGenericExceptionTypes(), is(server.getGenericExceptionTypes()));
}
public static Stream<Arguments> data() {
diff --git a/src/test/java/org/bukkit/support/TestServer.java b/src/test/java/org/bukkit/support/TestServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/support/TestServer.java

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add Wandering Trader spawn rate config options
Adds config options for modifying the spawn rates of Wandering Traders.
These values are all easy to understand and configure after a quick read of this
page on the Minecraft wiki: https://minecraft.gamepedia.com/Wandering_Trader#Spawning
page on the Minecraft wiki: https://minecraft.wiki/wiki/Wandering_Trader#Spawning
Usages of the vanilla WanderingTraderSpawnDelay and WanderingTraderSpawnChance values
in IWorldServerData are removed as they were only used in certain places, with hardcoded
values used in other places.

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Don't call getItemMeta on hasItemMeta
Spigot 1.13 checks if any field (which are manually copied from the ItemStack's "tag" NBT tag) on the ItemMeta class of an ItemStack is set.
We could just check if the "tag" NBT tag is empty, albeit that would break some plugins. The only general tag added on 1.13 is "Damage", and we can just check if the "tag" NBT tag contains any other tag that's not "Damage" (https://minecraft.gamepedia.com/Player.dat_format#Item_structure) making the `hasItemStack` method behave as before.
We could just check if the "tag" NBT tag is empty, albeit that would break some plugins. The only general tag added on 1.13 is "Damage", and we can just check if the "tag" NBT tag contains any other tag that's not "Damage" (https://minecraft.wiki/wiki/Player.dat_format#Item_structure) making the `hasItemStack` method behave as before.
Returns true if getDamage() == 0 or has damage tag or other tag is set.
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.