fixup tests and add missing API detected by those tests
This commit is contained in:
parent
8d8eb3bdf6
commit
7606e6da39
9 changed files with 101 additions and 45 deletions
|
@ -115,10 +115,10 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015
|
|||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a804cbd047f
|
||||
index 0000000000000000000000000000000000000000..4e7a1e26d3dddd2ccba4fa5d02e6752313507612
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
@@ -0,0 +1,708 @@
|
||||
@@ -0,0 +1,717 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
||||
+ *
|
||||
|
@ -224,7 +224,7 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ */
|
||||
+ public static final MaterialSetTag DOORS = new MaterialSetTag(keyFor("doors"))
|
||||
+ .endsWith("_DOOR")
|
||||
+ .ensureSize("DOORS", 12).lock();
|
||||
+ .ensureSize("DOORS", 20).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all dyes.
|
||||
|
@ -438,7 +438,7 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ */
|
||||
+ public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
|
||||
+ .endsWith("_SPAWN_EGG")
|
||||
+ .ensureSize("SPAWN_EGGS", 77).lock();
|
||||
+ .ensureSize("SPAWN_EGGS", 78).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all colors of stained glass.
|
||||
|
@ -459,7 +459,7 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ */
|
||||
+ public static final MaterialSetTag TRAPDOORS = new MaterialSetTag(keyFor("trapdoors"))
|
||||
+ .endsWith("_TRAPDOOR")
|
||||
+ .ensureSize("TRAPDOORS", 12).lock();
|
||||
+ .ensureSize("TRAPDOORS", 20).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all wood variants of doors.
|
||||
|
@ -467,6 +467,7 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ public static final MaterialSetTag WOODEN_DOORS = new MaterialSetTag(keyFor("wooden_doors"))
|
||||
+ .endsWith("_DOOR")
|
||||
+ .not(Material.IRON_DOOR)
|
||||
+ .notContains("COPPER")
|
||||
+ .ensureSize("WOODEN_DOORS", 11).lock();
|
||||
+
|
||||
+ /**
|
||||
|
@ -483,6 +484,7 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ public static final MaterialSetTag WOODEN_TRAPDOORS = new MaterialSetTag(keyFor("wooden_trapdoors"))
|
||||
+ .endsWith("_TRAPDOOR")
|
||||
+ .not(Material.IRON_TRAPDOOR)
|
||||
+ .notContains("COPPER")
|
||||
+ .ensureSize("WOODEN_TRAPDOORS", 11).lock();
|
||||
+
|
||||
+ /**
|
||||
|
@ -713,25 +715,29 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ * Covers all oxidized copper blocks.
|
||||
+ */
|
||||
+ public static final MaterialSetTag OXIDIZED_COPPER_BLOCKS = new MaterialSetTag(keyFor("oxidized_copper_blocks"))
|
||||
+ .startsWith("OXIDIZED_").startsWith("WAXED_OXIDIZED_").ensureSize("OXIDIZED_COPPER_BLOCKS", 8).lock();
|
||||
+ .startsWith("OXIDIZED_").startsWith("WAXED_OXIDIZED_").ensureSize("OXIDIZED_COPPER_BLOCKS", 18).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all weathered copper blocks.
|
||||
+ */
|
||||
+ public static final MaterialSetTag WEATHERED_COPPER_BLOCKS = new MaterialSetTag(keyFor("weathered_copper_blocks"))
|
||||
+ .startsWith("WEATHERED_").startsWith("WAXED_WEATHERED_").ensureSize("WEATHERED_COPPER_BLOCKS", 8).lock();
|
||||
+ .startsWith("WEATHERED_").startsWith("WAXED_WEATHERED_").ensureSize("WEATHERED_COPPER_BLOCKS", 18).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all exposed copper blocks.
|
||||
+ */
|
||||
+ public static final MaterialSetTag EXPOSED_COPPER_BLOCKS = new MaterialSetTag(keyFor("exposed_copper_blocks"))
|
||||
+ .startsWith("EXPOSED_").startsWith("WAXED_EXPOSED_").ensureSize("EXPOSED_COPPER_BLOCKS", 8).lock();
|
||||
+ .startsWith("EXPOSED_").startsWith("WAXED_EXPOSED_").ensureSize("EXPOSED_COPPER_BLOCKS", 18).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all un-weathered copper blocks.
|
||||
+ */
|
||||
+ public static final MaterialSetTag UNAFFECTED_COPPER_BLOCKS = new MaterialSetTag(keyFor("unaffected_copper_blocks"))
|
||||
+ .startsWith("CUT_COPPER").startsWith("WAXED_CUT_COPPER").add(Material.COPPER_BLOCK).add(Material.WAXED_COPPER_BLOCK).ensureSize("UNAFFECTED_COPPER_BLOCKS", 8).lock();
|
||||
+ .startsWith("CUT_COPPER").startsWith("WAXED_CUT_COPPER")
|
||||
+ .startsWith("WAXED_COPPER_").startsWith("COPPER_")
|
||||
+ .add(Material.CHISELED_COPPER, Material.WAXED_CHISELED_COPPER)
|
||||
+ .not(Material.COPPER_INGOT, Material.COPPER_ORE)
|
||||
+ .ensureSize("UNAFFECTED_COPPER_BLOCKS", 18).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all waxed copper blocks.
|
||||
|
@ -739,7 +745,7 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ * Combine with other copper-related tags to filter is-waxed or not.
|
||||
+ */
|
||||
+ public static final MaterialSetTag WAXED_COPPER_BLOCKS = new MaterialSetTag(keyFor("waxed_copper_blocks"))
|
||||
+ .add(m -> m.name().startsWith("WAXED_") && m.name().contains("COPPER")).ensureSize("WAXED_COPPER_BLOCKS", 16).lock();
|
||||
+ .add(m -> m.name().startsWith("WAXED_") && m.name().contains("COPPER")).ensureSize("WAXED_COPPER_BLOCKS", 36).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all un-waxed copper blocks.
|
||||
|
@ -747,22 +753,25 @@ index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a80
|
|||
+ * Combine with other copper-related tags to filter is-un-waxed or not.
|
||||
+ */
|
||||
+ public static final MaterialSetTag UNWAXED_COPPER_BLOCKS = new MaterialSetTag(keyFor("unwaxed_copper_blocks"))
|
||||
+ .contains("CUT_COPPER").endsWith("_COPPER").notContains("WAXED").add(Material.COPPER_BLOCK).not(Material.RAW_COPPER).ensureSize("UNWAXED_COPPER_BLOCKS", 16).lock();
|
||||
+ .startsWith("EXPOSED_").startsWith("WEATHERED_").startsWith("OXIDIZED_")
|
||||
+ .startsWith("CUT_COPPER")
|
||||
+ .add(Material.COPPER_BLOCK, Material.CHISELED_COPPER, Material.COPPER_DOOR, Material.COPPER_TRAPDOOR, Material.COPPER_GRATE, Material.COPPER_BULB)
|
||||
+ .ensureSize("UNWAXED_COPPER_BLOCKS", 36).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all copper block variants.
|
||||
+ */
|
||||
+ public static final MaterialSetTag COPPER_BLOCKS = new MaterialSetTag(keyFor("copper_blocks"))
|
||||
+ .add(WAXED_COPPER_BLOCKS).add(UNWAXED_COPPER_BLOCKS).ensureSize("COPPER_BLOCKS", 32).lock();
|
||||
+ .add(WAXED_COPPER_BLOCKS).add(UNWAXED_COPPER_BLOCKS).ensureSize("COPPER_BLOCKS", 72).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all weathering/waxed states of the plain copper block.
|
||||
+ */
|
||||
+ public static final MaterialSetTag FULL_COPPER_BLOCKS = new MaterialSetTag(keyFor("full_copper_blocks"))
|
||||
+ .contains("OXIDIZED_COPPER")
|
||||
+ .contains("WEATHERED_COPPER")
|
||||
+ .contains("EXPOSED_COPPER")
|
||||
+ .contains("COPPER_BLOCK")
|
||||
+ .endsWith("OXIDIZED_COPPER")
|
||||
+ .endsWith("WEATHERED_COPPER")
|
||||
+ .endsWith("EXPOSED_COPPER")
|
||||
+ .endsWith("COPPER_BLOCK")
|
||||
+ .not(Material.RAW_COPPER_BLOCK)
|
||||
+ .ensureSize("FULL_COPPER_BLOCKS", 8).lock();
|
||||
+
|
||||
|
|
|
@ -3,9 +3,10 @@ From: Ivan Pekov <ivan@mrivanplays.com>
|
|||
Date: Tue, 5 Jan 2021 10:19:11 +0200
|
||||
Subject: [PATCH] Add missing effects
|
||||
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Effect.java b/src/main/java/org/bukkit/Effect.java
|
||||
index 611b7df0e31de932f15c2f13bd8ed286e0b3b43f..9c18b58d37a2dc677ce7c22c5be833ef95bf7c03 100644
|
||||
index 611b7df0e31de932f15c2f13bd8ed286e0b3b43f..b8ad6ec6795433770604a1cc93384ef639e810bd 100644
|
||||
--- a/src/main/java/org/bukkit/Effect.java
|
||||
+++ b/src/main/java/org/bukkit/Effect.java
|
||||
@@ -132,12 +132,12 @@ public enum Effect {
|
||||
|
@ -24,7 +25,7 @@ index 611b7df0e31de932f15c2f13bd8ed286e0b3b43f..9c18b58d37a2dc677ce7c22c5be833ef
|
|||
/**
|
||||
* Visual effect of an instant splash potion breaking. Needs color data
|
||||
* value as additional info.
|
||||
@@ -337,21 +337,124 @@ public enum Effect {
|
||||
@@ -337,21 +337,146 @@ public enum Effect {
|
||||
* block.
|
||||
*/
|
||||
OXIDISED_COPPER_SCRAPE(3005, Type.VISUAL),
|
||||
|
@ -122,13 +123,35 @@ index 611b7df0e31de932f15c2f13bd8ed286e0b3b43f..9c18b58d37a2dc677ce7c22c5be833ef
|
|||
+
|
||||
+ SOUND_STOP_JUKEBOX_SONG(1011, Type.SOUND),
|
||||
+
|
||||
+ CRAFTER_CRAFT(1049, Type.SOUND),
|
||||
+
|
||||
+ CRAFTER_FAIL(1050, Type.SOUND),
|
||||
+
|
||||
+ /**
|
||||
+ * {@link BlockFace} param is the direction to shoot
|
||||
+ */
|
||||
+ SHOOT_WHITE_SMOKE(2010, Type.VISUAL, BlockFace.class),
|
||||
+
|
||||
+ PARTICLES_SCULK_CHARGE(3006, Type.VISUAL, Integer.class),
|
||||
+
|
||||
+ PARTICLES_SCULK_SHRIEK(3007, Type.SOUND),
|
||||
+
|
||||
+ PARTICLES_AND_SOUND_BRUSH_BLOCK_COMPLETE(3008, Type.VISUAL, org.bukkit.block.data.BlockData.class),
|
||||
+
|
||||
+ PARTICLES_EGG_CRACK(3009, Type.VISUAL)
|
||||
+ PARTICLES_EGG_CRACK(3009, Type.VISUAL),
|
||||
+
|
||||
+ GUST_DUST(3010, Type.VISUAL),
|
||||
+
|
||||
+ TRIAL_SPAWNER_SPAWN(3011, Type.VISUAL),
|
||||
+
|
||||
+ TRIAL_SPAWNER_SPAWN_MOB_AT(3012, Type.VISUAL),
|
||||
+
|
||||
+ /**
|
||||
+ * {@link Integer} param is the number of players
|
||||
+ */
|
||||
+ TRIAL_SPAWNER_DETECT_PLAYER(3013, Type.VISUAL, Integer.class),
|
||||
+
|
||||
+ TRIAL_SPAWNER_EJECT_ITEM(3014, Type.VISUAL),
|
||||
;
|
||||
+ private static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger();
|
||||
+ // Paper end
|
||||
|
@ -153,7 +176,7 @@ index 611b7df0e31de932f15c2f13bd8ed286e0b3b43f..9c18b58d37a2dc677ce7c22c5be833ef
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -367,8 +470,10 @@ public enum Effect {
|
||||
@@ -367,8 +492,10 @@ public enum Effect {
|
||||
|
||||
/**
|
||||
* @return The type of the effect.
|
||||
|
@ -164,7 +187,7 @@ index 611b7df0e31de932f15c2f13bd8ed286e0b3b43f..9c18b58d37a2dc677ce7c22c5be833ef
|
|||
public Type getType() {
|
||||
return this.type;
|
||||
}
|
||||
@@ -379,8 +484,15 @@ public enum Effect {
|
||||
@@ -379,8 +506,15 @@ public enum Effect {
|
||||
*/
|
||||
@Nullable
|
||||
public Class<?> getData() {
|
||||
|
@ -181,7 +204,7 @@ index 611b7df0e31de932f15c2f13bd8ed286e0b3b43f..9c18b58d37a2dc677ce7c22c5be833ef
|
|||
|
||||
/**
|
||||
* Gets the Effect associated with the given ID.
|
||||
@@ -397,12 +509,26 @@ public enum Effect {
|
||||
@@ -397,12 +531,26 @@ public enum Effect {
|
||||
|
||||
static {
|
||||
for (Effect effect : values()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue