mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 21:47:55 +01:00
fixup tests and add missing API detected by those tests
This commit is contained in:
parent
8d8eb3bdf6
commit
7606e6da39
@ -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()) {
|
||||
|
@ -18,10 +18,10 @@ index 2566e25f10136ebccb6c9bbdd0722d6cf226f7aa..664fef8d6a901f0f4ebf03ad49a6baaf
|
||||
testImplementation("org.mockito:mockito-core:5.5.0")
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f80a6ad7638453348ee82ea00b166a3aac029142
|
||||
index 0000000000000000000000000000000000000000..5fb56067221434aa80e626437ed10f65bf416e4f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
@@ -0,0 +1,374 @@
|
||||
@@ -0,0 +1,376 @@
|
||||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
@ -57,6 +57,7 @@ index 0000000000000000000000000000000000000000..f80a6ad7638453348ee82ea00b166a3a
|
||||
+import net.minecraft.world.entity.monster.RangedAttackMob;
|
||||
+import net.minecraft.world.entity.monster.SpellcasterIllager;
|
||||
+import net.minecraft.world.entity.monster.ZombifiedPiglin;
|
||||
+import net.minecraft.world.entity.monster.breeze.Breeze;
|
||||
+import net.minecraft.world.entity.monster.piglin.AbstractPiglin;
|
||||
+import org.bukkit.NamespacedKey;
|
||||
+import org.bukkit.entity.AbstractHorse;
|
||||
@ -268,6 +269,7 @@ index 0000000000000000000000000000000000000000..f80a6ad7638453348ee82ea00b166a3a
|
||||
+ bukkitMap.put(net.minecraft.world.entity.monster.warden.Warden.class, org.bukkit.entity.Warden.class);
|
||||
+ bukkitMap.put(net.minecraft.world.entity.animal.allay.Allay.class, org.bukkit.entity.Allay.class);
|
||||
+ bukkitMap.put(net.minecraft.world.entity.animal.sniffer.Sniffer.class, org.bukkit.entity.Sniffer.class);
|
||||
+ bukkitMap.put(Breeze.class, org.bukkit.entity.Breeze.class);
|
||||
+ }
|
||||
+
|
||||
+ public static String getUsableName(Class<?> clazz) {
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Added missing default perms for commands
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
index a9ea2e38e4673686c9994a58c94ad19e59fd423c..ea732f8fe7b5dd56aab5d3a061a1cad19c49ae0b 100644
|
||||
index a9ea2e38e4673686c9994a58c94ad19e59fd423c..dd95b3bfe59f2bb635afe92317288efcd2986326 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
@@ -24,13 +24,73 @@ public final class CommandPermissions {
|
||||
@@ -24,13 +24,74 @@ public final class CommandPermissions {
|
||||
DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "stop", "Allows the user to stop the server", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "list", "Allows the user to list all online players", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "gamemode", "Allows the user to change the gamemode of another player", PermissionDefault.OP, commands);
|
||||
@ -73,6 +73,7 @@ index a9ea2e38e4673686c9994a58c94ad19e59fd423c..ea732f8fe7b5dd56aab5d3a061a1cad1
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "teammsg", "Allows the user to specify the message to send to team", PermissionDefault.TRUE, commands); // defaults to all players
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "tellraw", "Allows the user to display a JSON message to players", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "time", "Allows the user to change or query the world's game time", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "tick", "Allows the user to control the tick rate of the server", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "title", "Allows the user to manage screen titles", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "weather", "Allows the user to set the weather", PermissionDefault.OP, commands);
|
||||
+ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "whitelist", "Allows the user to manage the server whitelist", PermissionDefault.OP, commands);
|
||||
|
@ -93,7 +93,7 @@ index 47b5930adf1870125b1ec063895b0652890a06de..253b4cf66e94faf0bc8861318ae7549f
|
||||
}
|
||||
diff --git a/src/test/java/io/papermc/paper/world/structure/ConfiguredStructureTest.java b/src/test/java/io/papermc/paper/world/structure/ConfiguredStructureTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..cc24d5746b96d8ac352a3ed0a675a7b159f8bd65
|
||||
index 0000000000000000000000000000000000000000..9178fe0d01b998ca1442bf2511f8fc00db9388ba
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/world/structure/ConfiguredStructureTest.java
|
||||
@@ -0,0 +1,96 @@
|
||||
@ -159,7 +159,7 @@ index 0000000000000000000000000000000000000000..cc24d5746b96d8ac352a3ed0a675a7b1
|
||||
+ for (Structure feature : structureRegistry) {
|
||||
+ final ResourceLocation key = structureRegistry.getKey(feature);
|
||||
+ assertNotNull(key, "Missing built-in registry key");
|
||||
+ if (key.equals(BuiltinStructures.ANCIENT_CITY.location()) || key.equals(BuiltinStructures.TRAIL_RUINS.location())) {
|
||||
+ if (key.equals(BuiltinStructures.ANCIENT_CITY.location()) || key.equals(BuiltinStructures.TRAIL_RUINS.location()) || key.equals(BuiltinStructures.TRIAL_CHAMBERS.location())) {
|
||||
+ continue; // TODO remove when upstream adds "jigsaw" StructureType
|
||||
+ }
|
||||
+ if (DEFAULT_CONFIGURED_STRUCTURES.get(CraftNamespacedKey.fromMinecraft(key)) == null) {
|
||||
|
@ -38,10 +38,10 @@ Co-authored-by: booky10 <boooky10@gmail.com>
|
||||
Co-authored-by: Amin <amin.haddou@frg.wwschool.de>
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
index f80a6ad7638453348ee82ea00b166a3aac029142..a08c00b8c0488d18be5e182f7892e5ab71d12247 100644
|
||||
index 5fb56067221434aa80e626437ed10f65bf416e4f..cfe6a6f6bcfd7a3b29ab25f5a6745d31c18f338d 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
@@ -164,7 +164,7 @@ public class MobGoalHelper {
|
||||
@@ -165,7 +165,7 @@ public class MobGoalHelper {
|
||||
bukkitMap.put(net.minecraft.world.entity.monster.Endermite.class, Endermite.class);
|
||||
bukkitMap.put(net.minecraft.world.entity.monster.Evoker.class, Evoker.class);
|
||||
bukkitMap.put(AbstractFish.class, Fish.class);
|
||||
|
@ -189,7 +189,7 @@ index 812819e814cfbdb542051a7dbfe123d3c59e66bd..61d00421b295103a6964b22fe0dfaf09
|
||||
{
|
||||
diff --git a/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d483fea98005426c91a3ed43f2f3ce72e140c3bc
|
||||
index 0000000000000000000000000000000000000000..47535c27d7cffc4b5ee6cc9e145b1087477eef79
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java
|
||||
@@ -0,0 +1,24 @@
|
||||
@ -213,7 +213,7 @@ index 0000000000000000000000000000000000000000..d483fea98005426c91a3ed43f2f3ce72
|
||||
+ final var frame = PaperAdvancementDisplay.asPaperFrame(advancementType);
|
||||
+ assertEquals(expectedTranslationKey, frame.translationKey(), "The translation keys should be the same");
|
||||
+ assertEquals(expectedColor, frame.color(), "The frame colors should be the same");
|
||||
+ assertEquals(advancementType.name(), AdvancementDisplay.Frame.NAMES.key(frame));
|
||||
+ assertEquals(advancementType.getSerializedName(), AdvancementDisplay.Frame.NAMES.key(frame));
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
@ -33,7 +33,7 @@ index eee2239cd715d01c5adbf1cd79282e115f42cd2e..8bab3fcfc6aa6c0b37621474a69f15e9
|
||||
this.tryGenerateStructure((StructureSet.StructureSelectionEntry) list.get(0), structureAccessor, registryManager, randomstate, structureTemplateManager, placementCalculator.getLevelSeed(), chunk, chunkcoordintpair, sectionposition);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
index a310bfbf0d08187375ea17f4b04b276a0b7d0b9f..f8cd23fb6ea7909b8f30bd21d3f2c7bcc483ef21 100644
|
||||
index a310bfbf0d08187375ea17f4b04b276a0b7d0b9f..5d3d9164a05efbecc59ace6175f449f34d8d3ccd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
@@ -50,13 +50,14 @@ public class ChunkGeneratorStructureState {
|
||||
@ -79,7 +79,7 @@ index a310bfbf0d08187375ea17f4b04b276a0b7d0b9f..f8cd23fb6ea7909b8f30bd21d3f2c7bc
|
||||
String name = holder.unwrapKey().orElseThrow().location().getPath();
|
||||
int seed = randomConfig.salt;
|
||||
|
||||
@@ -118,11 +129,24 @@ public class ChunkGeneratorStructureState {
|
||||
@@ -118,11 +129,27 @@ public class ChunkGeneratorStructureState {
|
||||
case "villages":
|
||||
seed = conf.villageSeed;
|
||||
break;
|
||||
@ -90,6 +90,9 @@ index a310bfbf0d08187375ea17f4b04b276a0b7d0b9f..f8cd23fb6ea7909b8f30bd21d3f2c7bc
|
||||
+ case "trail_ruins":
|
||||
+ seed = conf.trailRuinsSeed;
|
||||
+ break;
|
||||
+ case "trial_chambers":
|
||||
+ seed = conf.trialChambersSeed;
|
||||
+ break;
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@ -106,7 +109,7 @@ index a310bfbf0d08187375ea17f4b04b276a0b7d0b9f..f8cd23fb6ea7909b8f30bd21d3f2c7bc
|
||||
}).collect(Collectors.toUnmodifiableList());
|
||||
}
|
||||
// Spigot end
|
||||
@@ -139,12 +163,13 @@ public class ChunkGeneratorStructureState {
|
||||
@@ -139,12 +166,13 @@ public class ChunkGeneratorStructureState {
|
||||
return stream.anyMatch(set::contains);
|
||||
}
|
||||
|
||||
@ -121,7 +124,7 @@ index a310bfbf0d08187375ea17f4b04b276a0b7d0b9f..f8cd23fb6ea7909b8f30bd21d3f2c7bc
|
||||
}
|
||||
|
||||
public List<Holder<StructureSet>> possibleStructureSets() {
|
||||
@@ -198,7 +223,13 @@ public class ChunkGeneratorStructureState {
|
||||
@@ -198,7 +226,13 @@ public class ChunkGeneratorStructureState {
|
||||
HolderSet<Biome> holderset = placement.preferredBiomes();
|
||||
RandomSource randomsource = RandomSource.create();
|
||||
|
||||
@ -135,7 +138,7 @@ index a310bfbf0d08187375ea17f4b04b276a0b7d0b9f..f8cd23fb6ea7909b8f30bd21d3f2c7bc
|
||||
double d0 = randomsource.nextDouble() * 3.141592653589793D * 2.0D;
|
||||
int l = 0;
|
||||
int i1 = 0;
|
||||
@@ -275,7 +306,7 @@ public class ChunkGeneratorStructureState {
|
||||
@@ -275,7 +309,7 @@ public class ChunkGeneratorStructureState {
|
||||
|
||||
for (int l = centerChunkX - chunkCount; l <= centerChunkX + chunkCount; ++l) {
|
||||
for (int i1 = centerChunkZ - chunkCount; i1 <= centerChunkZ + chunkCount; ++i1) {
|
||||
@ -232,16 +235,17 @@ index 65dcb14241baadb2c9f8f16919d7b562198ad9c3..594a2dd3b1d4c29c969d1992b8e93795
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
index 62c1434018be5b5fb70f7019b3c06d4d9200661d..f9b8e2bc039f1a37e47f84909c8785f3ef530284 100644
|
||||
index 62c1434018be5b5fb70f7019b3c06d4d9200661d..1cf6d4f854d89c515e48e1fb365eb95ff9340765 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
@@ -368,6 +368,17 @@ public class SpigotWorldConfig
|
||||
@@ -368,6 +368,18 @@ public class SpigotWorldConfig
|
||||
public int mansionSeed;
|
||||
public int fossilSeed;
|
||||
public int portalSeed;
|
||||
+ // Paper start - add missing structure set configs
|
||||
+ public int ancientCitySeed;
|
||||
+ public int trailRuinsSeed;
|
||||
+ public int trialChambersSeed;
|
||||
+ public int buriedTreasureSeed;
|
||||
+ public Integer mineshaftSeed;
|
||||
+ public Long strongholdSeed;
|
||||
@ -253,13 +257,14 @@ index 62c1434018be5b5fb70f7019b3c06d4d9200661d..f9b8e2bc039f1a37e47f84909c8785f3
|
||||
private void initWorldGenSeeds()
|
||||
{
|
||||
this.villageSeed = this.getInt( "seed-village", 10387312 );
|
||||
@@ -385,6 +396,13 @@ public class SpigotWorldConfig
|
||||
@@ -385,6 +397,14 @@ public class SpigotWorldConfig
|
||||
this.mansionSeed = this.getInt( "seed-mansion", 10387319 );
|
||||
this.fossilSeed = this.getInt( "seed-fossil", 14357921 );
|
||||
this.portalSeed = this.getInt( "seed-portal", 34222645 );
|
||||
+ // Paper start - add missing structure set configs
|
||||
+ this.ancientCitySeed = this.getInt("seed-ancientcity", 20083232);
|
||||
+ this.trailRuinsSeed = this.getInt("seed-trailruins", 83469867);
|
||||
+ this.trialChambersSeed = this.getInt("seed-trialchambers", 94251327);
|
||||
+ this.buriedTreasureSeed = this.getInt("seed-buriedtreasure", 10387320); // StructurePlacement#HIGHLY_ARBITRARY_RANDOM_SALT
|
||||
+ this.mineshaftSeed = this.getSeed("seed-mineshaft", Integer::parseInt);
|
||||
+ this.strongholdSeed = this.getSeed("seed-stronghold", Long::parseLong);
|
||||
@ -269,10 +274,10 @@ index 62c1434018be5b5fb70f7019b3c06d4d9200661d..f9b8e2bc039f1a37e47f84909c8785f3
|
||||
}
|
||||
diff --git a/src/test/java/io/papermc/paper/world/structure/StructureSeedConfigTest.java b/src/test/java/io/papermc/paper/world/structure/StructureSeedConfigTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..eeb03ecaaa81ef21c15460245398e5246c3ac514
|
||||
index 0000000000000000000000000000000000000000..9061ad5868ac18e76ae4d51d23d101c5e25f7f52
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/world/structure/StructureSeedConfigTest.java
|
||||
@@ -0,0 +1,74 @@
|
||||
@@ -0,0 +1,75 @@
|
||||
+package io.papermc.paper.world.structure;
|
||||
+
|
||||
+import io.papermc.paper.configuration.PaperConfigurations;
|
||||
@ -334,6 +339,7 @@ index 0000000000000000000000000000000000000000..eeb03ecaaa81ef21c15460245398e524
|
||||
+ case "end_cities" -> config.endCitySeed;
|
||||
+ case "ancient_cities" -> config.ancientCitySeed;
|
||||
+ case "trail_ruins" -> config.trailRuinsSeed;
|
||||
+ case "trial_chambers" -> config.trialChambersSeed;
|
||||
+ default -> throw new AssertionError("Missing structure set seed in SpigotWorldConfig for " + setKey);
|
||||
+ };
|
||||
+ if (setKey == BuiltinStructureSets.BURIED_TREASURES) {
|
||||
|
@ -9,14 +9,15 @@ upstream. Until then, this test and these fixes
|
||||
should address all the known issues with them
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java
|
||||
index 5a5a8945c786e16ff0df62494ddd1ac85c42b53f..63f9735d356dafd579cee4423d3037eb4ed9b2c6 100644
|
||||
index 5a5a8945c786e16ff0df62494ddd1ac85c42b53f..4ce0e1e557a844fb3add866a257a8424885f7d43 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java
|
||||
@@ -15,12 +15,15 @@ public class CraftEffect {
|
||||
@@ -15,12 +15,16 @@ public class CraftEffect {
|
||||
public static <T> int getDataValue(Effect effect, T data) {
|
||||
int datavalue;
|
||||
switch (effect) {
|
||||
+ case PARTICLES_SCULK_CHARGE: // Paper - add missing effects
|
||||
+ case TRIAL_SPAWNER_DETECT_PLAYER: // Paper - add missing effects
|
||||
case VILLAGER_PLANT_GROW:
|
||||
datavalue = (Integer) data;
|
||||
break;
|
||||
@ -28,7 +29,21 @@ index 5a5a8945c786e16ff0df62494ddd1ac85c42b53f..63f9735d356dafd579cee4423d3037eb
|
||||
case INSTANT_POTION_BREAK:
|
||||
datavalue = ((Color) data).asRGB();
|
||||
break;
|
||||
@@ -59,8 +62,15 @@ public class CraftEffect {
|
||||
@@ -28,6 +32,13 @@ public class CraftEffect {
|
||||
Preconditions.checkArgument(data == Material.AIR || ((Material) data).isRecord(), "Invalid record type for Material %s!", data);
|
||||
datavalue = Item.getId(CraftMagicNumbers.getItem((Material) data));
|
||||
break;
|
||||
+ // Paper start - handle shoot white smoke event
|
||||
+ case SHOOT_WHITE_SMOKE:
|
||||
+ final BlockFace face = (BlockFace) data;
|
||||
+ Preconditions.checkArgument(face.isCartesian(), face + " isn't cartesian");
|
||||
+ datavalue = org.bukkit.craftbukkit.block.CraftBlock.blockFaceToNotch(face).get3DDataValue();
|
||||
+ break;
|
||||
+ // Paper end - handle shoot white smoke event
|
||||
case SMOKE:
|
||||
switch ((BlockFace) data) {
|
||||
case DOWN:
|
||||
@@ -59,8 +70,15 @@ public class CraftEffect {
|
||||
}
|
||||
break;
|
||||
case STEP_SOUND:
|
||||
|
Loading…
Reference in New Issue
Block a user