Updated Upstream (Bukkit/CraftBukkit) (#11501)
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: bb4e97c6 Add support for Java 23 bc6874dd Bump asm to 9.7.1 50e8a00b PR-1064: Add specific getTopInventory methods for InventoryView derivatives 758b0a0f SPIGOT-7911: Fix Location#isWorldLoaded() for re-loaded worlds 133a64a7 Improve Registry#getOrThrow messages be0f5957 PR-1058: Add tests for Minecraft registry <-> Bukkit fields d1b31df2 PR-1062: Clarify BeaconView documentation 3fab4384 PR-1060: Cache Material to BlockType and ItemType conversion 967a7301 SPIGOT-7906: Increase YAML nesting limit to 100 6ecf033d SPIGOT-7899: Smithing recipes don't require inputs CraftBukkit Changes: 0a7bd6c81 PR-1493: Improve reroute performance and add some tests 54941524c Add support for Java 23 f4d957fff SPIGOT-7915: Fix World#getKeepSpawnInMemory() using Spawn Radius rather than Spawn Chunk Radius ded183674 Fix HIDE_ENCHANTS flag in items without enchantments 308785a0a Bump asm to 9.7.1 and re-add ClassReader to ClassWriter 72ce823cd PR-1487: Add specific getTopInventory methods for InventoryView derivatives 11a5e840c SPIGOT-7907, PR-1484: Improve merchant recipe item matching behavior to more closely align with older versions 45b66f7e4 SPIGOT-7909: Always set HIDE_ENCHANTS flag to item if flag is set 963459791 Increase outdated build delay fc5b2d75f SPIGOT-7910: Fix launching breeze wind charge from API and improve dispenser launch API c7d6428f2 SPIGOT-7856, PR-1483: End platform not dropping items after replacing blocks 2a5572b52 SPIGOT-7780, PR-1482: Cannot edit chunks during unload event 527041ab5 SPIGOT-7902, PR-1477: Fix CraftMetaPotion#hasCustomEffects() does not check if customEffects (List) is empty 5529a1769 Implement base methods for tags 30fbdbaaf Improve Registry#getOrThrow messages 6b71a7322 PR-1475: Add tests for Minecraft registry <-> Bukkit fields 5f24c255c SPIGOT-7908: Mark junit-platform-suite-engine as test scope e4c92ef65 PR-1473: Change tests to use suites, to run tests in different environments and feature flags d25e1e722 PR-1481: Fix BeaconView#set[X]Effect(null) d69a05362 PR-1480: Fix PerMaterialTest#isEdible test running for legacy materials bb3284a89 PR-1479: Use custom #isBlock method in legacy init instead of the one in Material, since it relies on legacy being init 98c57cbbe SPIGOT-7904: Fix NPE for PlayerItemBreakEvent f35bae9ec Fix missing hasJukeboxPlayable 8a6f8b6d8 SPIGOT-7881: CTRL+Pick Block saves position data into item 7913b3be7 SPIGOT-7899: Smithing recipes don't require inputs
This commit is contained in:
parent
755a7753af
commit
3b9db2b194
212 changed files with 1502 additions and 1329 deletions
|
@ -28,10 +28,10 @@ index 37dab9e868dbfb019c271a547d975a48ad1cb571..3811c0d849a3eb028ed1a6b7a2d4747f
|
|||
+/.factorypath
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9ea079d14a92367629dc8fb30d1be043c9290964
|
||||
index 0000000000000000000000000000000000000000..82b298d454dee6a6d996aa7822dd745e70a8da74
|
||||
--- /dev/null
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +1,126 @@
|
||||
@@ -0,0 +1,131 @@
|
||||
+import io.papermc.paperweight.util.*
|
||||
+
|
||||
+plugins {
|
||||
|
@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..9ea079d14a92367629dc8fb30d1be043
|
|||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") {
|
||||
+ exclude(group = "org.apache.logging.log4j", module = "log4j-api")
|
||||
+ }
|
||||
+ implementation("org.ow2.asm:asm-commons:9.7")
|
||||
+ implementation("org.ow2.asm:asm-commons:9.7.1")
|
||||
+ implementation("commons-lang:commons-lang:2.6")
|
||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0")
|
||||
+ runtimeOnly("com.mysql:mysql-connector-j:8.4.0")
|
||||
|
@ -55,9 +55,10 @@ index 0000000000000000000000000000000000000000..9ea079d14a92367629dc8fb30d1be043
|
|||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
+
|
||||
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
||||
+ testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0")
|
||||
+ testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
+ testImplementation("org.mockito:mockito-core:5.11.0")
|
||||
+ testImplementation("org.ow2.asm:asm-tree:9.7")
|
||||
+ testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
+ testImplementation("org.ow2.asm:asm-tree:9.7.1")
|
||||
+}
|
||||
+
|
||||
+paperweight {
|
||||
|
@ -93,8 +94,12 @@ index 0000000000000000000000000000000000000000..9ea079d14a92367629dc8fb30d1be043
|
|||
+}
|
||||
+
|
||||
+tasks.test {
|
||||
+ exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
|
||||
+ useJUnitPlatform()
|
||||
+ include("**/**TestSuite.class")
|
||||
+ workingDir = temporaryDir
|
||||
+ useJUnitPlatform {
|
||||
+ forkEvery = 1
|
||||
+ excludeTags("Slow")
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+fun TaskContainer.registerRunTask(
|
||||
|
@ -160,10 +165,10 @@ index 0000000000000000000000000000000000000000..9ea079d14a92367629dc8fb30d1be043
|
|||
+}
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
deleted file mode 100644
|
||||
index 5abcca1894a0d7795d394834f56c189c0bbeb82f..0000000000000000000000000000000000000000
|
||||
index 71a22e50d5e543d41b0d285fabfa0965a393ab2e..0000000000000000000000000000000000000000
|
||||
--- a/pom.xml
|
||||
+++ /dev/null
|
||||
@@ -1,604 +0,0 @@
|
||||
@@ -1,612 +0,0 @@
|
||||
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
- <modelVersion>4.0.0</modelVersion>
|
||||
|
@ -183,6 +188,7 @@ index 5abcca1894a0d7795d394834f56c189c0bbeb82f..00000000000000000000000000000000
|
|||
-
|
||||
- <properties>
|
||||
- <skipTests>true</skipTests>
|
||||
- <groups>AllFeatures,Bundle,Legacy,Normal,VanillaFeature</groups>
|
||||
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
- <api.version>unknown</api.version>
|
||||
- <bt.name>git</bt.name>
|
||||
|
@ -226,7 +232,7 @@ index 5abcca1894a0d7795d394834f56c189c0bbeb82f..00000000000000000000000000000000
|
|||
- <dependency>
|
||||
- <groupId>org.ow2.asm</groupId>
|
||||
- <artifactId>asm-commons</artifactId>
|
||||
- <version>9.7</version>
|
||||
- <version>9.7.1</version>
|
||||
- <scope>compile</scope>
|
||||
- </dependency>
|
||||
- <!-- Mojang depends -->
|
||||
|
@ -448,6 +454,12 @@ index 5abcca1894a0d7795d394834f56c189c0bbeb82f..00000000000000000000000000000000
|
|||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.junit.platform</groupId>
|
||||
- <artifactId>junit-platform-suite-engine</artifactId>
|
||||
- <version>1.10.0</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.hamcrest</groupId>
|
||||
- <artifactId>hamcrest</artifactId>
|
||||
- <version>2.2</version>
|
||||
|
@ -456,13 +468,13 @@ index 5abcca1894a0d7795d394834f56c189c0bbeb82f..00000000000000000000000000000000
|
|||
- <dependency>
|
||||
- <groupId>org.mockito</groupId>
|
||||
- <artifactId>mockito-core</artifactId>
|
||||
- <version>5.11.0</version>
|
||||
- <version>5.14.1</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.ow2.asm</groupId>
|
||||
- <artifactId>asm-tree</artifactId>
|
||||
- <version>9.7</version>
|
||||
- <version>9.7.1</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- </dependencies>
|
||||
|
@ -675,9 +687,10 @@ index 5abcca1894a0d7795d394834f56c189c0bbeb82f..00000000000000000000000000000000
|
|||
- <version>3.2.5</version>
|
||||
- <configuration>
|
||||
- <workingDirectory>${basedir}/target/test-server</workingDirectory>
|
||||
- <excludes>
|
||||
- <exclude>org/bukkit/craftbukkit/inventory/ItemStack*Test.java</exclude>
|
||||
- </excludes>
|
||||
- <reuseForks>false</reuseForks>
|
||||
- <includes>
|
||||
- <include>**/*TestSuite.java</include>
|
||||
- </includes>
|
||||
- </configuration>
|
||||
- </plugin>
|
||||
- </plugins>
|
||||
|
|
|
@ -74,7 +74,7 @@ index 9051f0186c09eeb8ecccf62b0116f6da1800a1df..b231f90317fe7df9133674b12d478735
|
|||
private Optional<ResourceLocation> randomSequence;
|
||||
|
||||
diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java
|
||||
index dfc3e4f5a5cfee0456097a44d579587719a231a7..9342abe7853a611776684c1eb0b24164148cb5f2 100644
|
||||
index e96d821da0698dd42651500fb97a0856a9e9ce02..fb7d40181abdaa5b2ce607db47c09d0d0a19c86d 100644
|
||||
--- a/src/test/java/org/bukkit/DyeColorsTest.java
|
||||
+++ b/src/test/java/org/bukkit/DyeColorsTest.java
|
||||
@@ -3,7 +3,6 @@ package org.bukkit;
|
||||
|
@ -82,10 +82,10 @@ index dfc3e4f5a5cfee0456097a44d579587719a231a7..9342abe7853a611776684c1eb0b24164
|
|||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
-import net.minecraft.world.item.DyeColor;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.bukkit.support.environment.Normal;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.EnumSource;
|
||||
@@ -14,7 +13,7 @@ public class DyeColorsTest extends AbstractTestingBase {
|
||||
@@ -15,7 +14,7 @@ public class DyeColorsTest {
|
||||
@EnumSource(DyeColor.class)
|
||||
public void checkColor(DyeColor dye) {
|
||||
Color color = dye.getColor();
|
||||
|
@ -94,7 +94,7 @@ index dfc3e4f5a5cfee0456097a44d579587719a231a7..9342abe7853a611776684c1eb0b24164
|
|||
Color nmsColor = Color.fromARGB(nmsColorArray);
|
||||
assertThat(color, is(nmsColor));
|
||||
}
|
||||
@@ -23,7 +22,7 @@ public class DyeColorsTest extends AbstractTestingBase {
|
||||
@@ -24,7 +23,7 @@ public class DyeColorsTest {
|
||||
@EnumSource(org.bukkit.DyeColor.class)
|
||||
public void checkFireworkColor(org.bukkit.DyeColor dye) {
|
||||
Color color = dye.getFireworkColor();
|
||||
|
@ -104,10 +104,10 @@ index dfc3e4f5a5cfee0456097a44d579587719a231a7..9342abe7853a611776684c1eb0b24164
|
|||
}
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/ParticleTest.java b/src/test/java/org/bukkit/ParticleTest.java
|
||||
index 9c9f5dd2351b3067b54d6cc5bdb572c46b12aaa8..307e8a3694c6f0b48d2df9792c3e5fdbaae1fd8e 100644
|
||||
index 688c5bae8146f6fc8cddb2632e9cbf304f0745fb..1b0df6220682328b8f1d03416cb8df2f6662a1cf 100644
|
||||
--- a/src/test/java/org/bukkit/ParticleTest.java
|
||||
+++ b/src/test/java/org/bukkit/ParticleTest.java
|
||||
@@ -250,7 +250,7 @@ public class ParticleTest extends AbstractTestingBase {
|
||||
@@ -251,7 +251,7 @@ public class ParticleTest {
|
||||
Check in CraftParticle if the conversion is still correct.
|
||||
""", bukkit.getKey()));
|
||||
|
||||
|
@ -117,7 +117,7 @@ index 9c9f5dd2351b3067b54d6cc5bdb572c46b12aaa8..307e8a3694c6f0b48d2df9792c3e5fdb
|
|||
Could not encoded particle param for particle %s.
|
||||
This can indicated, that the wrong particle param is created in CraftParticle.
|
||||
diff --git a/src/test/java/org/bukkit/entity/EntityTypesTest.java b/src/test/java/org/bukkit/entity/EntityTypesTest.java
|
||||
index 32df0090aab65b551b524603cce0b96e461cc358..952924abae79cc504342bbdb6f6953ab8a6cc295 100644
|
||||
index 9df52ab0f04758dd04f45f6029fe120ac1a933af..d513d926ddabd61a03172adb846afb7674ed402e 100644
|
||||
--- a/src/test/java/org/bukkit/entity/EntityTypesTest.java
|
||||
+++ b/src/test/java/org/bukkit/entity/EntityTypesTest.java
|
||||
@@ -6,7 +6,6 @@ import java.util.Set;
|
||||
|
@ -125,10 +125,10 @@ index 32df0090aab65b551b524603cce0b96e461cc358..952924abae79cc504342bbdb6f6953ab
|
|||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
-import net.minecraft.world.entity.EntityType;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.bukkit.support.environment.AllFeatures;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -16,8 +15,8 @@ public class EntityTypesTest extends AbstractTestingBase {
|
||||
@@ -17,8 +16,8 @@ public class EntityTypesTest {
|
||||
public void testMaps() {
|
||||
Set<EntityType> allBukkit = Arrays.stream(EntityType.values()).filter((b) -> b.getName() != null).collect(Collectors.toSet());
|
||||
|
||||
|
@ -140,7 +140,7 @@ index 32df0090aab65b551b524603cce0b96e461cc358..952924abae79cc504342bbdb6f6953ab
|
|||
org.bukkit.entity.EntityType bukkit = org.bukkit.entity.EntityType.fromName(key.getPath());
|
||||
assertNotNull(bukkit, "Missing nms->bukkit " + key);
|
||||
diff --git a/src/test/java/org/bukkit/entity/PandaGeneTest.java b/src/test/java/org/bukkit/entity/PandaGeneTest.java
|
||||
index 5818bfa69a8573a2a8f350066f829d587cbc546b..8e421a1bee0c526e3024eab9ba4cc0b320842de2 100644
|
||||
index 4a3ac959f0dcc35f80371443383be1f8b42b6d95..e8520f541fda2d1cd9677f3fc7d7d295743f88b2 100644
|
||||
--- a/src/test/java/org/bukkit/entity/PandaGeneTest.java
|
||||
+++ b/src/test/java/org/bukkit/entity/PandaGeneTest.java
|
||||
@@ -2,7 +2,6 @@ package org.bukkit.entity;
|
||||
|
@ -149,9 +149,9 @@ index 5818bfa69a8573a2a8f350066f829d587cbc546b..8e421a1bee0c526e3024eab9ba4cc0b3
|
|||
|
||||
-import net.minecraft.world.entity.animal.Panda;
|
||||
import org.bukkit.craftbukkit.entity.CraftPanda;
|
||||
import org.bukkit.support.environment.Normal;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -10,8 +9,8 @@ public class PandaGeneTest {
|
||||
@@ -12,8 +11,8 @@ public class PandaGeneTest {
|
||||
|
||||
@Test
|
||||
public void testBukkit() {
|
||||
|
@ -162,7 +162,7 @@ index 5818bfa69a8573a2a8f350066f829d587cbc546b..8e421a1bee0c526e3024eab9ba4cc0b3
|
|||
|
||||
assertNotNull(nms, "NMS gene null for " + gene);
|
||||
assertEquals(gene.isRecessive(), nms.isRecessive(), "Recessive status did not match " + gene);
|
||||
@@ -21,7 +20,7 @@ public class PandaGeneTest {
|
||||
@@ -23,7 +22,7 @@ public class PandaGeneTest {
|
||||
|
||||
@Test
|
||||
public void testNMS() {
|
||||
|
@ -172,10 +172,10 @@ index 5818bfa69a8573a2a8f350066f829d587cbc546b..8e421a1bee0c526e3024eab9ba4cc0b3
|
|||
|
||||
assertNotNull(bukkit, "Bukkit gene null for " + gene);
|
||||
diff --git a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
|
||||
index 6c84f1289c84d0aca1935c473ffa63dae1b52598..ebcb65cb74acdb9d1bcf2b4b3551a2dc6d809bc9 100644
|
||||
index a382ca7c6e0f96e5d8be37fa8139360db13f9c2f..8fb906c77070eedec8cde263154eaf4610ad3197 100644
|
||||
--- a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
|
||||
+++ b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
|
||||
@@ -29,17 +29,17 @@ public class RegistryConstantsTest extends AbstractTestingBase {
|
||||
@@ -31,17 +31,17 @@ public class RegistryConstantsTest {
|
||||
|
||||
@Test
|
||||
public void testTrimMaterial() {
|
||||
|
@ -197,10 +197,10 @@ index 6c84f1289c84d0aca1935c473ffa63dae1b52598..ebcb65cb74acdb9d1bcf2b4b3551a2dc
|
|||
|
||||
for (Field field : clazz.getFields()) {
|
||||
diff --git a/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java b/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java
|
||||
index 31062b6d9ad685ea3750c6b5ddc6b295bb263e0a..5842cb5a6f3da42b8c40e6cbd5c5366572bf7684 100644
|
||||
index 52f057a3b81ae798a8ff354a90e2cc64264c0398..0c704fb9e73229f5632f1f48e59fccc0daf9ec26 100644
|
||||
--- a/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java
|
||||
+++ b/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java
|
||||
@@ -24,7 +24,7 @@ public class RegistryLoadOrderTest extends AbstractTestingBase {
|
||||
@@ -25,7 +25,7 @@ public class RegistryLoadOrderTest {
|
||||
|
||||
private static boolean initInterface = false;
|
||||
private static boolean initAbstract = false;
|
||||
|
|
|
@ -9,7 +9,7 @@ public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/
|
|||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 9ea079d14a92367629dc8fb30d1be043c9290964..f276414e9e81abf8f1f80991ebd5ab43472e07b1 100644
|
||||
index 82b298d454dee6a6d996aa7822dd745e70a8da74..ef88afa5fe914ae3fef9ffb1a971dabf568f75f3 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -8,9 +8,7 @@ plugins {
|
||||
|
@ -20,10 +20,10 @@ index 9ea079d14a92367629dc8fb30d1be043c9290964..f276414e9e81abf8f1f80991ebd5ab43
|
|||
- exclude(group = "org.apache.logging.log4j", module = "log4j-api")
|
||||
- }
|
||||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm-commons:9.7")
|
||||
implementation("org.ow2.asm:asm-commons:9.7.1")
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0")
|
||||
@@ -38,6 +36,7 @@ tasks.jar {
|
||||
@@ -39,6 +37,7 @@ tasks.jar {
|
||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||
|
@ -31,7 +31,7 @@ index 9ea079d14a92367629dc8fb30d1be043c9290964..f276414e9e81abf8f1f80991ebd5ab43
|
|||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
"Implementation-Title" to "CraftBukkit",
|
||||
@@ -46,6 +45,9 @@ tasks.jar {
|
||||
@@ -47,6 +46,9 @@ tasks.jar {
|
||||
"Specification-Title" to "Bukkit",
|
||||
"Specification-Version" to project.version,
|
||||
"Specification-Vendor" to "Bukkit Team",
|
||||
|
@ -41,7 +41,7 @@ index 9ea079d14a92367629dc8fb30d1be043c9290964..f276414e9e81abf8f1f80991ebd5ab43
|
|||
)
|
||||
for (tld in setOf("net", "com", "org")) {
|
||||
attributes("$tld/bukkit", "Sealed" to true)
|
||||
@@ -58,6 +60,17 @@ publishing {
|
||||
@@ -59,6 +61,17 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,9 +57,9 @@ index 9ea079d14a92367629dc8fb30d1be043c9290964..f276414e9e81abf8f1f80991ebd5ab43
|
|||
+// Paper end
|
||||
+
|
||||
tasks.test {
|
||||
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
|
||||
useJUnitPlatform()
|
||||
@@ -123,4 +136,5 @@ tasks.registerRunTask("runReobf") {
|
||||
include("**/**TestSuite.class")
|
||||
workingDir = temporaryDir
|
||||
@@ -128,4 +141,5 @@ tasks.registerRunTask("runReobf") {
|
||||
tasks.registerRunTask("runDev") {
|
||||
description = "Spin up a non-relocated Mojang-mapped test server"
|
||||
classpath(sourceSets.main.map { it.runtimeClasspath })
|
||||
|
@ -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 9bae4835882a7c1b5a623d57330c36cc61b9b6d1..273a6658deacbf00f6cc498cf3fcd20d144bd9e4 100644
|
||||
index dd64f5c16560d2ce6255c8319ddd0f5157237f0f..4566237fa1d49a559b2df806f9a318be46a6eade 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 9bae4835882a7c1b5a623d57330c36cc61b9b6d1..273a6658deacbf00f6cc498cf3fcd20d
|
|||
+ 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, -14);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -28);
|
||||
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
|
||||
|
@ -171,15 +171,15 @@ index 0000000000000000000000000000000000000000..288fbe68c6053f40e72f0feedef0ae0f
|
|||
+ "pack_format": 41
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
index 1bdf0b2b8f8e6dace403695fece80ebb3dc9e039..544307fe34cbcfa286a7d7b30900ebea127d189e 100644
|
||||
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
@@ -43,6 +43,7 @@ public abstract class AbstractTestingBase {
|
||||
public static final Registry<Biome> BIOMES;
|
||||
diff --git a/src/test/java/org/bukkit/support/RegistryHelper.java b/src/test/java/org/bukkit/support/RegistryHelper.java
|
||||
index e5dbcdcbd4187c724c3c6a3b8141a3796710c7a8..73645ea2e5c17e973ed3b888aab56f733f9c87a3 100644
|
||||
--- a/src/test/java/org/bukkit/support/RegistryHelper.java
|
||||
+++ b/src/test/java/org/bukkit/support/RegistryHelper.java
|
||||
@@ -58,6 +58,7 @@ public final class RegistryHelper {
|
||||
}
|
||||
|
||||
static {
|
||||
+ System.setProperty("Paper.pushPaperAssetsRoot", "true"); // Paper
|
||||
public static void setup(FeatureFlagSet featureFlagSet) {
|
||||
+ System.setProperty("Paper.pushPaperAssetsRoot", "true"); // Paper - build system changes - push asset root
|
||||
SharedConstants.tryDetectVersion();
|
||||
Bootstrap.bootStrap();
|
||||
// Populate available packs
|
||||
|
||||
|
|
|
@ -6,18 +6,18 @@ Subject: [PATCH] Test changes
|
|||
Co-authored-by: yannnicklamprecht <yannicklamprecht@live.de>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index f276414e9e81abf8f1f80991ebd5ab43472e07b1..7a0f2391a464eeebc5e57856300bc000b8d35e52 100644
|
||||
index ef88afa5fe914ae3fef9ffb1a971dabf568f75f3..3c1770864ab3e8708bab6cd50d6ffb5e19af5399 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -22,6 +22,7 @@ dependencies {
|
||||
@@ -23,6 +23,7 @@ dependencies {
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
testImplementation("org.mockito:mockito-core:5.11.0")
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7")
|
||||
testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7.1")
|
||||
+ testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||
}
|
||||
|
||||
paperweight {
|
||||
@@ -55,6 +56,12 @@ tasks.jar {
|
||||
@@ -56,6 +57,12 @@ tasks.jar {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,10 @@ index f276414e9e81abf8f1f80991ebd5ab43472e07b1..7a0f2391a464eeebc5e57856300bc000
|
|||
}
|
||||
diff --git a/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java b/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e1c14886064cde56be7fcd8f22a6ecb2d222a762
|
||||
index 0000000000000000000000000000000000000000..fe52d229c31526cc32f6422328efe92edf75a7ff
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java
|
||||
@@ -0,0 +1,33 @@
|
||||
@@ -0,0 +1,34 @@
|
||||
+package io.papermc.paper.registry;
|
||||
+
|
||||
+import java.util.Optional;
|
||||
|
@ -50,7 +50,8 @@ index 0000000000000000000000000000000000000000..e1c14886064cde56be7fcd8f22a6ecb2
|
|||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
+
|
||||
+class RegistryKeyTest extends AbstractTestingBase {
|
||||
+@AllFeatures
|
||||
+class RegistryKeyTest {
|
||||
+
|
||||
+ @BeforeAll
|
||||
+ static void before() throws ClassNotFoundException {
|
||||
|
@ -64,7 +65,7 @@ index 0000000000000000000000000000000000000000..e1c14886064cde56be7fcd8f22a6ecb2
|
|||
+ @ParameterizedTest
|
||||
+ @MethodSource("data")
|
||||
+ void testApiRegistryKeysExist(final RegistryKey<?> key) {
|
||||
+ final Optional<Registry<Object>> registry = AbstractTestingBase.REGISTRY_CUSTOM.registry(ResourceKey.createRegistryKey(ResourceLocation.parse(key.key().asString())));
|
||||
+ final Optional<Registry<Object>> registry = RegistryHelper.getRegistry().registry(ResourceKey.createRegistryKey(ResourceLocation.parse(key.key().asString())));
|
||||
+ assertTrue(registry.isPresent(), "Missing vanilla registry for " + key.key().asString());
|
||||
+
|
||||
+ }
|
||||
|
@ -338,11 +339,35 @@ index 0000000000000000000000000000000000000000..6cbf11c898439834cffb99ef84e5df14
|
|||
+public @interface MethodParameterSource {
|
||||
+ String[] value() default {};
|
||||
+}
|
||||
diff --git a/src/test/java/org/bukkit/ExplosionResultTest.java b/src/test/java/org/bukkit/ExplosionResultTest.java
|
||||
index ee5ab15bb0bfeb0ff6fa0d720eeff086d92cb459..7419ea2f68607aad27929a608c402bd4c222f95d 100644
|
||||
--- a/src/test/java/org/bukkit/ExplosionResultTest.java
|
||||
+++ b/src/test/java/org/bukkit/ExplosionResultTest.java
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.world.level.Explosion;
|
||||
import org.bukkit.craftbukkit.CraftExplosionResult;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+@org.bukkit.support.environment.Normal // Paper - test changes - missing test suite annotation
|
||||
public class ExplosionResultTest {
|
||||
|
||||
@Test
|
||||
diff --git a/src/test/java/org/bukkit/registry/RegistryClassTest.java b/src/test/java/org/bukkit/registry/RegistryClassTest.java
|
||||
index 740073ddd99b5e6aba056b99d5ed3e2a94a13b6c..575a06125e0b60b5bb8b6f85131f7d6cf86f5083 100644
|
||||
--- a/src/test/java/org/bukkit/registry/RegistryClassTest.java
|
||||
+++ b/src/test/java/org/bukkit/registry/RegistryClassTest.java
|
||||
@@ -57,6 +57,7 @@ import org.objectweb.asm.Type;
|
||||
* Note: This test class assumes that feature flags only enable more features and do not disable vanilla ones.
|
||||
*/
|
||||
@AllFeatures
|
||||
+@org.junit.jupiter.api.Disabled // Paper - disabled for now as it constructs a second root registry, which is not supported on paper
|
||||
public class RegistryClassTest {
|
||||
|
||||
private static final Map<Class<? extends Keyed>, Data> INIT_DATA = new HashMap<>();
|
||||
diff --git a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
|
||||
index ebcb65cb74acdb9d1bcf2b4b3551a2dc6d809bc9..7d9dbed7281099b78d7f898885b37cdcfe8b099f 100644
|
||||
index 8fb906c77070eedec8cde263154eaf4610ad3197..8705ee2a28d5dba7bb579eae1436451502e1e3c2 100644
|
||||
--- a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
|
||||
+++ b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
|
||||
@@ -24,7 +24,7 @@ public class RegistryConstantsTest extends AbstractTestingBase {
|
||||
@@ -26,7 +26,7 @@ public class RegistryConstantsTest {
|
||||
@Test
|
||||
public void testDamageType() {
|
||||
this.testExcessConstants(DamageType.class, Registry.DAMAGE_TYPE);
|
||||
|
@ -351,68 +376,67 @@ index ebcb65cb74acdb9d1bcf2b4b3551a2dc6d809bc9..7d9dbed7281099b78d7f898885b37cdc
|
|||
}
|
||||
|
||||
@Test
|
||||
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
index 544307fe34cbcfa286a7d7b30900ebea127d189e..5bda0bc976920f224586f2c0e083b771c676e307 100644
|
||||
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
@@ -53,6 +53,11 @@ public abstract class AbstractTestingBase {
|
||||
MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList());
|
||||
diff --git a/src/test/java/org/bukkit/support/DummyServerHelper.java b/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
index 6ecafd167d4d8c79f2cbc43ea9da98a5d61d8751..f81f86cf05a8c6816d356185af6d0d84a0474dd2 100644
|
||||
--- a/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
+++ b/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
@@ -47,7 +47,7 @@ public final class DummyServerHelper {
|
||||
when(instance.getTag(any(), any(), any())).then(mock -> {
|
||||
String registry = mock.getArgument(0);
|
||||
Class<?> clazz = mock.getArgument(2);
|
||||
- MinecraftKey key = CraftNamespacedKey.toMinecraft(mock.getArgument(1));
|
||||
+ net.minecraft.resources.ResourceLocation key = CraftNamespacedKey.toMinecraft(mock.getArgument(1)); // Paper - address remapping issues
|
||||
|
||||
switch (registry) {
|
||||
case org.bukkit.Tag.REGISTRY_BLOCKS -> {
|
||||
@@ -66,24 +66,31 @@ public final class DummyServerHelper {
|
||||
}
|
||||
case org.bukkit.Tag.REGISTRY_FLUIDS -> {
|
||||
Preconditions.checkArgument(clazz == org.bukkit.Fluid.class, "Fluid namespace must have fluid type");
|
||||
- TagKey<FluidType> fluidTagKey = TagKey.create(Registries.FLUID, key);
|
||||
+ TagKey<net.minecraft.world.level.material.Fluid> fluidTagKey = TagKey.create(Registries.FLUID, key); // Paper - address remapping issues
|
||||
if (BuiltInRegistries.FLUID.getTag(fluidTagKey).isPresent()) {
|
||||
return new CraftFluidTag(BuiltInRegistries.FLUID, fluidTagKey);
|
||||
}
|
||||
}
|
||||
case org.bukkit.Tag.REGISTRY_ENTITY_TYPES -> {
|
||||
Preconditions.checkArgument(clazz == org.bukkit.entity.EntityType.class, "Entity type namespace must have entity type");
|
||||
- TagKey<EntityTypes<?>> entityTagKey = TagKey.create(Registries.ENTITY_TYPE, key);
|
||||
+ TagKey<net.minecraft.world.entity.EntityType<?>> entityTagKey = TagKey.create(Registries.ENTITY_TYPE, key); // Paper - address remapping issues
|
||||
if (BuiltInRegistries.ENTITY_TYPE.getTag(entityTagKey).isPresent()) {
|
||||
return new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey);
|
||||
}
|
||||
}
|
||||
- default -> throw new IllegalArgumentException();
|
||||
+ default -> new io.papermc.paper.util.EmptyTag(); // Paper - testing additions
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
+ // Paper start - testing additions
|
||||
+ final Thread currentThread = Thread.currentThread();
|
||||
+ when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
|
||||
+ final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance));
|
||||
+ when(instance.getPluginManager()).thenReturn(pluginManager);
|
||||
+ // Paper end - testing additions
|
||||
+
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/support/RegistryHelper.java b/src/test/java/org/bukkit/support/RegistryHelper.java
|
||||
index 73645ea2e5c17e973ed3b888aab56f733f9c87a3..4d169ff3541044d447de519d2b0973da98b0bd53 100644
|
||||
--- a/src/test/java/org/bukkit/support/RegistryHelper.java
|
||||
+++ b/src/test/java/org/bukkit/support/RegistryHelper.java
|
||||
@@ -98,6 +98,11 @@ public final class RegistryHelper {
|
||||
private static LayeredRegistryAccess<RegistryLayer> createLayers(MultiPackResourceManager resourceManager) {
|
||||
// add tags and loot tables for unit tests
|
||||
LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
|
||||
+ // Paper start - load registry here to ensure bukkit object registry are correctly delayed if needed
|
||||
+ try {
|
||||
+ Class.forName("org.bukkit.Registry");
|
||||
+ } catch (ClassNotFoundException ignored) {}
|
||||
+ } catch (final ClassNotFoundException ignored) {}
|
||||
+ // Paper end - load registry here to ensure bukkit object registry are correctly delayed if needed
|
||||
layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES);
|
||||
REGISTRY_CUSTOM = layers.compositeAccess().freeze();
|
||||
// Register vanilla pack
|
||||
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
|
||||
index 1acdf5bc439c073c1777c2c4f5743ae082f4a621..183d30e3d3d413b05c762f374a964498d6ffdec4 100644
|
||||
--- a/src/test/java/org/bukkit/support/DummyServer.java
|
||||
+++ b/src/test/java/org/bukkit/support/DummyServer.java
|
||||
@@ -62,7 +62,7 @@ public final class DummyServer {
|
||||
when(instance.getTag(any(), any(), any())).then(mock -> {
|
||||
String registry = mock.getArgument(0);
|
||||
Class<?> clazz = mock.getArgument(2);
|
||||
- MinecraftKey key = CraftNamespacedKey.toMinecraft(mock.getArgument(1));
|
||||
+ net.minecraft.resources.ResourceLocation key = CraftNamespacedKey.toMinecraft(mock.getArgument(1)); // Paper - address remapping issues
|
||||
|
||||
switch (registry) {
|
||||
case org.bukkit.Tag.REGISTRY_BLOCKS -> {
|
||||
@@ -81,24 +81,32 @@ public final class DummyServer {
|
||||
}
|
||||
case org.bukkit.Tag.REGISTRY_FLUIDS -> {
|
||||
Preconditions.checkArgument(clazz == org.bukkit.Fluid.class, "Fluid namespace must have fluid type");
|
||||
- TagKey<FluidType> fluidTagKey = TagKey.create(Registries.FLUID, key);
|
||||
+ TagKey<net.minecraft.world.level.material.Fluid> fluidTagKey = TagKey.create(Registries.FLUID, key); // Paper - address remapping issues
|
||||
if (BuiltInRegistries.FLUID.getTag(fluidTagKey).isPresent()) {
|
||||
return new CraftFluidTag(BuiltInRegistries.FLUID, fluidTagKey);
|
||||
}
|
||||
}
|
||||
case org.bukkit.Tag.REGISTRY_ENTITY_TYPES -> {
|
||||
Preconditions.checkArgument(clazz == org.bukkit.entity.EntityType.class, "Entity type namespace must have entity type");
|
||||
- TagKey<EntityTypes<?>> entityTagKey = TagKey.create(Registries.ENTITY_TYPE, key);
|
||||
+ TagKey<net.minecraft.world.entity.EntityType<?>> entityTagKey = TagKey.create(Registries.ENTITY_TYPE, key); // Paper - address remapping issues
|
||||
if (BuiltInRegistries.ENTITY_TYPE.getTag(entityTagKey).isPresent()) {
|
||||
return new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey);
|
||||
}
|
||||
}
|
||||
- default -> throw new IllegalArgumentException();
|
||||
+ default -> new io.papermc.paper.util.EmptyTag(); // Paper - testing additions
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
+ // Paper start - testing additions
|
||||
+ final Thread currentThread = Thread.currentThread();
|
||||
+ when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
|
||||
+
|
||||
+ final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance));
|
||||
+ when(instance.getPluginManager()).thenReturn(pluginManager);
|
||||
+ // paper end - testing additions
|
||||
+
|
||||
Bukkit.setServer(instance);
|
||||
} catch (Throwable t) {
|
||||
throw new Error(t);
|
||||
return layers;
|
||||
|
|
|
@ -15,13 +15,13 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine
|
|||
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 7a0f2391a464eeebc5e57856300bc000b8d35e52..94dfc105b197c9eda481cbe90bb48b71c845e702 100644
|
||||
index 2233e51bfab4ac36977984e8fe7fddb04120dddd..7f7b7f0b29107375b2438e3af0bc0f40390db4fa 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -10,6 +10,7 @@ dependencies {
|
||||
implementation("jline:jline:2.12.1")
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm-commons:9.7")
|
||||
implementation("org.ow2.asm:asm-commons:9.7.1")
|
||||
+ implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0")
|
||||
|
@ -5226,10 +5226,10 @@ index e433037a03ffafabb952887ae3980e1d51411d4c..c061813d275fbc48d7629cc59d90dbb4
|
|||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 10f07a6eff8f738cefef11829dd774874259b8f4..4c5b6f8d63e4c60a1dc81e68117fa049b956819a 100644
|
||||
index 357c948dd66644497583996f211f25cbe5c78828..d0c41302478bd9b0ec65020e7ef520bd3ff1f347 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -962,6 +962,7 @@ public final class CraftServer implements Server {
|
||||
@@ -964,6 +964,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
|
@ -5238,7 +5238,7 @@ index 10f07a6eff8f738cefef11829dd774874259b8f4..4c5b6f8d63e4c60a1dc81e68117fa049
|
|||
world.serverLevelData.setDifficulty(config.difficulty);
|
||||
world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 273a6658deacbf00f6cc498cf3fcd20d144bd9e4..cf06abf508fab734f5945e1d292c01512a50749e 100644
|
||||
index 4566237fa1d49a559b2df806f9a318be46a6eade..0ea2d13ab80559472513c6df362583b8371a9532 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -142,6 +142,19 @@ public class Main {
|
||||
|
@ -5362,15 +5362,15 @@ index 0000000000000000000000000000000000000000..0396589795da1f83ddf62426236dde9a
|
|||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
index 5bda0bc976920f224586f2c0e083b771c676e307..4e9612600822bc1b52b8528dff2783d43385ec73 100644
|
||||
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
@@ -68,6 +68,7 @@ public abstract class AbstractTestingBase {
|
||||
BIOMES = REGISTRY_CUSTOM.registryOrThrow(Registries.BIOME);
|
||||
|
||||
DummyServer.setup();
|
||||
+ io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper
|
||||
|
||||
CraftRegistry.setMinecraftRegistry(REGISTRY_CUSTOM);
|
||||
diff --git a/src/test/java/org/bukkit/support/DummyServerHelper.java b/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
index f81f86cf05a8c6816d356185af6d0d84a0474dd2..ba0a2ab9de34fa40dd90cecaeec4a5e54fe3e2d8 100644
|
||||
--- a/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
+++ b/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
@@ -91,6 +91,7 @@ public final class DummyServerHelper {
|
||||
when(instance.getPluginManager()).thenReturn(pluginManager);
|
||||
// Paper end - testing additions
|
||||
|
||||
+ io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper - configuration files - setup global configuration test base
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ index 85c7f3027978b1d7d6c31b7ad21b3377cdda5925..e34deaf398dc6722c3128bdd6b9bc16d
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index cf06abf508fab734f5945e1d292c01512a50749e..42a1a0588e2b506082499ac9791d039089a64631 100644
|
||||
index 0ea2d13ab80559472513c6df362583b8371a9532..13c37384defda4475de584f33d1860a2d53ce05e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -123,6 +123,7 @@ public class Main {
|
||||
|
@ -115,10 +115,10 @@ index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..c017ce2ca1bc535795c958a2e509af2a
|
|||
public class CraftScheduler implements BukkitScheduler {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index b0cc506f1b3eb53e8e2299787071de707a036df0..eeffc4be4ae7168c9f69edbbff6642fd4c214b3d 100644
|
||||
index a0f228ee83fd3a913666f88381c946f8a6340644..60dc550431fa4641f8c6d964329b0e2698d1fdd6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -240,7 +240,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -246,7 +246,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
try {
|
||||
nmsStack.applyComponents(new ItemParser(Commands.createValidationContext(MinecraftServer.getDefaultRegistryAccess())).parse(new StringReader(arguments)).components());
|
||||
} catch (CommandSyntaxException ex) {
|
||||
|
|
|
@ -4438,7 +4438,7 @@ index 40adb6117b9e0d5f70103113202a07715e403e2a..c9cab509796599b13ca3422de1049aed
|
|||
long j = Util.getNanos() - i;
|
||||
int k = this.tickCount % 100;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index f40a2f348c45a29168ca3d4eef07b5b628060bee..9a009a688c02e990723917766c51e1c0e71e338d 100644
|
||||
index 814e7fdf6c089b920825effaeeb0675695b2f3fa..43513325b7052d388a63d63bd3a4edff48cf23c2 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -37,9 +37,9 @@ public class ChunkHolder extends GenerationChunkHolder {
|
||||
|
@ -4463,7 +4463,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..9a009a688c02e990723917766c51e1c0
|
|||
return (LevelChunk) ((ChunkResult) this.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).orElse(null); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
@@ -337,12 +337,28 @@ public class ChunkHolder extends GenerationChunkHolder {
|
||||
@@ -345,12 +345,28 @@ public class ChunkHolder extends GenerationChunkHolder {
|
||||
|
||||
this.wasAccessibleSinceLastSave |= flag1;
|
||||
if (!flag && flag1) {
|
||||
|
@ -4492,7 +4492,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..9a009a688c02e990723917766c51e1c0
|
|||
this.fullChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK);
|
||||
this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||
}
|
||||
@@ -353,11 +369,25 @@ public class ChunkHolder extends GenerationChunkHolder {
|
||||
@@ -361,11 +377,25 @@ public class ChunkHolder extends GenerationChunkHolder {
|
||||
if (!flag2 && flag3) {
|
||||
this.tickingChunkFuture = chunkLoadingManager.prepareTickingChunk(this);
|
||||
this.scheduleFullChunkPromotion(chunkLoadingManager, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING);
|
||||
|
@ -4519,7 +4519,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..9a009a688c02e990723917766c51e1c0
|
|||
this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||
}
|
||||
|
||||
@@ -371,11 +401,24 @@ public class ChunkHolder extends GenerationChunkHolder {
|
||||
@@ -379,11 +409,24 @@ public class ChunkHolder extends GenerationChunkHolder {
|
||||
|
||||
this.entityTickingChunkFuture = chunkLoadingManager.prepareEntityTickingChunk(this);
|
||||
this.scheduleFullChunkPromotion(chunkLoadingManager, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING);
|
||||
|
@ -4719,10 +4719,10 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..449608e60f3900778247101581ff598f
|
|||
protected ChunkDistanceManager(final Executor workerExecutor, final Executor mainThreadExecutor) {
|
||||
super(workerExecutor, mainThreadExecutor);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
index b6cc33943fe7e4667944f3e6f868b3033ea9ca18..3d46412b307f08968bb9b96c0649e0405813462e 100644
|
||||
index d3769ad50ddb556cff515ea8cf853d28e490ca94..dfa0456f352ce25bc4edd1b0f04ca5a14434d7fa 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
@@ -365,7 +365,7 @@ public abstract class DistanceManager {
|
||||
@@ -370,7 +370,7 @@ public abstract class DistanceManager {
|
||||
}
|
||||
|
||||
public void removeTicketsOnClosing() {
|
||||
|
@ -5048,7 +5048,7 @@ index c1db114edd9e31273b76374cbd19710b01cada2b..26064174397dc95f9b117d901e22c55a
|
|||
@Override
|
||||
public float getBukkitYaw() {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 5fa5c6fa8c143e1aa1dacc7a6b63b11ad4b074ec..5025f7f5d66f2aedd57db137ae2dc69c723768b3 100644
|
||||
index 3e00b12d166c5a6a82e61574bfefd5973ffcbb59..142d762750b9745428ae27802f7a428147a74771 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -953,6 +953,25 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
@ -5547,10 +5547,10 @@ index 34933c5324126f9afdc5cba9dea997ace8f01806..1cfc906317f07a44f06a4adf021c44e3
|
|||
return false;
|
||||
} else {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 4c5b6f8d63e4c60a1dc81e68117fa049b956819a..958925a980f50cc85b10d36bcc343947cec8f285 100644
|
||||
index d0c41302478bd9b0ec65020e7ef520bd3ff1f347..99178e22846c41f1d800b69d4fed064088bbe92c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2598,4 +2598,9 @@ public final class CraftServer implements Server {
|
||||
@@ -2600,4 +2600,9 @@ public final class CraftServer implements Server {
|
||||
return this.spigot;
|
||||
}
|
||||
// Spigot end
|
||||
|
@ -5561,7 +5561,7 @@ index 4c5b6f8d63e4c60a1dc81e68117fa049b956819a..958925a980f50cc85b10d36bcc343947
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 508419378c88ba8688edbd5142d9d8ba52396507..69c62699e3412f2730e3db65f196099d77698980 100644
|
||||
index 07012c01e1d8eacf37b8a86a5e4e56fb0d81c989..ac6d4c8ac26696a0c6dfa471eee764b871dd2029 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -252,8 +252,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
|
|
@ -3242,7 +3242,7 @@ index ed54c81a3269360acce674aa4e1d54ccb2461841..c9c849534c3998cfcab7ddcb12a71ccb
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 5025f7f5d66f2aedd57db137ae2dc69c723768b3..1cc9078fa63da4f39ef4a551cd6a5ff207f58306 100644
|
||||
index 142d762750b9745428ae27802f7a428147a74771..d0c946b0383dbd8242a554a92bc70dcc2f5cccc6 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -183,7 +183,15 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
@ -3327,10 +3327,10 @@ index 49c037e961c5ca5ba8d6a870cb32ffe8719adc91..2772c19f58a35713d61aab24f6f0d6f5
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c54d426cb 100644
|
||||
index 99178e22846c41f1d800b69d4fed064088bbe92c..9f7634053ddfc4fc67f89cc99524e9ebd6096f46 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -644,8 +644,10 @@ public final class CraftServer implements Server {
|
||||
@@ -645,8 +645,10 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3341,7 +3341,7 @@ index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1621,7 +1623,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1623,7 +1625,15 @@ public final class CraftServer implements Server {
|
||||
return this.configuration.getInt("settings.spawn-radius", -1);
|
||||
}
|
||||
|
||||
|
@ -3357,7 +3357,7 @@ index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c
|
|||
public String getShutdownMessage() {
|
||||
return this.configuration.getString("settings.shutdown-message");
|
||||
}
|
||||
@@ -1795,7 +1805,20 @@ public final class CraftServer implements Server {
|
||||
@@ -1797,7 +1807,20 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3378,7 +3378,7 @@ index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c
|
|||
Set<CommandSender> recipients = new HashSet<>();
|
||||
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
|
||||
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
|
||||
@@ -1803,14 +1826,14 @@ public final class CraftServer implements Server {
|
||||
@@ -1805,14 +1828,14 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3395,7 +3395,7 @@ index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c
|
|||
|
||||
for (CommandSender recipient : recipients) {
|
||||
recipient.sendMessage(message);
|
||||
@@ -2072,6 +2095,14 @@ public final class CraftServer implements Server {
|
||||
@@ -2074,6 +2097,14 @@ public final class CraftServer implements Server {
|
||||
return CraftInventoryCreator.INSTANCE.createInventory(owner, type);
|
||||
}
|
||||
|
||||
|
@ -3410,7 +3410,7 @@ index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c
|
|||
@Override
|
||||
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
|
||||
Preconditions.checkArgument(type != null, "InventoryType cannot be null");
|
||||
@@ -2086,13 +2117,28 @@ public final class CraftServer implements Server {
|
||||
@@ -2088,13 +2119,28 @@ public final class CraftServer implements Server {
|
||||
return CraftInventoryCreator.INSTANCE.createInventory(owner, size);
|
||||
}
|
||||
|
||||
|
@ -3439,7 +3439,7 @@ index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c
|
|||
public Merchant createMerchant(String title) {
|
||||
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
|
||||
}
|
||||
@@ -2157,6 +2203,17 @@ public final class CraftServer implements Server {
|
||||
@@ -2159,6 +2205,17 @@ public final class CraftServer implements Server {
|
||||
return Thread.currentThread().equals(this.console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
|
||||
}
|
||||
|
||||
|
@ -3457,7 +3457,7 @@ index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c
|
|||
@Override
|
||||
public String getMotd() {
|
||||
return this.console.getMotd();
|
||||
@@ -2603,4 +2660,57 @@ public final class CraftServer implements Server {
|
||||
@@ -2605,4 +2662,57 @@ public final class CraftServer implements Server {
|
||||
public double[] getTPS() {
|
||||
return new double[]{0, 0, 0}; // TODO
|
||||
}
|
||||
|
@ -3554,7 +3554,7 @@ index cbdb1a56a97150c164515a4ce6d3ba06428bf321..b214e7b302abbfe1641485a05f1371ac
|
|||
public URI getUrl() {
|
||||
return this.handle.link();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 69c62699e3412f2730e3db65f196099d77698980..4878a1b085a83dd4a8ffdc86250b8fb4fbac5192 100644
|
||||
index ac6d4c8ac26696a0c6dfa471eee764b871dd2029..85c99c3b23df1c4fd8721e7676d8e6b82f9e6abf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -162,6 +162,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
@ -3628,7 +3628,7 @@ index 69c62699e3412f2730e3db65f196099d77698980..4878a1b085a83dd4a8ffdc86250b8fb4
|
|||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 42a1a0588e2b506082499ac9791d039089a64631..9c1fab8db74757e1fb57d4f47099ba6e1536cd6d 100644
|
||||
index 13c37384defda4475de584f33d1860a2d53ce05e..3b0370256b4d8c96053b340a657c6bcc6be6c9de 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -20,6 +20,12 @@ public class Main {
|
||||
|
@ -4803,10 +4803,10 @@ index c9cc23757a9fcc58d30b2915d4c5cfbc7d1c767a..fc0e1212022d1aa3506699b60ef33819
|
|||
return this.title;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
|
||||
index 07d406de7123593dc470af2723f2a9a2dc2157b0..01fbd8a55866af3e371c8a2eef23ef6e9ca3226d 100644
|
||||
index d89b178dc82c7e2ad6d586217c5a039688563e29..d674289b07748022b94cc6a7e6c6eb456d245c93 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
|
||||
@@ -73,6 +73,13 @@ public class CraftInventoryView<T extends AbstractContainerMenu> extends CraftAb
|
||||
@@ -73,6 +73,13 @@ public class CraftInventoryView<T extends AbstractContainerMenu, I extends Inven
|
||||
return CraftItemStack.asCraftMirror(this.container.getSlot(slot).getItem());
|
||||
}
|
||||
|
||||
|
@ -5191,11 +5191,11 @@ index c71a4971f127fdfc753306019313ce1a31201120..fd3b12477c30d1eabdbe57ea77902793
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 1c5d63fb6a9ed5cc40d735793cf5889e189feadf..568d6fab743039b20715d8181555f52baa05f0f3 100644
|
||||
index 8bba749bce211814f51af8a33f2ed60ba7a8b52d..0c73854243f7fa21d1ffdb3b4c85ee0a69c9c5e4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -959,6 +959,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return !(this.hasDisplayName() || this.hasItemName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.build().isEmpty() || !this.removedTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isHideTooltip() || this.isUnbreakable() || this.hasEnchantmentGlintOverride() || this.isFireResistant() || this.hasMaxStackSize() || this.hasRarity() || this.hasFood() || this.hasTool() || this.hasDamage() || this.hasMaxDamage() || this.hasAttributeModifiers() || this.customTag != null);
|
||||
@@ -961,6 +961,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return !(this.hasDisplayName() || this.hasItemName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.build().isEmpty() || !this.removedTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isHideTooltip() || this.isUnbreakable() || this.hasEnchantmentGlintOverride() || this.isFireResistant() || this.hasMaxStackSize() || this.hasRarity() || this.hasFood() || this.hasTool() || this.hasJukeboxPlayable() || this.hasDamage() || this.hasMaxDamage() || this.hasAttributeModifiers() || this.customTag != null);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
@ -5213,7 +5213,7 @@ index 1c5d63fb6a9ed5cc40d735793cf5889e189feadf..568d6fab743039b20715d8181555f52b
|
|||
@Override
|
||||
public String getDisplayName() {
|
||||
return CraftChatMessage.fromComponent(this.displayName);
|
||||
@@ -989,6 +1001,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -991,6 +1003,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return this.itemName != null;
|
||||
}
|
||||
|
||||
|
@ -5232,7 +5232,7 @@ index 1c5d63fb6a9ed5cc40d735793cf5889e189feadf..568d6fab743039b20715d8181555f52b
|
|||
@Override
|
||||
public String getLocalizedName() {
|
||||
return this.getDisplayName();
|
||||
@@ -1008,6 +1032,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1010,6 +1034,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return this.lore != null && !this.lore.isEmpty();
|
||||
}
|
||||
|
||||
|
@ -5624,10 +5624,10 @@ index ff040613083c015d9c52c0995591b64305fd5018..95444fd9fecc5bda5462ca8dfeca82c5
|
|||
|
||||
boolean hadFormat = false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index eeffc4be4ae7168c9f69edbbff6642fd4c214b3d..b64be3f292d88fa60746a3fe542740ef8ad2b41c 100644
|
||||
index 60dc550431fa4641f8c6d964329b0e2698d1fdd6..655ceaa92b9979fe29725f9812507731bb0bb484 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -77,6 +77,43 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -79,6 +79,43 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
private CraftMagicNumbers() {}
|
||||
|
||||
|
@ -5783,10 +5783,10 @@ index 0000000000000000000000000000000000000000..3aedd0bbc97edacc1ebf71264b310e55
|
|||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/adventure/AdventureCodecsTest.java b/src/test/java/io/papermc/paper/adventure/AdventureCodecsTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..69b3aa957161e75d6344e437a8b4a4533ef00523
|
||||
index 0000000000000000000000000000000000000000..074e46aa4aca1a5154a0198279f60b38e05c1344
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/adventure/AdventureCodecsTest.java
|
||||
@@ -0,0 +1,403 @@
|
||||
@@ -0,0 +1,405 @@
|
||||
+package io.papermc.paper.adventure;
|
||||
+
|
||||
+import com.mojang.datafixers.util.Pair;
|
||||
|
@ -5828,7 +5828,8 @@ index 0000000000000000000000000000000000000000..69b3aa957161e75d6344e437a8b4a453
|
|||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.item.Items;
|
||||
+import org.apache.commons.lang3.RandomStringUtils;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.RegistryHelper;
|
||||
+import org.bukkit.support.environment.VanillaFeature;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+import org.junit.jupiter.params.ParameterizedTest;
|
||||
+import org.junit.jupiter.params.provider.EnumSource;
|
||||
|
@ -5863,7 +5864,8 @@ index 0000000000000000000000000000000000000000..69b3aa957161e75d6344e437a8b4a453
|
|||
+import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
+
|
||||
+class AdventureCodecsTest extends AbstractTestingBase {
|
||||
+@VanillaFeature
|
||||
+class AdventureCodecsTest {
|
||||
+
|
||||
+ static final String PARAMETERIZED_NAME = "[{index}] {displayName}: {arguments}";
|
||||
+
|
||||
|
@ -5995,7 +5997,7 @@ index 0000000000000000000000000000000000000000..69b3aa957161e75d6344e437a8b4a453
|
|||
+ JavaOps.INSTANCE,
|
||||
+ JsonOps.INSTANCE
|
||||
+ )
|
||||
+ .map(ops -> AbstractTestingBase.REGISTRY_CUSTOM.createSerializationContext(ops))
|
||||
+ .map(ops -> RegistryHelper.getRegistry().createSerializationContext(ops))
|
||||
+ .toList();
|
||||
+ }
|
||||
+
|
||||
|
@ -6192,20 +6194,22 @@ index 0000000000000000000000000000000000000000..69b3aa957161e75d6344e437a8b4a453
|
|||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/adventure/ComponentServicesTest.java b/src/test/java/io/papermc/paper/adventure/ComponentServicesTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..98114b8fdc441f2a1642abf230457c2b5208bb5c
|
||||
index 0000000000000000000000000000000000000000..6ec088c79e3d727bc7e89d1c14b001345feb1f39
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/adventure/ComponentServicesTest.java
|
||||
@@ -0,0 +1,23 @@
|
||||
@@ -0,0 +1,25 @@
|
||||
+package io.papermc.paper.adventure;
|
||||
+
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.format.NamedTextColor;
|
||||
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
+
|
||||
+@AllFeatures
|
||||
+public class ComponentServicesTest {
|
||||
+
|
||||
+ @Test
|
||||
|
|
|
@ -25,7 +25,7 @@ Other changes:
|
|||
Co-Authored-By: Emilia Kond <emilia@rymiel.space>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 94dfc105b197c9eda481cbe90bb48b71c845e702..0a05e753ff5e7b1d741c7719524715d7364cac4f 100644
|
||||
index c4572c0a6d9695088613d158838f236fe64efb48..83daf789efc4ce90ff54420e040b783569eb5cab 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -5,9 +5,29 @@ plugins {
|
||||
|
@ -57,9 +57,9 @@ index 94dfc105b197c9eda481cbe90bb48b71c845e702..0a05e753ff5e7b1d741c7719524715d7
|
|||
+ alsoShade(log4jPlugins.output)
|
||||
+ // Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm-commons:9.7")
|
||||
implementation("org.ow2.asm:asm-commons:9.7.1")
|
||||
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
||||
@@ -78,6 +98,19 @@ tasks.check {
|
||||
@@ -79,6 +99,19 @@ tasks.check {
|
||||
dependsOn(scanJar)
|
||||
}
|
||||
// Paper end
|
||||
|
@ -78,7 +78,7 @@ index 94dfc105b197c9eda481cbe90bb48b71c845e702..0a05e753ff5e7b1d741c7719524715d7
|
|||
+// Paper end - use TCA for console improvements
|
||||
|
||||
tasks.test {
|
||||
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
|
||||
include("**/**TestSuite.class")
|
||||
diff --git a/src/log4jPlugins/java/io/papermc/paper/console/StripANSIConverter.java b/src/log4jPlugins/java/io/papermc/paper/console/StripANSIConverter.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..91547f6e6fe90006713beb2818da634304bdd236
|
||||
|
@ -396,7 +396,7 @@ index e9109526880159e2341cc97b53939ba2bcfaeaf9..9dcfcea63f57f45a5584bb80c34fe445
|
|||
|
||||
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ee0fbba1ae29bb809303ccc09f64d48c54d426cb..c6cc48c955f052d8f98e3b28c80910b299467480 100644
|
||||
index 9f7634053ddfc4fc67f89cc99524e9ebd6096f46..752933ceabd7ebe7b1e9f7d41198128f6f2182a6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -43,7 +43,7 @@ import java.util.logging.Level;
|
||||
|
@ -408,7 +408,7 @@ index ee0fbba1ae29bb809303ccc09f64d48c54d426cb..c6cc48c955f052d8f98e3b28c80910b2
|
|||
import net.minecraft.advancements.AdvancementHolder;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
@@ -1354,9 +1354,13 @@ public final class CraftServer implements Server {
|
||||
@@ -1356,9 +1356,13 @@ public final class CraftServer implements Server {
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ index ee0fbba1ae29bb809303ccc09f64d48c54d426cb..c6cc48c955f052d8f98e3b28c80910b2
|
|||
@Override
|
||||
public PluginCommand getPluginCommand(String name) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 9c1fab8db74757e1fb57d4f47099ba6e1536cd6d..3eecea2e6df217ccf2c432d02022c53443a37014 100644
|
||||
index 3b0370256b4d8c96053b340a657c6bcc6be6c9de..bdb8e882ec1efbe5afec9ec5a5df57bf38d4ba2b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -13,7 +13,6 @@ import java.util.logging.Logger;
|
||||
|
|
|
@ -6,12 +6,12 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and
|
|||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 3bd5c2a2add9b462523beb9dfaf2eb5a00d470b9..a2bb659ae3a502d4c181d1ccbd15eefc38e4823b 100644
|
||||
index 7c81605648c6ba1360936faae25ef5fc11f0bcb4..4838ca75b9536ce5fd30906b51bdab86789668ec 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -45,6 +45,7 @@ dependencies {
|
||||
testImplementation("org.mockito:mockito-core:5.11.0")
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7")
|
||||
@@ -46,6 +46,7 @@ dependencies {
|
||||
testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7.1")
|
||||
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||
+ implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
|
||||
}
|
||||
|
|
|
@ -617,10 +617,10 @@ index bb59986c211f7d6ea50b1ad4bd5565227bec8a6c..9c950fc1de15b5039e34a9fdf893e97a
|
|||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index c6cc48c955f052d8f98e3b28c80910b299467480..3ef43c8d39f6012e0b8e98fd216b34a20449cca0 100644
|
||||
index 752933ceabd7ebe7b1e9f7d41198128f6f2182a6..492af80bc4a252ad3b82aef0c46c3e6625ec9146 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -986,6 +986,7 @@ public final class CraftServer implements Server {
|
||||
@@ -988,6 +988,7 @@ public final class CraftServer implements Server {
|
||||
this.commandMap.clearCommands();
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
|
@ -628,7 +628,7 @@ index c6cc48c955f052d8f98e3b28c80910b299467480..3ef43c8d39f6012e0b8e98fd216b34a2
|
|||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2708,6 +2709,34 @@ public final class CraftServer implements Server {
|
||||
@@ -2710,6 +2711,34 @@ public final class CraftServer implements Server {
|
||||
// Paper end
|
||||
|
||||
// Paper start
|
||||
|
|
|
@ -7257,7 +7257,7 @@ index 5b4ac7b4fd0077e900e9f788963f1613bbc9a5d0..6afede80c10503a261d0f735c351d943
|
|||
Bootstrap.validate();
|
||||
Util.startTimerHackThread();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 29f94e574e39714caec95af5c176c9dba481728e..b532c72ec2c048554e496b4b63afa0e9f9932416 100644
|
||||
index 492af80bc4a252ad3b82aef0c46c3e6625ec9146..3d98004af5c872f8a183476183d1cc89a2aac4b6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -277,7 +277,8 @@ public final class CraftServer implements Server {
|
||||
|
@ -7270,7 +7270,7 @@ index 29f94e574e39714caec95af5c176c9dba481728e..b532c72ec2c048554e496b4b63afa0e9
|
|||
private final StructureManager structureManager;
|
||||
protected final DedicatedServer console;
|
||||
protected final DedicatedPlayerList playerList;
|
||||
@@ -454,24 +455,7 @@ public final class CraftServer implements Server {
|
||||
@@ -455,24 +456,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
public void loadPlugins() {
|
||||
|
@ -7296,7 +7296,7 @@ index 29f94e574e39714caec95af5c176c9dba481728e..b532c72ec2c048554e496b4b63afa0e9
|
|||
}
|
||||
|
||||
public void enablePlugins(PluginLoadOrder type) {
|
||||
@@ -560,15 +544,17 @@ public final class CraftServer implements Server {
|
||||
@@ -561,15 +545,17 @@ public final class CraftServer implements Server {
|
||||
private void enablePlugin(Plugin plugin) {
|
||||
try {
|
||||
List<Permission> perms = plugin.getDescription().getPermissions();
|
||||
|
@ -7320,7 +7320,7 @@ index 29f94e574e39714caec95af5c176c9dba481728e..b532c72ec2c048554e496b4b63afa0e9
|
|||
|
||||
this.pluginManager.enablePlugin(plugin);
|
||||
} catch (Throwable ex) {
|
||||
@@ -1010,6 +996,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1012,6 +998,7 @@ public final class CraftServer implements Server {
|
||||
"This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin"
|
||||
));
|
||||
}
|
||||
|
@ -7329,10 +7329,10 @@ index 29f94e574e39714caec95af5c176c9dba481728e..b532c72ec2c048554e496b4b63afa0e9
|
|||
this.enablePlugins(PluginLoadOrder.STARTUP);
|
||||
this.enablePlugins(PluginLoadOrder.POSTWORLD);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 5a89b9ca6a62f0bfb5fe01ed4097870788cf5d83..a6de88625aeb2c5ababd476e804e9b45b1185efe 100644
|
||||
index 655ceaa92b9979fe29725f9812507731bb0bb484..a339a0aa6fd7cc7be810e93bc9eb192437519c75 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -395,6 +395,16 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -401,6 +401,16 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
|
||||
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
|
||||
}
|
||||
|
@ -7524,20 +7524,22 @@ index 0000000000000000000000000000000000000000..1d14f530ef888102e47eeeaf0d1a6076
|
|||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/plugin/PluginDependencyValidationTest.java b/src/test/java/io/papermc/paper/plugin/PluginDependencyValidationTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..83b1274ba56f03bec6cb69a35f33dc04f008cc1e
|
||||
index 0000000000000000000000000000000000000000..f4c6b799d80ea555b41396c4a8fd1e02f9197709
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/plugin/PluginDependencyValidationTest.java
|
||||
@@ -0,0 +1,60 @@
|
||||
@@ -0,0 +1,62 @@
|
||||
+package io.papermc.paper.plugin;
|
||||
+
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.SimpleMetaDependencyTree;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import java.util.List;
|
||||
+
|
||||
+import static org.hamcrest.MatcherAssert.assertThat;
|
||||
+
|
||||
+@Normal
|
||||
+public class PluginDependencyValidationTest {
|
||||
+
|
||||
+ private static final TestPluginMeta MAIN;
|
||||
|
@ -7590,10 +7592,10 @@ index 0000000000000000000000000000000000000000..83b1274ba56f03bec6cb69a35f33dc04
|
|||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/plugin/PluginLoadOrderTest.java b/src/test/java/io/papermc/paper/plugin/PluginLoadOrderTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c2c3c2f24ea802628bc4a36ef180fc08f4e5d288
|
||||
index 0000000000000000000000000000000000000000..caa6d514d2ffa2505e804878678d745b689e214d
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/plugin/PluginLoadOrderTest.java
|
||||
@@ -0,0 +1,148 @@
|
||||
@@ -0,0 +1,150 @@
|
||||
+package io.papermc.paper.plugin;
|
||||
+
|
||||
+import com.google.common.graph.GraphBuilder;
|
||||
|
@ -7602,6 +7604,7 @@ index 0000000000000000000000000000000000000000..c2c3c2f24ea802628bc4a36ef180fc08
|
|||
+import io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.ProviderConfiguration;
|
||||
+import io.papermc.paper.plugin.provider.PluginProvider;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.Assertions;
|
||||
+import org.junit.jupiter.api.BeforeEach;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
|
@ -7612,6 +7615,7 @@ index 0000000000000000000000000000000000000000..c2c3c2f24ea802628bc4a36ef180fc08
|
|||
+import java.util.Map;
|
||||
+import java.util.concurrent.atomic.AtomicInteger;
|
||||
+
|
||||
+@Normal
|
||||
+public class PluginLoadOrderTest {
|
||||
+
|
||||
+ private static List<PluginProvider<PaperTestPlugin>> REGISTERED_PROVIDERS = new ArrayList<>();
|
||||
|
@ -7744,24 +7748,27 @@ index 0000000000000000000000000000000000000000..c2c3c2f24ea802628bc4a36ef180fc08
|
|||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/plugin/PluginManagerTest.java b/src/test/java/io/papermc/paper/plugin/PluginManagerTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b7d69dda2b88218221a3cca6db4445cb58aa0179
|
||||
index 0000000000000000000000000000000000000000..3052b32905c8102357b7b3a5ed2df103fea83ab8
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/plugin/PluginManagerTest.java
|
||||
@@ -0,0 +1,75 @@
|
||||
@@ -0,0 +1,78 @@
|
||||
+package io.papermc.paper.plugin;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.permissions.Permission;
|
||||
+import org.bukkit.plugin.PluginManager;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.AfterEach;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.hamcrest.MatcherAssert.assertThat;
|
||||
+import static org.hamcrest.Matchers.*;
|
||||
+import static org.hamcrest.Matchers.empty;
|
||||
+import static org.hamcrest.Matchers.is;
|
||||
+import static org.hamcrest.Matchers.nullValue;
|
||||
+
|
||||
+public class PluginManagerTest extends AbstractTestingBase {
|
||||
+@Normal
|
||||
+public class PluginManagerTest {
|
||||
+
|
||||
+ private static final PluginManager pm = Bukkit.getPluginManager();
|
||||
+
|
||||
|
@ -7825,16 +7832,18 @@ index 0000000000000000000000000000000000000000..b7d69dda2b88218221a3cca6db4445cb
|
|||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/plugin/PluginNamingTest.java b/src/test/java/io/papermc/paper/plugin/PluginNamingTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6c3be5b84ae245652261668a52ce49934ef200a9
|
||||
index 0000000000000000000000000000000000000000..9f4486f736bad41a6c8c9c86e57226a45ae29a61
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/plugin/PluginNamingTest.java
|
||||
@@ -0,0 +1,28 @@
|
||||
@@ -0,0 +1,30 @@
|
||||
+package io.papermc.paper.plugin;
|
||||
+
|
||||
+import io.papermc.paper.plugin.provider.configuration.PaperPluginMeta;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.Assertions;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+@Normal
|
||||
+public class PluginNamingTest {
|
||||
+ private static final String TEST_NAME = "Test_Plugin";
|
||||
+ private static final String TEST_VERSION = "1.0";
|
||||
|
@ -7859,10 +7868,10 @@ index 0000000000000000000000000000000000000000..6c3be5b84ae245652261668a52ce4993
|
|||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/plugin/SyntheticEventTest.java b/src/test/java/io/papermc/paper/plugin/SyntheticEventTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2a7408ed5d9a415333212cadd7fefcd03785afbf
|
||||
index 0000000000000000000000000000000000000000..0b7f1521f8bf4b18dfdf9403862b5dc6b394a4d9
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/plugin/SyntheticEventTest.java
|
||||
@@ -0,0 +1,42 @@
|
||||
@@ -0,0 +1,44 @@
|
||||
+package io.papermc.paper.plugin;
|
||||
+
|
||||
+import io.papermc.paper.plugin.manager.PaperPluginManagerImpl;
|
||||
|
@ -7870,9 +7879,11 @@ index 0000000000000000000000000000000000000000..2a7408ed5d9a415333212cadd7fefcd0
|
|||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.EventHandler;
|
||||
+import org.bukkit.event.Listener;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.Assertions;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+@Normal
|
||||
+public class SyntheticEventTest {
|
||||
+
|
||||
+ @Test
|
||||
|
@ -8142,16 +8153,16 @@ index 0000000000000000000000000000000000000000..ba271c35eb2804f94cfc893bf94affb9
|
|||
+ return "null";
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
|
||||
index 183d30e3d3d413b05c762f374a964498d6ffdec4..bfbd80b60ac5df500d03c80de57e38aa7548dd46 100644
|
||||
--- a/src/test/java/org/bukkit/support/DummyServer.java
|
||||
+++ b/src/test/java/org/bukkit/support/DummyServer.java
|
||||
@@ -103,7 +103,7 @@ public final class DummyServer {
|
||||
final Thread currentThread = Thread.currentThread();
|
||||
when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
|
||||
|
||||
- final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance));
|
||||
+ final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance), null);
|
||||
when(instance.getPluginManager()).thenReturn(pluginManager);
|
||||
// paper end - testing additions
|
||||
diff --git a/src/test/java/org/bukkit/support/DummyServerHelper.java b/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
index ba0a2ab9de34fa40dd90cecaeec4a5e54fe3e2d8..5d24b95e3eec351ec1e9444533dd5f9d376ec4c6 100644
|
||||
--- a/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
+++ b/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
@@ -87,7 +87,7 @@ public final class DummyServerHelper {
|
||||
// Paper start - testing additions
|
||||
final Thread currentThread = Thread.currentThread();
|
||||
when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
|
||||
- final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance));
|
||||
+ final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance), null);
|
||||
when(instance.getPluginManager()).thenReturn(pluginManager);
|
||||
// Paper end - testing additions
|
||||
|
||||
|
|
|
@ -6,18 +6,18 @@ Subject: [PATCH] Plugin remapping
|
|||
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index a2bb659ae3a502d4c181d1ccbd15eefc38e4823b..8350fc099b68918fb03a21b6a5047ceee72dcbb4 100644
|
||||
index 3c9a9d2c44a3b177408ddfb3cad1e09169bf148b..ccf6e24f016991ac5987b5872037bf44d17e698f 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -46,6 +46,7 @@ dependencies {
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7")
|
||||
@@ -47,6 +47,7 @@ dependencies {
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7.1")
|
||||
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||
implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
|
||||
+ implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins
|
||||
}
|
||||
|
||||
paperweight {
|
||||
@@ -164,20 +165,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM
|
||||
@@ -169,20 +170,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM
|
||||
runtime.filterNot { it.asFile.absolutePath == vanilla }
|
||||
}
|
||||
|
||||
|
@ -1904,10 +1904,10 @@ index 0000000000000000000000000000000000000000..73b20a92f330311e3fef8f03b51a0985
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 69175337d14e0b14ddbc2a01a1deb860ae488d36..25a03307a576368f417f1ec3f44213ed469dcd71 100644
|
||||
index 3d98004af5c872f8a183476183d1cc89a2aac4b6..cd6b6109ea3844f7d78ad7a1cbd6cf5dc3d90b5c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1000,6 +1000,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1002,6 +1002,7 @@ public final class CraftServer implements Server {
|
||||
this.loadPlugins();
|
||||
this.enablePlugins(PluginLoadOrder.STARTUP);
|
||||
this.enablePlugins(PluginLoadOrder.POSTWORLD);
|
||||
|
|
|
@ -8,10 +8,10 @@ our own relocation. Also lets us rewrite NMS calls for when we're
|
|||
debugging in an IDE pre-relocate.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4f83c6f87 100644
|
||||
index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390cb9129cd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -11,6 +11,7 @@ import java.util.Arrays;
|
||||
@@ -12,6 +12,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
|
@ -19,7 +19,7 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -20,6 +21,7 @@ import java.util.jar.JarEntry;
|
||||
@@ -22,6 +23,7 @@ import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.jar.JarOutputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
@ -27,9 +27,9 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpec;
|
||||
@@ -100,6 +102,40 @@ public class Commodore {
|
||||
private static final Map<String, RerouteMethodData> METHOD_REROUTE = Commodore.createReroutes(MethodRerouting.class);
|
||||
private static final Map<String, RerouteMethodData> ENUM_METHOD_REROUTE = Commodore.createReroutes(EnumEvil.class);
|
||||
@@ -123,6 +125,40 @@ public class Commodore {
|
||||
return this.reroutes;
|
||||
}
|
||||
|
||||
+ // Paper start - Plugin rewrites
|
||||
+ private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap();
|
||||
|
@ -68,7 +68,7 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
public static void main(String[] args) {
|
||||
OptionParser parser = new OptionParser();
|
||||
OptionSpec<File> inputFlag = parser.acceptsAll(Arrays.asList("i", "input")).withRequiredArg().ofType(File.class).required();
|
||||
@@ -253,9 +289,49 @@ public class Commodore {
|
||||
@@ -278,9 +314,49 @@ public class Commodore {
|
||||
}
|
||||
|
||||
return new MethodVisitor(this.api, super.visitMethod(access, name, desc, signature, exceptions)) {
|
||||
|
@ -118,7 +118,7 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
name = FieldRename.rename(pluginVersion, owner, name);
|
||||
|
||||
if (modern) {
|
||||
@@ -375,6 +451,13 @@ public class Commodore {
|
||||
@@ -393,6 +469,13 @@ public class Commodore {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
if (modern) {
|
||||
if (owner.equals("org/bukkit/Material") || (instantiatedMethodType != null && instantiatedMethodType.getDescriptor().startsWith("(Lorg/bukkit/Material;)"))) {
|
||||
switch (name) {
|
||||
@@ -471,6 +554,13 @@ public class Commodore {
|
||||
@@ -489,6 +572,13 @@ public class Commodore {
|
||||
|
||||
@Override
|
||||
public void visitLdcInsn(Object value) {
|
||||
|
@ -146,7 +146,7 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
if (value instanceof String && ((String) value).equals("com.mysql.jdbc.Driver")) {
|
||||
super.visitLdcInsn("com.mysql.cj.jdbc.Driver");
|
||||
return;
|
||||
@@ -481,6 +571,14 @@ public class Commodore {
|
||||
@@ -499,6 +589,14 @@ public class Commodore {
|
||||
|
||||
@Override
|
||||
public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) {
|
||||
|
@ -161,7 +161,7 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
if (bootstrapMethodHandle.getOwner().equals("java/lang/invoke/LambdaMetafactory")
|
||||
&& bootstrapMethodHandle.getName().equals("metafactory") && bootstrapMethodArguments.length == 3) {
|
||||
Type samMethodType = (Type) bootstrapMethodArguments[0];
|
||||
@@ -497,7 +595,7 @@ public class Commodore {
|
||||
@@ -515,7 +613,7 @@ public class Commodore {
|
||||
methodArgs.add(new Handle(newOpcode, newOwner, newName, newDescription, newItf));
|
||||
methodArgs.add(newInstantiated);
|
||||
|
||||
|
@ -170,7 +170,7 @@ index f80625a2b1dc266131ba3bfda9a918c72a592d82..ebc160fd4c8aed95087130bb6fddc1d4
|
|||
}, implMethod.getTag(), implMethod.getOwner(), implMethod.getName(), implMethod.getDesc(), implMethod.isInterface(), samMethodType, instantiatedMethodType);
|
||||
return;
|
||||
}
|
||||
@@ -548,6 +646,12 @@ public class Commodore {
|
||||
@@ -566,6 +664,12 @@ public class Commodore {
|
||||
|
||||
@Override
|
||||
public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) {
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Remap reflection calls in plugins using internals
|
|||
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 8350fc099b68918fb03a21b6a5047ceee72dcbb4..404c2eefa88319e0eaf7b0d1d2696c91dd0e0e0b 100644
|
||||
index 381a4885c4f52c1e094af350fcb7e04b590f849a..6d8f4c3b290609d60dbcabe3d2c8274b017246c8 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -47,6 +47,12 @@ dependencies {
|
||||
@@ -48,6 +48,12 @@ dependencies {
|
||||
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||
implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
|
||||
implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins
|
||||
|
@ -645,11 +645,11 @@ index 242811578a786e3807a1a7019d472d5a68f87116..0b65fdf53124f3dd042b2363b1b8df8e
|
|||
return traceElements;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index ebc160fd4c8aed95087130bb6fddc1d4f83c6f87..65f64de05a88844e62b5a0dd1e2f53edfb4e0c1f 100644
|
||||
index 2a29f60c3e82239ab7acd85242fc3390cb9129cd..91c6721201b095eb32c5fd5a1aaf2cbcf3ee196d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -103,36 +103,26 @@ public class Commodore {
|
||||
private static final Map<String, RerouteMethodData> ENUM_METHOD_REROUTE = Commodore.createReroutes(EnumEvil.class);
|
||||
@@ -126,36 +126,26 @@ public class Commodore {
|
||||
}
|
||||
|
||||
// Paper start - Plugin rewrites
|
||||
- private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap();
|
||||
|
@ -696,7 +696,7 @@ index ebc160fd4c8aed95087130bb6fddc1d4f83c6f87..65f64de05a88844e62b5a0dd1e2f53ed
|
|||
}
|
||||
// Paper end - Plugin rewrites
|
||||
|
||||
@@ -215,6 +205,7 @@ public class Commodore {
|
||||
@@ -240,6 +230,7 @@ public class Commodore {
|
||||
visitor = new LimitedClassRemapper(cw, new SimpleRemapper(Commodore.ENUM_RENAMES));
|
||||
}
|
||||
|
||||
|
@ -705,18 +705,18 @@ index ebc160fd4c8aed95087130bb6fddc1d4f83c6f87..65f64de05a88844e62b5a0dd1e2f53ed
|
|||
final Set<RerouteMethodData> rerouteMethodData = new HashSet<>();
|
||||
String className;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index a6de88625aeb2c5ababd476e804e9b45b1185efe..fa2e43020fafc283a9c063d10a82280158c7f93d 100644
|
||||
index a339a0aa6fd7cc7be810e93bc9eb192437519c75..33d3085d0d44d748fcb1fc203dfd14c9e1b4aff0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -74,6 +74,7 @@ import org.bukkit.potion.PotionType;
|
||||
@SuppressWarnings("deprecation")
|
||||
public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public static final UnsafeValues INSTANCE = new CraftMagicNumbers();
|
||||
public static final CraftMagicNumbers INSTANCE = new CraftMagicNumbers();
|
||||
+ public static final boolean DISABLE_OLD_API_SUPPORT = Boolean.getBoolean("paper.disableOldApiSupport"); // Paper
|
||||
|
||||
private CraftMagicNumbers() {}
|
||||
private final Commodore commodore = new Commodore();
|
||||
|
||||
@@ -340,7 +341,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -346,7 +347,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
throw new InvalidPluginException("Plugin API version " + pdf.getAPIVersion() + " is lower than the minimum allowed version. Please update or replace it.");
|
||||
}
|
||||
|
||||
|
@ -725,7 +725,7 @@ index a6de88625aeb2c5ababd476e804e9b45b1185efe..fa2e43020fafc283a9c063d10a822801
|
|||
CraftLegacy.init();
|
||||
}
|
||||
|
||||
@@ -355,6 +356,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -361,6 +362,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
@Override
|
||||
public byte[] processClass(PluginDescriptionFile pdf, String path, byte[] clazz) {
|
||||
|
@ -736,5 +736,5 @@ index a6de88625aeb2c5ababd476e804e9b45b1185efe..fa2e43020fafc283a9c063d10a822801
|
|||
+ }
|
||||
+ // Paper end
|
||||
try {
|
||||
clazz = Commodore.convert(clazz, pdf.getName(), ApiVersion.getOrCreateVersion(pdf.getAPIVersion()), ((CraftServer) Bukkit.getServer()).activeCompatibilities);
|
||||
clazz = this.commodore.convert(clazz, pdf.getName(), ApiVersion.getOrCreateVersion(pdf.getAPIVersion()), ((CraftServer) Bukkit.getServer()).activeCompatibilities);
|
||||
} catch (Exception ex) {
|
||||
|
|
|
@ -1590,7 +1590,7 @@ index 46a090123e205394791cdbde2af84c58ce55f7e1..47f5f3d58bb3bf85cf35f9baae77df7f
|
|||
};
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 25a03307a576368f417f1ec3f44213ed469dcd71..b3d4cb03f6d3951632fd15101aa68e130a43879b 100644
|
||||
index cd6b6109ea3844f7d78ad7a1cbd6cf5dc3d90b5c..0fda501dedcc1f3f7d35e3b66a4b40394c4b3cb5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -376,7 +376,7 @@ public final class CraftServer implements Server {
|
||||
|
@ -1602,7 +1602,7 @@ index 25a03307a576368f417f1ec3f44213ed469dcd71..b3d4cb03f6d3951632fd15101aa68e13
|
|||
this.overrideSpawnLimits();
|
||||
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
|
||||
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
|
||||
@@ -2617,12 +2617,31 @@ public final class CraftServer implements Server {
|
||||
@@ -2619,12 +2619,31 @@ public final class CraftServer implements Server {
|
||||
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
|
||||
{
|
||||
|
||||
|
@ -1985,10 +1985,10 @@ index f97eccb6a17c7876e1e002d798eb67bbe80571a0..76effc345d362047e64d064eb64a5222
|
|||
+ } // Paper
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 6aa5b1e05893bcf61a91cb4de578d8996ca0a868..9383bf47404fca8d008d5c401ed37ddaa7bef4f7 100644
|
||||
index 33d3085d0d44d748fcb1fc203dfd14c9e1b4aff0..f7b80cf8c89ae5eb9d8f0893e05ffc753fdace19 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -197,6 +197,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -199,6 +199,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return CraftNamespacedKey.toMinecraft(mat.getKey());
|
||||
}
|
||||
// ========================================================================
|
||||
|
@ -2001,7 +2001,7 @@ index 6aa5b1e05893bcf61a91cb4de578d8996ca0a868..9383bf47404fca8d008d5c401ed37dda
|
|||
|
||||
public static byte toLegacyData(BlockState data) {
|
||||
return CraftLegacy.toLegacyData(data);
|
||||
@@ -442,6 +448,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -448,6 +454,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public DamageSource.Builder createDamageSourceBuilder(DamageType damageType) {
|
||||
return new CraftDamageSourceBuilder(damageType);
|
||||
}
|
||||
|
|
|
@ -146,10 +146,10 @@ index 49de4625c57689a3624ed421c0b03512507c97c3..46e03617bb32e4037d700c1b3698d397
|
|||
this.startMetricsRecordingTick();
|
||||
this.profiler.push("tick");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b3d4cb03f6d3951632fd15101aa68e130a43879b..90da60f7cdfe809c2035c9cd242f748ec8bf5eb0 100644
|
||||
index 0fda501dedcc1f3f7d35e3b66a4b40394c4b3cb5..2c3efcf07f933278a8b897cf7b1f6f24b452a7c5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2670,7 +2670,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2672,7 +2672,11 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public double[] getTPS() {
|
||||
|
|
|
@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
|
|||
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 1056badff06575ef13907afac60af734ffa2b863..acab477a4a026799319054c2eb4d0f2c99ab3d83 100644
|
||||
index 2c3efcf07f933278a8b897cf7b1f6f24b452a7c5..b8b2e582115cc42a913b03a35861fa810d774cbb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -458,6 +458,35 @@ public final class CraftServer implements Server {
|
||||
@@ -459,6 +459,35 @@ public final class CraftServer implements Server {
|
||||
io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.INSTANCE.enter(io.papermc.paper.plugin.entrypoint.Entrypoint.PLUGIN); // Paper - replace implementation
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ index 1056badff06575ef13907afac60af734ffa2b863..acab477a4a026799319054c2eb4d0f2c
|
|||
if (type == PluginLoadOrder.STARTUP) {
|
||||
this.helpMap.clear();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 26dfb02286e836cad0242c71f743265d55d9d032..1c8049bbc08be77673d375205bd42a346ff951b8 100644
|
||||
index bdb8e882ec1efbe5afec9ec5a5df57bf38d4ba2b..034d68c2715b6a90f31e56f949ff3d27235a26eb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -160,6 +160,12 @@ public class Main {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 568d6fab743039b20715d8181555f52baa05f0f3..7ae3cdb80335cbeb0ff695eb719a170651586722 100644
|
||||
index 0c73854243f7fa21d1ffdb3b4c85ee0a69c9c5e4..f6ac13f91f08498a8adda7d34518a5cfe34c15b2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -976,11 +976,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -978,11 +978,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return CraftChatMessage.fromComponent(this.displayName);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ index 568d6fab743039b20715d8181555f52baa05f0f3..7ae3cdb80335cbeb0ff695eb719a1706
|
|||
@Override
|
||||
public boolean hasDisplayName() {
|
||||
return this.displayName != null;
|
||||
@@ -1154,6 +1166,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1156,6 +1168,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromComponent));
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ index 568d6fab743039b20715d8181555f52baa05f0f3..7ae3cdb80335cbeb0ff695eb719a1706
|
|||
@Override
|
||||
public void setLore(List<String> lore) {
|
||||
if (lore == null || lore.isEmpty()) {
|
||||
@@ -1168,6 +1188,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1170,6 +1190,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ index 568d6fab743039b20715d8181555f52baa05f0f3..7ae3cdb80335cbeb0ff695eb719a1706
|
|||
@Override
|
||||
public boolean hasCustomModelData() {
|
||||
return this.customModelData != null;
|
||||
@@ -1880,6 +1915,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1882,6 +1917,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
}
|
||||
|
||||
for (Object object : addFrom) {
|
||||
|
|
|
@ -11,7 +11,7 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|||
Co-authored-by: masmc05 <masmc05@gmail.com>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 404c2eefa88319e0eaf7b0d1d2696c91dd0e0e0b..e7c00486bd831578008c02fcda13f3a555e6a2f1 100644
|
||||
index 6d8f4c3b290609d60dbcabe3d2c8274b017246c8..0c349354ba76dfd2c5f16fb232263b18e77a9a40 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -1,4 +1,5 @@
|
||||
|
@ -20,7 +20,7 @@ index 404c2eefa88319e0eaf7b0d1d2696c91dd0e0e0b..e7c00486bd831578008c02fcda13f3a5
|
|||
|
||||
plugins {
|
||||
java
|
||||
@@ -64,18 +65,24 @@ tasks.jar {
|
||||
@@ -65,18 +66,24 @@ tasks.jar {
|
||||
|
||||
manifest {
|
||||
val git = Git(rootProject.layout.projectDirectory.path)
|
||||
|
@ -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 7d6d817f951811aad0f2ccea567e558bad1242fa..19d2b38cd4397cb53fc2ed3f0e5df5c66223fd5f 100644
|
||||
index b8b2e582115cc42a913b03a35861fa810d774cbb..8f79d7611c3ee1c817d5671152e459ec4f413418 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;
|
||||
|
@ -644,7 +644,7 @@ index 7d6d817f951811aad0f2ccea567e558bad1242fa..19d2b38cd4397cb53fc2ed3f0e5df5c6
|
|||
this.structureManager = new CraftStructureManager(console.getStructureManager(), console.registryAccess());
|
||||
this.dataPackManager = new CraftDataPackManager(this.getServer().getPackRepository());
|
||||
this.serverTickManager = new CraftServerTickManager(console.tickRateManager());
|
||||
@@ -606,6 +601,13 @@ public final class CraftServer implements Server {
|
||||
@@ -607,6 +602,13 @@ public final class CraftServer implements Server {
|
||||
return this.bukkitVersion;
|
||||
}
|
||||
|
||||
|
@ -659,7 +659,7 @@ index 7d6d817f951811aad0f2ccea567e558bad1242fa..19d2b38cd4397cb53fc2ed3f0e5df5c6
|
|||
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 8da38624b5867ce88bdb3036e1ed6d99fc626f31..2097be352dc585b805dc73194cec095627f311bc 100644
|
||||
index 034d68c2715b6a90f31e56f949ff3d27235a26eb..a7fbbe40f2382e7af185c4bfdd451fc1998b3636 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 8da38624b5867ce88bdb3036e1ed6d99fc626f31..2097be352dc585b805dc73194cec0956
|
|||
public static boolean useConsole = true;
|
||||
|
||||
@@ -241,15 +242,17 @@ public class Main {
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -28);
|
||||
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 ***");
|
||||
|
@ -692,10 +692,10 @@ index 8da38624b5867ce88bdb3036e1ed6d99fc626f31..2097be352dc585b805dc73194cec0956
|
|||
t.printStackTrace();
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 9383bf47404fca8d008d5c401ed37ddaa7bef4f7..d08b01fef9928f2239c8663cf90219dc7acad58c 100644
|
||||
index f7b80cf8c89ae5eb9d8f0893e05ffc753fdace19..432f019afff36aa6143c052f7387a6c275a09de8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -453,6 +453,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -459,6 +459,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public String getTimingsServerName() {
|
||||
return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|||
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 47e1640cafc8087d94d0b88b8b3117591f9f238e..64db7e017b41bffcaac202ee4ecfd7df46d69331 100644
|
||||
index 3a67b2b6a6d3204b2a7bbe8adbf2b0ecf7898551..02b9e1ed57f5d65698c461387ff7d48450e6a70f 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2013,7 +2013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
@ -40,10 +40,10 @@ index 47e1640cafc8087d94d0b88b8b3117591f9f238e..64db7e017b41bffcaac202ee4ecfd7df
|
|||
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
||||
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2a36e562967ec6174efe456e489c50ca10ba47e5..b0371c51645da361b63dea02bf7633ae6191560f 100644
|
||||
index 8f79d7611c3ee1c817d5671152e459ec4f413418..441a8d3355e0db773a5da330bf9361234da1ca89 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -933,7 +933,7 @@ public final class CraftServer implements Server {
|
||||
@@ -934,7 +934,7 @@ public final class CraftServer implements Server {
|
||||
public boolean dispatchCommand(CommandSender sender, String commandLine) {
|
||||
Preconditions.checkArgument(sender != null, "sender cannot be null");
|
||||
Preconditions.checkArgument(commandLine != null, "commandLine cannot be null");
|
||||
|
@ -53,7 +53,7 @@ index 2a36e562967ec6174efe456e489c50ca10ba47e5..b0371c51645da361b63dea02bf7633ae
|
|||
if (this.commandMap.dispatch(sender, commandLine)) {
|
||||
return true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index fb5548b92a0fe7866cf98e25293c4b0702344c9b..52d48ad341c564f0f847e3aad09babee826ebf87 100644
|
||||
index 545da59af2436b9a4363ec459456c8f15650b79f..9751cace64d9ad2b8b55080b13834e8ccb056b42 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -546,7 +546,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b0371c51645da361b63dea02bf7633ae6191560f..527b3a7ae93ab288b119fe6bfa76cb0ea3ab2561 100644
|
||||
index 441a8d3355e0db773a5da330bf9361234da1ca89..32d1e4bc8279a9adb83501c99fc7ff33d4c7f81c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2177,6 +2177,7 @@ public final class CraftServer implements Server {
|
||||
@@ -2179,6 +2179,7 @@ public final class CraftServer implements Server {
|
||||
return this.helpMap;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index adeb3b9a3d65d2ef71ea4fd6f0f4679a88d0ba87..e6c68fd9a5fcd374cd7feca081189c9ba9225743 100644
|
||||
index 5ce03fa25e0a03025501a7f86a8f3c64f3fd7c77..ff2118fb463168e061ca9152183e19d593b476e9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -102,7 +102,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -103,7 +103,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@Override
|
||||
public void setHealth(double health) {
|
||||
health = (float) health;
|
||||
|
|
|
@ -7,10 +7,10 @@ Upstream added methods for this, original methods are now
|
|||
deprecated
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 812a4db4a91b887ef61b3ead9fa781561e6039ce..238ec25cc3109659d524fcc1de48afcd5f59552b 100644
|
||||
index ff2118fb463168e061ca9152183e19d593b476e9..5ba4105356e4a4808293e86c679d08a3c4cdd245 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -283,10 +283,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -284,10 +284,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,7 +41,7 @@ index 812a4db4a91b887ef61b3ead9fa781561e6039ce..238ec25cc3109659d524fcc1de48afcd
|
|||
|
||||
@Override
|
||||
public void damage(double amount) {
|
||||
@@ -807,4 +826,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -813,4 +832,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().persistentInvisibility = invisible;
|
||||
this.getHandle().setSharedFlag(5, invisible);
|
||||
}
|
||||
|
|
|
@ -16,10 +16,10 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
|
|||
A config option has been added for those who depend on the previous behavior, but I don't expect that.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2b665dafdfd002fbd87dca9d869ee8c2b945a4fb..da2e0bb591468e7940f057a583ce166abc79d399 100644
|
||||
index 3043ec179592606050deede2874b0e251b859892..dfd8776ff6cd8be750e77dc4c30f59c28ff1732a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -487,6 +487,7 @@ public final class CraftServer implements Server {
|
||||
@@ -488,6 +488,7 @@ public final class CraftServer implements Server {
|
||||
if (type == PluginLoadOrder.STARTUP) {
|
||||
this.helpMap.clear();
|
||||
this.helpMap.initializeGeneralTopics();
|
||||
|
@ -27,7 +27,7 @@ index 2b665dafdfd002fbd87dca9d869ee8c2b945a4fb..da2e0bb591468e7940f057a583ce166a
|
|||
}
|
||||
|
||||
Plugin[] plugins = this.pluginManager.getPlugins();
|
||||
@@ -506,7 +507,7 @@ public final class CraftServer implements Server {
|
||||
@@ -507,7 +508,7 @@ public final class CraftServer implements Server {
|
||||
this.commandMap.registerServerAliases();
|
||||
DefaultPermissions.registerCorePermissions();
|
||||
CraftDefaultPermissions.registerCorePermissions();
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
|
|||
https://github.com/PaperMC/Paper/issues/49
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index c8d8161bc8558be20583ca9e68611ea26e61deb0..ca2a17db0713fdb332549a76bee7e56502f96e56 100644
|
||||
index dfd8776ff6cd8be750e77dc4c30f59c28ff1732a..2b0f69b89d69258a1e9a6a81db5c9d4497417cd7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2790,5 +2790,23 @@ public final class CraftServer implements Server {
|
||||
@@ -2792,5 +2792,23 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
return this.adventure$audiences;
|
||||
}
|
||||
|
|
|
@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive
|
|||
This will remove metadata on reload so it does not crash everything if a plugin uses it.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 99571e69aabbbfb0e439a42d113c206decb1377b..5461e0a1ef7f342cbd9fb6f291e33e645b414058 100644
|
||||
index 2b0f69b89d69258a1e9a6a81db5c9d4497417cd7..b7539a5f7bc20f20f3cd7fb30d87ab7ffc1133c3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1001,8 +1001,16 @@ public final class CraftServer implements Server {
|
||||
@@ -1003,8 +1003,16 @@ public final class CraftServer implements Server {
|
||||
world.spigotConfig.init(); // Spigot
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ index 17fa2d3db112762bcb8b941b69b8ddcc53f47224..6c76aeddb34239a5acc204a17b2aa2d8
|
|||
|
||||
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 7ae3cdb80335cbeb0ff695eb719a170651586722..97c40582bca095532fff9a81515f38ea4ac527e0 100644
|
||||
index f6ac13f91f08498a8adda7d34518a5cfe34c15b2..9ab1abd4414a0a40284e12dfebff37e21e7f150f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
|
||||
|
@ -213,7 +213,7 @@ index 7ae3cdb80335cbeb0ff695eb719a170651586722..97c40582bca095532fff9a81515f38ea
|
|||
for (Map.Entry<?, ?> entry : ench.entrySet()) {
|
||||
Enchantment enchantment = CraftEnchantment.stringToBukkit(entry.getKey().toString());
|
||||
if ((enchantment != null) && (entry.getValue() instanceof Integer)) {
|
||||
@@ -1079,14 +1081,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1081,14 +1083,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public Map<Enchantment, Integer> getEnchants() {
|
||||
|
@ -230,7 +230,7 @@ index 7ae3cdb80335cbeb0ff695eb719a170651586722..97c40582bca095532fff9a81515f38ea
|
|||
}
|
||||
|
||||
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
|
||||
@@ -1686,7 +1688,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1688,7 +1690,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
clone.customModelData = this.customModelData;
|
||||
clone.blockData = this.blockData;
|
||||
if (this.enchantments != null) {
|
||||
|
@ -239,7 +239,7 @@ index 7ae3cdb80335cbeb0ff695eb719a170651586722..97c40582bca095532fff9a81515f38ea
|
|||
}
|
||||
if (this.hasAttributeModifiers()) {
|
||||
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
|
||||
@@ -2036,4 +2038,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -2038,4 +2040,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
return (result != null) ? result : Optional.empty();
|
||||
}
|
||||
|
|
|
@ -60,10 +60,10 @@ index a0b0614ac7d2009db5c6c10ab4a5f09dd447c635..653856d0b8dcf2baf4cc77a276f17c8c
|
|||
} else {
|
||||
String[] astring1 = astring;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5461e0a1ef7f342cbd9fb6f291e33e645b414058..ff807bfe89708d9c680b84eda902b49f3167f3a4 100644
|
||||
index b7539a5f7bc20f20f3cd7fb30d87ab7ffc1133c3..b125872e57e15081d6f5a7b3e108f7633046b228 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1886,7 +1886,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1888,7 +1888,7 @@ public final class CraftServer implements Server {
|
||||
if (result == null) {
|
||||
GameProfile profile = null;
|
||||
// Only fetch an online UUID in online mode
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
|
|||
Reload the aliases stored in commands.yml
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 20076b59ed7433cc280e2574a09e8db1d58eb027..67805fe23d91961b036089674e4f6202fad3c505 100644
|
||||
index b125872e57e15081d6f5a7b3e108f7633046b228..8e951ed126453cf1ffa81e5c8aa6e6ea5db03089 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2816,5 +2816,24 @@ public final class CraftServer implements Server {
|
||||
@@ -2818,5 +2818,24 @@ public final class CraftServer implements Server {
|
||||
DefaultPermissions.registerCorePermissions();
|
||||
CraftDefaultPermissions.registerCorePermissions();
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 67805fe23d91961b036089674e4f6202fad3c505..16110e41480ad4508e56c196c551debdf0e96811 100644
|
||||
index 8e951ed126453cf1ffa81e5c8aa6e6ea5db03089..cfc59f1fb52dffb13fb214dd7c9cf71d40354ef0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2835,5 +2835,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2837,5 +2837,10 @@ public final class CraftServer implements Server {
|
||||
commandMap.registerServerAliases();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -626,7 +626,7 @@ index 416b26c2ab62b29d640169166980e398d5824b14..774d81c702edb76a2f6184d4dc53687d
|
|||
String s1 = name.toLowerCase(Locale.ROOT);
|
||||
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 16110e41480ad4508e56c196c551debdf0e96811..c5618c1a773442c9c016b67ea64d83f8efcb3b89 100644
|
||||
index cfc59f1fb52dffb13fb214dd7c9cf71d40354ef0..f2b2a352cdc0301601ffd4b4fb7a99304ba526e5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -262,6 +262,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
|
||||
|
@ -647,7 +647,7 @@ index 16110e41480ad4508e56c196c551debdf0e96811..c5618c1a773442c9c016b67ea64d83f8
|
|||
CraftItemFactory.instance();
|
||||
CraftEntityFactory.instance();
|
||||
}
|
||||
@@ -2840,5 +2844,39 @@ public final class CraftServer implements Server {
|
||||
@@ -2842,5 +2846,39 @@ public final class CraftServer implements Server {
|
||||
public boolean suggestPlayerNamesWhenNullTabCompletions() {
|
||||
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
|
||||
}
|
||||
|
|
|
@ -78,10 +78,10 @@ index f94c0106b44d614483184e372c01c1504cb886b0..72756ef14b8ec8afd80313b9f6aaf767
|
|||
|
||||
return null;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5ab2836f14e1a7482e7136004507d66c4abb4bdd..4280bd6288ce9522d041ec2dc2105d3908514a2f 100644
|
||||
index f2b2a352cdc0301601ffd4b4fb7a99304ba526e5..31f87ce0865dd7560cd9ba634855a1defdc80df2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -947,7 +947,13 @@ public final class CraftServer implements Server {
|
||||
@@ -948,7 +948,13 @@ public final class CraftServer implements Server {
|
||||
|
||||
// Spigot start
|
||||
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {
|
||||
|
|
|
@ -31,12 +31,12 @@ index 8f1992188f7fd9e735569e099b36a7eafed47aae..061c89b985dafc79c808dd5f0e296b9f
|
|||
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 837db57c19df3d5c986a52edf3d9d8105cc87cde..446403f73fb1b5687d587889e6f32dce464d05a6 100644
|
||||
index a41674e0965a13acd2ec2fcc431a2baa26fc4361..bcc9d3b1503b1be1841c9ab40e879a1cbb0549f2 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, -14);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -28);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
- System.err.println("*** Error, this build is outdated ***");
|
||||
+ // Paper start - This is some stupid bullshit
|
||||
|
|
|
@ -7,10 +7,10 @@ Subject: [PATCH] LivingEntity#setKiller
|
|||
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index c36e4c1802e304853320576e0521dbc53cd25425..fe631496aa551a0029eff7b4d4a5daf16dddac50 100644
|
||||
index 5ba4105356e4a4808293e86c679d08a3c4cdd245..7a01569f62b3b27a9eb6def0e2ec72e1d392258d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -406,6 +406,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -407,6 +407,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index f297b2227d0793f44cb5770aa24a474ec7283b15..21d00a73ad8287d61eda1ab91b88ea3264aff021 100644
|
||||
index 021c72410c7580d659bfaa1e327fae3727acabd2..7a7c404778757e6778305c9f8334a4fba1f466a6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3168,6 +3168,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
@ -24,10 +24,10 @@ index f297b2227d0793f44cb5770aa24a474ec7283b15..21d00a73ad8287d61eda1ab91b88ea32
|
|||
}
|
||||
diff --git a/src/test/java/io/papermc/paper/inventory/item/ArmorSlotTypeMaterialTest.java b/src/test/java/io/papermc/paper/inventory/item/ArmorSlotTypeMaterialTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a706dcbabfe31bf54a552965fa5feb8be34213bf
|
||||
index 0000000000000000000000000000000000000000..8943cef5cdb8269080b9f0e2edbad5d5ea8b421d
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/inventory/item/ArmorSlotTypeMaterialTest.java
|
||||
@@ -0,0 +1,74 @@
|
||||
@@ -0,0 +1,75 @@
|
||||
+package io.papermc.paper.inventory.item;
|
||||
+
|
||||
+import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent;
|
||||
|
@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..a706dcbabfe31bf54a552965fa5feb8b
|
|||
+import net.minecraft.world.item.ItemStack;
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.junit.jupiter.params.ParameterizedTest;
|
||||
+import org.junit.jupiter.params.provider.MethodSource;
|
||||
+
|
||||
|
@ -48,7 +48,8 @@ index 0000000000000000000000000000000000000000..a706dcbabfe31bf54a552965fa5feb8b
|
|||
+import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
+
|
||||
+public class ArmorSlotTypeMaterialTest extends AbstractTestingBase {
|
||||
+@AllFeatures
|
||||
+public class ArmorSlotTypeMaterialTest {
|
||||
+
|
||||
+ public static Stream<Object[]> slotTypeParams() {
|
||||
+ final List<Object[]> parameters = new ArrayList<>();
|
||||
|
|
|
@ -69,7 +69,7 @@ index a1c1a101aa424e74309f6f4c0a53a6a8db5df441..013298c424025cd88f15d61e50d196f7
|
|||
public Biome getBiome() {
|
||||
return this.getWorld().getBiome(this.getX(), this.getY(), this.getZ());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
index 9df2da091082071e3461b8900af4879e80cd4d93..1ca25dfdb9ec5c3a4d26b71484e1326e1f50b40d 100644
|
||||
index 483a89ba477506ae108f680e586b37c142119696..80418a05d53516d2c539383aa9994099c634b905 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
@@ -24,15 +24,26 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
||||
|
@ -101,7 +101,7 @@ index 9df2da091082071e3461b8900af4879e80cd4d93..1ca25dfdb9ec5c3a4d26b71484e1326e
|
|||
}
|
||||
|
||||
protected CraftBlockEntityState(CraftBlockEntityState<T> state, Location location) {
|
||||
@@ -176,4 +187,11 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
||||
@@ -184,4 +195,11 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
||||
public CraftBlockEntityState<T> copy(Location location) {
|
||||
return new CraftBlockEntityState<>(this, location);
|
||||
}
|
||||
|
|
|
@ -80,10 +80,10 @@ index 87f56f9c14e3a827d0afc03591bfce8cbf61e307..6cdbd0281e38d7107f239e6e052c08e4
|
|||
|
||||
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 23e4bb2fe24fd9252df30fdaa3cd968d88ce71db..3db271261c02d2aa26a619f30775d505236955eb 100644
|
||||
index 31f87ce0865dd7560cd9ba634855a1defdc80df2..39e3730eae983c20522b97fcd547823cd192cb2d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2292,7 +2292,7 @@ public final class CraftServer implements Server {
|
||||
@@ -2294,7 +2294,7 @@ public final class CraftServer implements Server {
|
||||
offers = this.tabCompleteChat(player, message);
|
||||
}
|
||||
|
||||
|
|
|
@ -225,10 +225,10 @@ index c4f12f96e39cb6189799a796b4cb2cb4f0b92392..ecce5d0da946ca279c5608068442cc53
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
index b46032190dbb0d47ee3c1a11959f6278ddf5eb5a..0715f43f3f8235d28a12b9d49d78c765a946c53f 100644
|
||||
index 46025e3ffdc21f14403186094f893dff6316ba5e..50faaaa48dffcaf53823caed1e3f7263cd5c441f 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
@@ -364,6 +364,7 @@ public class ItemMetaTest extends AbstractTestingBase {
|
||||
@@ -365,6 +365,7 @@ public class ItemMetaTest {
|
||||
final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta();
|
||||
meta.entityTag = new CompoundTag();
|
||||
meta.entityTag.putBoolean("Small", true);
|
||||
|
|
|
@ -40,7 +40,7 @@ index 30e55f693b963496b85afa32da9c15cacb738836..636b8aef2348fa4cfe63a9b7d77a64b1
|
|||
playerName = gameprofile.getName();
|
||||
uniqueId = gameprofile.getId();
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 768a5c6ebc4466aae4108a79e1564b2bfc93463a..26cee48ea3650aaf87fd2ba9c70d4ca9a88e2d87 100644
|
||||
index c08ffdbc9afb2fe7abbf5567dc1fb1e2bcb01b96..3ee00025eb9d936b9780b25fdc25d144acc496cd 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -831,10 +831,16 @@ public abstract class PlayerList {
|
||||
|
@ -220,10 +220,10 @@ index 8521f728088d16ecbaa0119983a9f12a649ac847..9136feac48244dc68bff92b52643f2ad
|
|||
public void onEntityRemove(Entity entity) {
|
||||
this.invertedVisibilityEntities.remove(entity.getUUID());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 65f64de05a88844e62b5a0dd1e2f53edfb4e0c1f..e1b86308f737b957b6d00bc902b91856694b7cbf 100644
|
||||
index 91c6721201b095eb32c5fd5a1aaf2cbcf3ee196d..b85223ebff4dbb8aa74b501663afc87ef11e2a96 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -449,6 +449,13 @@ public class Commodore {
|
||||
@@ -467,6 +467,13 @@ public class Commodore {
|
||||
}
|
||||
// Paper end - Rewrite plugins
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
|
|||
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5d8eb3b728359be5f92a255c9637d71713403cc8..745970d9f07ed7ca98a653bfff1b861dc4aaa177 100644
|
||||
index 39e3730eae983c20522b97fcd547823cd192cb2d..a94b972e328d2eff635de95847dc622c3a58fd9f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1886,6 +1886,25 @@ public final class CraftServer implements Server {
|
||||
@@ -1888,6 +1888,25 @@ public final class CraftServer implements Server {
|
||||
return recipients.size();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@ index 7a7c404778757e6778305c9f8334a4fba1f466a6..d58439f85f4d3a9b863ecadb3b42b2ee
|
|||
return this.isShiftKeyDown();
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 475fcc2d1d61a94b81dc839ba0240f317afcfe56..5ca07b2cdc30f23632a23249c615ac9a8c7c96c7 100644
|
||||
index 7a01569f62b3b27a9eb6def0e2ec72e1d392258d..73c72b8cdece357193afb3c5f474e055086311ea 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -847,5 +847,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -853,5 +853,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public void setArrowsStuck(final int arrows) {
|
||||
this.getHandle().setArrowCount(arrows);
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ public net/minecraft/server/level/ServerPlayer completeUsingItem()V
|
|||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 5ca07b2cdc30f23632a23249c615ac9a8c7c96c7..4f0f21bb1f2d37a798065b7c5e0b2a77a8122823 100644
|
||||
index 73c72b8cdece357193afb3c5f474e055086311ea..2612e5016646591bb65ac255804b612b348a32fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -858,4 +858,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -864,4 +864,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
getHandle().setShieldBlockingDelay(delay);
|
||||
}
|
||||
// Paper end
|
||||
|
|
|
@ -33,10 +33,10 @@ index c466ec011d059b9960606ef2ee51ea3a3a65f8d0..baf93b5d5883d0a5c360f1a475949804
|
|||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5478c159843a74ea90b2b1c4d5eb3c92a910a857..ffe53ca530da2b2a1b28c7ee59a7f5599949a0a1 100644
|
||||
index a94b972e328d2eff635de95847dc622c3a58fd9f..954b3725d4f702f284cd8712305a3f97fb90b9c1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -962,6 +962,7 @@ public final class CraftServer implements Server {
|
||||
@@ -963,6 +963,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public void reload() {
|
||||
|
@ -44,7 +44,7 @@ index 5478c159843a74ea90b2b1c4d5eb3c92a910a857..ffe53ca530da2b2a1b28c7ee59a7f559
|
|||
this.reloadCount++;
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile());
|
||||
@@ -1053,6 +1054,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1055,6 +1056,7 @@ public final class CraftServer implements Server {
|
||||
this.enablePlugins(PluginLoadOrder.POSTWORLD);
|
||||
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
|
||||
this.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD));
|
||||
|
|
|
@ -29,10 +29,10 @@ index d90e74b7323a60e781d942baffe9b4bdb8ae2943..08f756b4fbb4732d73ca281b7006024b
|
|||
|
||||
public int getShieldBlockingDelay() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 4f0f21bb1f2d37a798065b7c5e0b2a77a8122823..aa5b67c704a1ae95f4b6e01696c1489c07625d16 100644
|
||||
index 2612e5016646591bb65ac255804b612b348a32fd..c8ac50351b7b1b2f4afc138570b8098a3c0ce1ba 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -201,6 +201,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -202,6 +202,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return blocks.get(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ index 64aa52c2d1fe50d304d75ebb197e8a834016c3cf..7bc0a66602d77902d83d6ca515da48e3
|
|||
|
||||
public int getShieldBlockingDelay() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index aa5b67c704a1ae95f4b6e01696c1489c07625d16..97e76c3701c5e58ff5c8cd0f243efd7998f1c93d 100644
|
||||
index c8ac50351b7b1b2f4afc138570b8098a3c0ce1ba..c0684f1864ece26b4f337ac615db04f615957c13 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -66,7 +66,7 @@ index aa5b67c704a1ae95f4b6e01696c1489c07625d16..97e76c3701c5e58ff5c8cd0f243efd79
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.ArrayList;
|
||||
@@ -226,6 +227,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -227,6 +228,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@ index 5b070d158760789bbcaa984426a55d20767abe4a..e1820a339452cd3388dd7cbb928c5f58
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ffe53ca530da2b2a1b28c7ee59a7f5599949a0a1..6b63938514977f8fdfb019d55f8da28718f4cf1c 100644
|
||||
index 954b3725d4f702f284cd8712305a3f97fb90b9c1..7407d9f3480e0e44be44c84831864e511dfdebc2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2872,6 +2872,16 @@ public final class CraftServer implements Server {
|
||||
@@ -2874,6 +2874,16 @@ public final class CraftServer implements Server {
|
||||
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 6b63938514977f8fdfb019d55f8da28718f4cf1c..ae4e3c137498ff390c8cae7315c7ebfe125efc35 100644
|
||||
index 7407d9f3480e0e44be44c84831864e511dfdebc2..9d07873c4a17549452ac8d9b6ac14d88cde185bc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2915,5 +2915,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2917,5 +2917,10 @@ public final class CraftServer implements Server {
|
||||
profile.getGameProfile().getProperties().putAll(((CraftPlayer) player).getHandle().getGameProfile().getProperties());
|
||||
return profile;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Improve java version check
|
|||
Co-Authored-By: MiniDigger <admin@benndorf.dev>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 446403f73fb1b5687d587889e6f32dce464d05a6..ed167d0d399924d54d9ff99c10ab8ee093efc149 100644
|
||||
index bcc9d3b1503b1be1841c9ab40e879a1cbb0549f2..224b7f5394a568a3982f1e9a554e72af969fbe43 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -203,11 +203,20 @@ public class Main {
|
||||
|
@ -14,8 +14,8 @@ index 446403f73fb1b5687d587889e6f32dce464d05a6..ed167d0d399924d54d9ff99c10ab8ee0
|
|||
}
|
||||
|
||||
- float javaVersion = Float.parseFloat(System.getProperty("java.class.version"));
|
||||
- if (javaVersion > 66.0) {
|
||||
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 22 is supported.");
|
||||
- if (javaVersion > 67.0) {
|
||||
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 23 is supported.");
|
||||
- return;
|
||||
+ // Paper start - Improve java version check
|
||||
+ boolean skip = Boolean.getBoolean("Paper.IgnoreJavaVersion");
|
||||
|
|
|
@ -50,10 +50,10 @@ index 4d91bc4b90a208fec789325dbcec8cc56d1a2a8b..aa4111eef22546f8aa630228c51ef576
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 97e76c3701c5e58ff5c8cd0f243efd7998f1c93d..b6238c327e91a52b77135290762feb8b1085fc7e 100644
|
||||
index c0684f1864ece26b4f337ac615db04f615957c13..05ba1654ec02ff2b518251c128661e3d8dfa4c6d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -968,4 +968,20 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -974,4 +974,20 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(this.getHandle().getUsedItemHand());
|
||||
}
|
||||
// Paper end - active item API
|
||||
|
|
|
@ -184,10 +184,10 @@ index ddc3da84c5a55d2cd977fcdb18121351606a6b3c..53bb62c1dcb487be915759d22e06aea8
|
|||
+ // Paper end - Add tick times API and /mspt command
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ae4e3c137498ff390c8cae7315c7ebfe125efc35..55b11cb574d1fd634b4f445a0605249a296c6779 100644
|
||||
index 9d07873c4a17549452ac8d9b6ac14d88cde185bc..0078d999c132e56c6af242718fc1b983caa8b147 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2686,6 +2686,16 @@ public final class CraftServer implements Server {
|
||||
@@ -2688,6 +2688,16 @@ public final class CraftServer implements Server {
|
||||
return CraftMagicNumbers.INSTANCE;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
|
|||
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 55b11cb574d1fd634b4f445a0605249a296c6779..01415a1523a783d8581e463dcea4f96ff8d0807e 100644
|
||||
index 0078d999c132e56c6af242718fc1b983caa8b147..7226c506c902fc94f27cc5d444e25882138759c2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2930,5 +2930,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2932,5 +2932,10 @@ public final class CraftServer implements Server {
|
||||
public int getCurrentTick() {
|
||||
return net.minecraft.server.MinecraftServer.currentTick;
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization
|
|||
Serializes using NBT which is safer for server data migrations than bukkits format.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index d08b01fef9928f2239c8663cf90219dc7acad58c..af706146a26ede6b9f5a39c8deb490ff25334ae6 100644
|
||||
index 432f019afff36aa6143c052f7387a6c275a09de8..8b11f5f8cec74c57d614d73233a449c97cd56d18 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -458,6 +458,53 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -464,6 +464,53 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
||||
return new com.destroystokyo.paper.PaperVersionFetcher();
|
||||
}
|
||||
|
|
|
@ -7,10 +7,10 @@ Subject: [PATCH] Don't crash if player is attempted to be removed from
|
|||
I suspect it deals with teleporting as it uses players current x/y/z
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
index 3d46412b307f08968bb9b96c0649e0405813462e..56aa26bb8d0bfbd3c799163fa620259e6455c89b 100644
|
||||
index dfa0456f352ce25bc4edd1b0f04ca5a14434d7fa..1e7b440cc2c1bf53210069b38286f67a7b97041b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
@@ -270,8 +270,8 @@ public abstract class DistanceManager {
|
||||
@@ -275,8 +275,8 @@ public abstract class DistanceManager {
|
||||
ObjectSet<ServerPlayer> objectset = (ObjectSet) this.playersPerChunk.get(i);
|
||||
if (objectset == null) return; // CraftBukkit - SPIGOT-6208
|
||||
|
||||
|
|
|
@ -105,10 +105,10 @@ index 5457358bc76889153036818fdfd70a043ec4e40f..880e5c52746e9e3a9a1f42ec6461be54
|
|||
this.connection.disconnect(ServerConfigurationPacketListenerImpl.DISCONNECT_REASON_INVALID_DATA);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 01415a1523a783d8581e463dcea4f96ff8d0807e..6ea6e3280015a31a1679a874ca63c90be8252a86 100644
|
||||
index 7226c506c902fc94f27cc5d444e25882138759c2..75ea1d68c4be6f73ad05cd53b4e4c0182832395c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1047,6 +1047,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1049,6 +1049,7 @@ public final class CraftServer implements Server {
|
||||
plugin.getDescription().getFullName(),
|
||||
"This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin"
|
||||
));
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement Mob Goal API
|
|||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index e7c00486bd831578008c02fcda13f3a555e6a2f1..688e901b75e95941e0101cc7d0c4effa7993cf3f 100644
|
||||
index 0c349354ba76dfd2c5f16fb232263b18e77a9a40..6c3ed9e685473d7f555ae0e34fb9d4f3873f109a 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -41,6 +41,7 @@ dependencies {
|
||||
|
@ -14,8 +14,8 @@ index e7c00486bd831578008c02fcda13f3a555e6a2f1..688e901b75e95941e0101cc7d0c4effa
|
|||
|
||||
+ testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
||||
testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0")
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
testImplementation("org.mockito:mockito-core:5.11.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..c99eafab2103c7f5bca7ffba68a10bd853df055f
|
||||
|
@ -782,10 +782,10 @@ index 6667ecc4b7eded4e20a415cef1e1b1179e6710b8..16f9a98b8a939e5ca7e2dc04f87134a7
|
|||
LOOK,
|
||||
JUMP,
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 6ea6e3280015a31a1679a874ca63c90be8252a86..48c3d926682dd72ba476b4afc9e44e0113af0b46 100644
|
||||
index 75ea1d68c4be6f73ad05cd53b4e4c0182832395c..2b3eaeea881b12fe7e4c5150815ad00fe9f026e0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2936,5 +2936,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2938,5 +2938,11 @@ public final class CraftServer implements Server {
|
||||
public boolean isStopping() {
|
||||
return net.minecraft.server.MinecraftServer.getServer().hasStopped();
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix PotionEffect ignores icon flag
|
|||
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index b6238c327e91a52b77135290762feb8b1085fc7e..b1c4970920ca8972f637c846106ae37822e495cf 100644
|
||||
index 05ba1654ec02ff2b518251c128661e3d8dfa4c6d..733c69a2cfa60fb8c920400e3d9acfc2465090e5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -484,7 +484,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -485,7 +485,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
||||
@Override
|
||||
public boolean addPotionEffect(PotionEffect effect, boolean force) {
|
||||
|
@ -18,7 +18,7 @@ index b6238c327e91a52b77135290762feb8b1085fc7e..b1c4970920ca8972f637c846106ae378
|
|||
return true;
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -506,7 +506,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@Override
|
||||
public PotionEffect getPotionEffect(PotionEffectType type) {
|
||||
MobEffectInstance handle = this.getHandle().getEffect(CraftPotionEffectType.bukkitToMinecraftHolder(type));
|
||||
|
@ -27,7 +27,7 @@ index b6238c327e91a52b77135290762feb8b1085fc7e..b1c4970920ca8972f637c846106ae378
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -517,7 +517,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -518,7 +518,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public Collection<PotionEffect> getActivePotionEffects() {
|
||||
List<PotionEffect> effects = new ArrayList<PotionEffect>();
|
||||
for (MobEffectInstance handle : this.getHandle().activeEffects.values()) {
|
||||
|
|
|
@ -22,10 +22,10 @@ index 8b17df3d18fe9acc1a7b10c6809886da0143f8c5..0370d26bd1e1d2fe1d640b052aca8a9c
|
|||
// CraftBukkit end
|
||||
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.shutdown(); // Paper - Plugin remapping
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 48c3d926682dd72ba476b4afc9e44e0113af0b46..610661dec58b9170d2eb2093c7fab81585ff9a2c 100644
|
||||
index 2b3eaeea881b12fe7e4c5150815ad00fe9f026e0..e56f4b254af45311acb0b55195dcbd9f372cae98 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1058,6 +1058,32 @@ public final class CraftServer implements Server {
|
||||
@@ -1060,6 +1060,32 @@ public final class CraftServer implements Server {
|
||||
org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload
|
||||
}
|
||||
|
||||
|
|
|
@ -89,10 +89,10 @@ index e242ca5ec8c50bfd81b8ab1429e6e4e441025a75..d2eb8c619905d87a38820a4c1179ad93
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 610661dec58b9170d2eb2093c7fab81585ff9a2c..89c4763b990ca9e801ee16c4a50e806740d061d9 100644
|
||||
index e56f4b254af45311acb0b55195dcbd9f372cae98..ac3931f7d992d3675403e3b525f3cd9928cf7ed4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -996,8 +996,8 @@ public final class CraftServer implements Server {
|
||||
@@ -998,8 +998,8 @@ public final class CraftServer implements Server {
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
|
@ -104,7 +104,7 @@ index 610661dec58b9170d2eb2093c7fab81585ff9a2c..89c4763b990ca9e801ee16c4a50e8067
|
|||
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
|
||||
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index c681b83ce59e6edfabd4d42da410f622747d9a6e..347016873354286ac3ec953049bca2cd21680911 100644
|
||||
index 2d6b24220057ea9a510dc86161cbaf909c061699..16e1ae8aaad143ee86f850e654de696dbbb84f30 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1167,7 +1167,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
|
|
@ -22,7 +22,7 @@ wants it to collect even faster, they can restore that setting back to 1 instead
|
|||
Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 89c4763b990ca9e801ee16c4a50e806740d061d9..0b288cc080869efed42a28be682f7b68f8691416 100644
|
||||
index ac3931f7d992d3675403e3b525f3cd9928cf7ed4..42ec4aed187b41729a3c985ae440097db0388d3c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -380,7 +380,7 @@ public final class CraftServer implements Server {
|
||||
|
@ -34,7 +34,7 @@ index 89c4763b990ca9e801ee16c4a50e806740d061d9..0b288cc080869efed42a28be682f7b68
|
|||
this.minimumAPI = ApiVersion.getOrCreateVersion(this.configuration.getString("settings.minimum-api"));
|
||||
this.loadIcon();
|
||||
this.loadCompatibilities();
|
||||
@@ -975,7 +975,7 @@ public final class CraftServer implements Server {
|
||||
@@ -976,7 +976,7 @@ public final class CraftServer implements Server {
|
||||
this.console.setMotd(config.motd);
|
||||
this.overrideSpawnLimits();
|
||||
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
|
||||
|
@ -44,7 +44,7 @@ index 89c4763b990ca9e801ee16c4a50e806740d061d9..0b288cc080869efed42a28be682f7b68
|
|||
this.printSaveWarning = false;
|
||||
this.console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 347016873354286ac3ec953049bca2cd21680911..c35fd2fcb6ced6a16816637353d03c88f1d49d1b 100644
|
||||
index 16e1ae8aaad143ee86f850e654de696dbbb84f30..520867fa3d49e421ef5290976a9eed8f58ff7590 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -266,7 +266,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockStateMeta#clearBlockState
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
|
||||
index 301d883a7626e3abd222517400367fc40d6fa2bd..23dbc56edf0d16cf07ced2899942abae28397694 100644
|
||||
index e70b917698b381918b0b30dca7b97d36df28c897..3985e5b4e2d65faa8eaea1d4a2acc6fb1e64f959 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
|
||||
@@ -198,6 +198,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
||||
@@ -239,6 +239,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
||||
return this.blockEntityTag != null;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index b1c4970920ca8972f637c846106ae37822e495cf..cf17328aef60e5c6a0d168d2ed4d181cf47ee0b4 100644
|
||||
index 733c69a2cfa60fb8c920400e3d9acfc2465090e5..fad7d8130f6db70c7bfca9d02027d8a41f5309c1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -984,4 +984,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -990,4 +990,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
}
|
||||
// Paper end - entity jump API
|
||||
|
|
|
@ -93,10 +93,10 @@ index 4921fc085c9d60c74028ef390325e26c598e8df1..4941e0afff8df5f10f06c715b54bf58e
|
|||
case BALL:
|
||||
return FireworkExplosion.Shape.SMALL_BALL;
|
||||
diff --git a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java
|
||||
index 7f8b6462d2a1bbd39a870d2543bebc135f7eb45b..b61b8b8e4fe1b5d905f218bf3b406b1e1af3f6b3 100644
|
||||
index 7f8b6462d2a1bbd39a870d2543bebc135f7eb45b..4001c73e833ebf17baa22463dd197cee8ad67266 100644
|
||||
--- a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java
|
||||
+++ b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java
|
||||
@@ -1,12 +1,28 @@
|
||||
@@ -1,11 +1,29 @@
|
||||
package io.papermc.paper.world;
|
||||
|
||||
import com.destroystokyo.paper.ClientOption;
|
||||
|
@ -116,17 +116,17 @@ index 7f8b6462d2a1bbd39a870d2543bebc135f7eb45b..b61b8b8e4fe1b5d905f218bf3b406b1e
|
|||
+import org.bukkit.MusicInstrument;
|
||||
+import org.bukkit.attribute.Attribute;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.RegistryHelper;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
+import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
-public class TranslationKeyTest {
|
||||
+public class TranslationKeyTest extends AbstractTestingBase {
|
||||
+@AllFeatures
|
||||
public class TranslationKeyTest {
|
||||
|
||||
@Test
|
||||
public void testChatVisibilityKeys() {
|
||||
@@ -15,4 +31,69 @@ public class TranslationKeyTest {
|
||||
@@ -15,4 +33,69 @@ public class TranslationKeyTest {
|
||||
Assertions.assertEquals(ChatVisiblity.valueOf(chatVisibility.name()).getKey(), chatVisibility.translationKey(), chatVisibility + "'s translation key doesn't match");
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ index 7f8b6462d2a1bbd39a870d2543bebc135f7eb45b..b61b8b8e4fe1b5d905f218bf3b406b1e
|
|||
+
|
||||
+ @Test
|
||||
+ public void testBiome() {
|
||||
+ for (Map.Entry<ResourceKey<Biome>, Biome> nms : AbstractTestingBase.BIOMES.entrySet()) {
|
||||
+ for (Map.Entry<ResourceKey<Biome>, Biome> nms : RegistryHelper.getBiomes().entrySet()) {
|
||||
+ org.bukkit.block.Biome bukkit = org.bukkit.block.Biome.valueOf(nms.getKey().location().getPath().toUpperCase(Locale.ROOT));
|
||||
+ Assertions.assertEquals(nms.getKey().location().toLanguageKey("biome"), bukkit.translationKey(), "translation key mismatch for " + bukkit);
|
||||
+ }
|
||||
|
|
|
@ -94,10 +94,10 @@ index 34321f095e12ea0cca34ff1ec00819c6350205a8..5f5788a502642463091fb76e98703aae
|
|||
this.entity.setYHeadRot(location.getYaw());
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index cf17328aef60e5c6a0d168d2ed4d181cf47ee0b4..3cd21778018db5e05ee26ba35c34a89619b3d1d8 100644
|
||||
index fad7d8130f6db70c7bfca9d02027d8a41f5309c1..8a8189e8f2f201880748eb79805bb0b33688e814 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -590,6 +590,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -596,6 +596,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
|
||||
((AbstractHurtingProjectile) launch).projectileSource = this;
|
||||
|
|
|
@ -21,10 +21,10 @@ index f1383906dbd16e088f57c9c77c051c8501b155cc..c01a9305eb1c3e2ee5effab1e11980c2
|
|||
+ // Paper end - Expose entity id counter
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index af706146a26ede6b9f5a39c8deb490ff25334ae6..a557b40e1807933cf510ea489ebcab4a19c066c1 100644
|
||||
index 8b11f5f8cec74c57d614d73233a449c97cd56d18..d7e8663e21ade1b53d4b936147f57b632f67a156 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -505,6 +505,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -511,6 +511,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
|
||||
return compound;
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String)
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 0b288cc080869efed42a28be682f7b68f8691416..ae594610d1c5665aa142522a9cbb97cf6e4d10f2 100644
|
||||
index 42ec4aed187b41729a3c985ae440097db0388d3c..25bfb93568ea0a6c0b827c6d6a736f950981144e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1963,6 +1963,28 @@ public final class CraftServer implements Server {
|
||||
@@ -1965,6 +1965,28 @@ public final class CraftServer implements Server {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,10 +87,10 @@ index 89982d25f60c8b60ba91e559ef88278f338fe215..0efc8d997b34302c3e0a5d7ec73a11a9
|
|||
|
||||
public ItemStack getBaseCostA() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
|
||||
index 86c5bc01d5b87b4301fb83d55cf3046985c45d0f..c9e23a71a35214c363318c48d38c49b695d1ffd4 100644
|
||||
index bc1a92707c65474c1464d6f7c3a3265df6195228..e86cee25703a3c02ef62e302816253c360d557f3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
|
||||
@@ -22,11 +22,19 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
@@ -24,11 +24,19 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
|
||||
@Deprecated
|
||||
public CraftMerchantRecipe(ItemStack result, int uses, int maxUses, boolean experienceReward, int experience, float priceMultiplier) {
|
||||
|
@ -112,7 +112,7 @@ index 86c5bc01d5b87b4301fb83d55cf3046985c45d0f..c9e23a71a35214c363318c48d38c49b6
|
|||
this.handle = new net.minecraft.world.item.trading.MerchantOffer(
|
||||
new ItemCost(Items.AIR),
|
||||
Optional.empty(),
|
||||
@@ -36,6 +44,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
@@ -38,6 +46,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
experience,
|
||||
priceMultiplier,
|
||||
demand,
|
||||
|
@ -120,7 +120,7 @@ index 86c5bc01d5b87b4301fb83d55cf3046985c45d0f..c9e23a71a35214c363318c48d38c49b6
|
|||
this
|
||||
);
|
||||
this.setSpecialPrice(specialPrice);
|
||||
@@ -112,6 +121,18 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
@@ -114,6 +123,18 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
this.handle.priceMultiplier = priceMultiplier;
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ index 86c5bc01d5b87b4301fb83d55cf3046985c45d0f..c9e23a71a35214c363318c48d38c49b6
|
|||
public net.minecraft.world.item.trading.MerchantOffer toMinecraft() {
|
||||
List<ItemStack> ingredients = this.getIngredients();
|
||||
Preconditions.checkState(!ingredients.isEmpty(), "No offered ingredients");
|
||||
@@ -130,7 +151,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
@@ -134,7 +155,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
if (recipe instanceof CraftMerchantRecipe) {
|
||||
return (CraftMerchantRecipe) recipe;
|
||||
} else {
|
||||
|
|
|
@ -15,10 +15,10 @@ manually reload the advancement data for all players, which
|
|||
normally takes place as a part of the datapack reloading.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index a557b40e1807933cf510ea489ebcab4a19c066c1..481aeb922952578ea68ce2425c84e1a93eff0cf9 100644
|
||||
index d7e8663e21ade1b53d4b936147f57b632f67a156..66249c5caefb0879e13c02d5553b09b4122418b9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -317,7 +317,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -323,7 +323,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex);
|
||||
}
|
||||
|
||||
|
|
|
@ -76,10 +76,10 @@ index 9953b6b36cbcbfd1756bac478b568ca5700fc898..33869e725c3b3f2120fa36ca468019a7
|
|||
}
|
||||
diff --git a/src/test/java/io/papermc/paper/block/CraftBlockDataDestroySpeedTest.java b/src/test/java/io/papermc/paper/block/CraftBlockDataDestroySpeedTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..62aef9abab896491f7806490184fc6899ec36c57
|
||||
index 0000000000000000000000000000000000000000..32d38205a5a72c3c1838ed28cb83bcea5ad59b6b
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/block/CraftBlockDataDestroySpeedTest.java
|
||||
@@ -0,0 +1,137 @@
|
||||
@@ -0,0 +1,138 @@
|
||||
+package io.papermc.paper.block;
|
||||
+
|
||||
+import java.util.List;
|
||||
|
@ -106,7 +106,7 @@ index 0000000000000000000000000000000000000000..62aef9abab896491f7806490184fc689
|
|||
+import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.bukkit.util.Vector;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.junit.jupiter.api.Assertions;
|
||||
|
@ -122,7 +122,8 @@ index 0000000000000000000000000000000000000000..62aef9abab896491f7806490184fc689
|
|||
+ * This test is responsible for ensuring that said logic emits the expected destroy speed under heavy attribute
|
||||
+ * modifier use.
|
||||
+ */
|
||||
+public class CraftBlockDataDestroySpeedTest extends AbstractTestingBase {
|
||||
+@AllFeatures
|
||||
+public class CraftBlockDataDestroySpeedTest {
|
||||
+
|
||||
+ @Test
|
||||
+ public void testCorrectEnchantmentDestroySpeedComputation() {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 3cd21778018db5e05ee26ba35c34a89619b3d1d8..5e8225a6ae004795b4d44c4f88f262664f632589 100644
|
||||
index 8a8189e8f2f201880748eb79805bb0b33688e814..925c842fcf546ad270641b3be7e8a8c432571501 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -942,6 +942,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -948,6 +948,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return this.getHandle().getUseItem().asBukkitMirror();
|
||||
}
|
||||
|
||||
|
|
|
@ -88,14 +88,20 @@ index a9ea2e38e4673686c9994a58c94ad19e59fd423c..52649f82351ab4f675c3cc3cd6640956
|
|||
|
||||
diff --git a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ca71c688b37ce2c8b712a4f9216cf872c8edf78e
|
||||
index 0000000000000000000000000000000000000000..75ed5050f72c001d6eab117a2c0b352a413548bd
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
|
||||
@@ -0,0 +1,82 @@
|
||||
@@ -0,0 +1,83 @@
|
||||
+package io.papermc.paper.permissions;
|
||||
+
|
||||
+import com.mojang.brigadier.tree.CommandNode;
|
||||
+import com.mojang.brigadier.tree.RootCommandNode;
|
||||
+import java.io.PrintStream;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.LinkedHashSet;
|
||||
+import java.util.List;
|
||||
+import java.util.Set;
|
||||
+import java.util.TreeSet;
|
||||
+import net.minecraft.commands.CommandBuildContext;
|
||||
+import net.minecraft.commands.CommandSourceStack;
|
||||
+import net.minecraft.commands.Commands;
|
||||
|
@ -105,21 +111,16 @@ index 0000000000000000000000000000000000000000..ca71c688b37ce2c8b712a4f9216cf872
|
|||
+import org.bukkit.craftbukkit.command.VanillaCommandWrapper;
|
||||
+import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
|
||||
+import org.bukkit.permissions.Permission;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.RegistryHelper;
|
||||
+import org.bukkit.support.environment.VanillaFeature;
|
||||
+import org.junit.jupiter.api.AfterAll;
|
||||
+import org.junit.jupiter.api.BeforeAll;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import java.io.PrintStream;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.LinkedHashSet;
|
||||
+import java.util.List;
|
||||
+import java.util.Set;
|
||||
+import java.util.TreeSet;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
+
|
||||
+public class MinecraftCommandPermissionsTest extends AbstractTestingBase {
|
||||
+@VanillaFeature
|
||||
+public class MinecraftCommandPermissionsTest {
|
||||
+
|
||||
+ private static PrintStream old;
|
||||
+ @BeforeAll
|
||||
|
@ -133,7 +134,7 @@ index 0000000000000000000000000000000000000000..ca71c688b37ce2c8b712a4f9216cf872
|
|||
+ CraftDefaultPermissions.registerCorePermissions();
|
||||
+ Set<String> perms = collectMinecraftCommandPerms();
|
||||
+
|
||||
+ Commands commands = new Commands(Commands.CommandSelection.DEDICATED, CommandBuildContext.simple(AbstractTestingBase.REGISTRY_CUSTOM, FeatureFlags.VANILLA_SET));
|
||||
+ Commands commands = new Commands(Commands.CommandSelection.DEDICATED, CommandBuildContext.simple(RegistryHelper.getRegistry(), FeatureFlags.VANILLA_SET));
|
||||
+ RootCommandNode<CommandSourceStack> root = commands.getDispatcher().getRoot();
|
||||
+ Set<String> missing = new LinkedHashSet<>();
|
||||
+ Set<String> foundPerms = new HashSet<>();
|
||||
|
|
|
@ -36,10 +36,10 @@ index 6cda13df52ee4d56dd1d3c213307bfd38175584c..24aa891ffa9115c05439b06aece85df7
|
|||
public int getSleepTicks() {
|
||||
return this.getHandle().sleepCounter;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 5e8225a6ae004795b4d44c4f88f262664f632589..0e0c65534a782ce8d73d38efd5e2c847f685fb89 100644
|
||||
index 925c842fcf546ad270641b3be7e8a8c432571501..10f3defa8f4b57fb45cf7de06d415b72102e47d5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -999,4 +999,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -1005,4 +1005,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().take(((CraftItem) item).getHandle(), quantity);
|
||||
}
|
||||
// Paper end - pickup animation API
|
||||
|
|
|
@ -559,15 +559,16 @@ index 0000000000000000000000000000000000000000..e4c94d6860e0f5b643cde1ded20b5503
|
|||
+import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
diff --git a/src/main/java/io/papermc/paper/registry/legacy/DelayedRegistry.java b/src/main/java/io/papermc/paper/registry/legacy/DelayedRegistry.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5562e8da5ebaef2a3add46e88d64358b7737b59e
|
||||
index 0000000000000000000000000000000000000000..9400fed345344a0a8e4fb301cca6a1867adf625b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/registry/legacy/DelayedRegistry.java
|
||||
@@ -0,0 +1,55 @@
|
||||
@@ -0,0 +1,61 @@
|
||||
+package io.papermc.paper.registry.legacy;
|
||||
+
|
||||
+import java.util.Iterator;
|
||||
+import java.util.function.Supplier;
|
||||
+import java.util.stream.Stream;
|
||||
+import net.kyori.adventure.key.Key;
|
||||
+import org.bukkit.Keyed;
|
||||
+import org.bukkit.NamespacedKey;
|
||||
+import org.bukkit.Registry;
|
||||
|
@ -604,6 +605,11 @@ index 0000000000000000000000000000000000000000..5562e8da5ebaef2a3add46e88d64358b
|
|||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull T getOrThrow(@NotNull final NamespacedKey key) {
|
||||
+ return this.delegate().getOrThrow(key);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Iterator<T> iterator() {
|
||||
+ return this.delegate().iterator();
|
||||
+ }
|
||||
|
@ -737,7 +743,7 @@ index 1dd22f11b7e2983a3069dea94c0f02b43ff1f736..397bdacab9517354875ebc0bc68d3505
|
|||
String string = Registries.elementsDirPath(type.registryKey());
|
||||
SimpleJsonResourceReloadListener.scanDirectory(resourceManager, string, GSON, map);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
index 06c6342fad78d9c845e9987c460f5990505f5059..d1db491027a5e2d22a6c956b26a974a284d44c57 100644
|
||||
index 6216db1811565e0d25b0d63f579f0a5ba69876a7..3dbdfc2fb973c3c9aecc6582451071e8a939f5f0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
@@ -122,81 +122,12 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
|
||||
|
@ -855,7 +861,7 @@ index 06c6342fad78d9c845e9987c460f5990505f5059..d1db491027a5e2d22a6c956b26a974a2
|
|||
@Override
|
||||
public B get(NamespacedKey namespacedKey) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ae594610d1c5665aa142522a9cbb97cf6e4d10f2..e4fab101b2d10759b9bd65d35715e377236a5989 100644
|
||||
index 25bfb93568ea0a6c0b827c6d6a736f950981144e..f402ef662779e096ee354b9edd66cca785b85f33 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -281,7 +281,7 @@ public final class CraftServer implements Server {
|
||||
|
@ -867,7 +873,7 @@ index ae594610d1c5665aa142522a9cbb97cf6e4d10f2..e4fab101b2d10759b9bd65d35715e377
|
|||
private YamlConfiguration configuration;
|
||||
private YamlConfiguration commandsConfiguration;
|
||||
private final Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
|
||||
@@ -428,6 +428,7 @@ public final class CraftServer implements Server {
|
||||
@@ -429,6 +429,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
private void loadCompatibilities() {
|
||||
|
@ -875,7 +881,7 @@ index ae594610d1c5665aa142522a9cbb97cf6e4d10f2..e4fab101b2d10759b9bd65d35715e377
|
|||
ConfigurationSection compatibilities = this.configuration.getConfigurationSection("settings.compatibility");
|
||||
if (compatibilities == null) {
|
||||
this.activeCompatibilities = Collections.emptySet();
|
||||
@@ -2726,7 +2727,7 @@ public final class CraftServer implements Server {
|
||||
@@ -2728,7 +2729,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public <T extends Keyed> Registry<T> getRegistry(Class<T> aClass) {
|
||||
|
@ -909,16 +915,16 @@ index 1f58b92c17d28e14621e8dc28042a5368f1f4a1f..ef80e6b4dff557daaab1b9fde4d8d401
|
|||
// PatternType
|
||||
private static final FieldRenameData PATTERN_TYPE_DATA = FieldRenameData.Builder.newBuilder()
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index e1b86308f737b957b6d00bc902b91856694b7cbf..0cb2b616e0fa060b7aae6c47502f75ee7647e917 100644
|
||||
index b85223ebff4dbb8aa74b501663afc87ef11e2a96..760f56d36f0e4a74b58628408a286a499d6664ec 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -190,20 +190,10 @@ public class Commodore {
|
||||
@@ -215,20 +215,10 @@ public class Commodore {
|
||||
|
||||
public static byte[] convert(byte[] b, final String pluginName, final ApiVersion pluginVersion, final Set<String> activeCompatibilities) {
|
||||
public byte[] convert(byte[] b, final String pluginName, final ApiVersion pluginVersion, final Set<String> activeCompatibilities) {
|
||||
final boolean modern = pluginVersion.isNewerThanOrSameAs(ApiVersion.FLATTENING);
|
||||
- final boolean enumCompatibility = pluginVersion.isOlderThanOrSameAs(ApiVersion.getOrCreateVersion("1.20.6")) && activeCompatibilities.contains("enum-compatibility-mode");
|
||||
ClassReader cr = new ClassReader(b);
|
||||
ClassWriter cw = new ClassWriter(0); // TODO 2024-06-22: Open PR to ASM to included interface in handle hash
|
||||
ClassWriter cw = new ClassWriter(cr, 0);
|
||||
|
||||
- List<String> methodEnumSignatures = Commodore.getMethodSignatures(b);
|
||||
- Multimap<String, String> enumLessToEnum = HashMultimap.create();
|
||||
|
@ -933,7 +939,7 @@ index e1b86308f737b957b6d00bc902b91856694b7cbf..0cb2b616e0fa060b7aae6c47502f75ee
|
|||
|
||||
visitor = io.papermc.paper.pluginremap.reflect.ReflectionRemapper.visitor(visitor); // Paper
|
||||
cr.accept(new ClassRemapper(new ClassVisitor(Opcodes.ASM9, visitor) {
|
||||
@@ -270,15 +260,6 @@ public class Commodore {
|
||||
@@ -295,15 +285,6 @@ public class Commodore {
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
|
@ -972,22 +978,23 @@ index 543e37737bc6fdca23ed9ed0606805d345515a5a..eef7c125b2689f29cae5464659eacdf3
|
|||
animals: 10
|
||||
diff --git a/src/test/java/io/papermc/paper/registry/LegacyRegistryIdentifierTest.java b/src/test/java/io/papermc/paper/registry/LegacyRegistryIdentifierTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b9d00e65639521eecd44bd2be3e012264c3785f5
|
||||
index 0000000000000000000000000000000000000000..a80b0ded74c0be657e734de61cbf5e32e16c26a8
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/registry/LegacyRegistryIdentifierTest.java
|
||||
@@ -0,0 +1,20 @@
|
||||
@@ -0,0 +1,21 @@
|
||||
+package io.papermc.paper.registry;
|
||||
+
|
||||
+import org.bukkit.GameEvent;
|
||||
+import org.bukkit.MusicInstrument;
|
||||
+import org.bukkit.inventory.meta.trim.TrimPattern;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.environment.VanillaFeature;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
+
|
||||
+@Deprecated
|
||||
+class LegacyRegistryIdentifierTest extends AbstractTestingBase {
|
||||
+@VanillaFeature
|
||||
+class LegacyRegistryIdentifierTest {
|
||||
+
|
||||
+ @Test
|
||||
+ void testSeveralConversions() {
|
||||
|
@ -997,7 +1004,7 @@ index 0000000000000000000000000000000000000000..b9d00e65639521eecd44bd2be3e01226
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java b/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java
|
||||
index e1c14886064cde56be7fcd8f22a6ecb2d222a762..69cece1537bb558b80e1947fdb1fe25555e82628 100644
|
||||
index fe52d229c31526cc32f6422328efe92edf75a7ff..67dadb1765a5ef9a391a459224e233f38201f5d5 100644
|
||||
--- a/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java
|
||||
+++ b/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java
|
||||
@@ -1,15 +1,19 @@
|
||||
|
@ -1009,8 +1016,9 @@ index e1c14886064cde56be7fcd8f22a6ecb2d222a762..69cece1537bb558b80e1947fdb1fe255
|
|||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
+import org.bukkit.Keyed;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
-import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.RegistryHelper;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
|
@ -1019,10 +1027,10 @@ index e1c14886064cde56be7fcd8f22a6ecb2d222a762..69cece1537bb558b80e1947fdb1fe255
|
|||
+import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class RegistryKeyTest extends AbstractTestingBase {
|
||||
@@ -28,6 +32,12 @@ class RegistryKeyTest extends AbstractTestingBase {
|
||||
@AllFeatures
|
||||
@@ -29,6 +33,12 @@ class RegistryKeyTest {
|
||||
void testApiRegistryKeysExist(final RegistryKey<?> key) {
|
||||
final Optional<Registry<Object>> registry = AbstractTestingBase.REGISTRY_CUSTOM.registry(ResourceKey.createRegistryKey(ResourceLocation.parse(key.key().asString())));
|
||||
final Optional<Registry<Object>> registry = RegistryHelper.getRegistry().registry(ResourceKey.createRegistryKey(ResourceLocation.parse(key.key().asString())));
|
||||
assertTrue(registry.isPresent(), "Missing vanilla registry for " + key.key().asString());
|
||||
+ }
|
||||
|
||||
|
@ -1034,14 +1042,14 @@ index e1c14886064cde56be7fcd8f22a6ecb2d222a762..69cece1537bb558b80e1947fdb1fe255
|
|||
}
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java b/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java
|
||||
index 4adaafafb7140e983a4e90f0ff0deaaf0887a9a5..0dd775ad1bd0bf9ba7ea05255d543a9df8b5fcfd 100644
|
||||
index b65a3ee68c177da7ef5a57608187dc1672257c7f..c1016e0eb00e952551370c874e8d678fef8ba3dc 100644
|
||||
--- a/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java
|
||||
+++ b/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java
|
||||
@@ -21,14 +21,17 @@ public class RegistryArgumentAddedTest extends AbstractTestingBase {
|
||||
@@ -22,14 +22,17 @@ public class RegistryArgumentAddedTest {
|
||||
// Make sure every registry is created
|
||||
Class.forName(Registry.class.getName());
|
||||
|
||||
- Set<Class<?>> loadedRegistries = new HashSet<>(DummyServer.registers.keySet());
|
||||
- Set<Class<?>> loadedRegistries = new HashSet<>(AllFeaturesExtension.getRealRegistries().keySet());
|
||||
- Set<Class<?>> notFound = new HashSet<>();
|
||||
+ // Paper start
|
||||
+ Set<io.papermc.paper.registry.RegistryKey<?>> loadedRegistries = java.util.Collections.newSetFromMap(new java.util.IdentityHashMap<>());
|
||||
|
@ -1059,10 +1067,10 @@ index 4adaafafb7140e983a4e90f0ff0deaaf0887a9a5..0dd775ad1bd0bf9ba7ea05255d543a9d
|
|||
if (!loadedRegistries.remove(clazz)) {
|
||||
notFound.add(clazz);
|
||||
diff --git a/src/test/java/org/bukkit/registry/RegistryConversionTest.java b/src/test/java/org/bukkit/registry/RegistryConversionTest.java
|
||||
index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cdf4e45504 100644
|
||||
index e97328b95973db52d44bc4d0aefd8eb69f2ebdea..01e351f4e292efe78fc1a1db0f31b2c0a313b101 100644
|
||||
--- a/src/test/java/org/bukkit/registry/RegistryConversionTest.java
|
||||
+++ b/src/test/java/org/bukkit/registry/RegistryConversionTest.java
|
||||
@@ -40,9 +40,9 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -41,9 +41,9 @@ public class RegistryConversionTest {
|
||||
|
||||
@Order(1)
|
||||
@RegistriesTest
|
||||
|
@ -1074,7 +1082,7 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
|
||||
for (Keyed item : registry) {
|
||||
if (!(item instanceof Handleable<?>)) {
|
||||
@@ -62,7 +62,7 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -63,7 +63,7 @@ public class RegistryConversionTest {
|
||||
|
||||
@Order(2)
|
||||
@RegistriesTest
|
||||
|
@ -1083,7 +1091,7 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
Class<? extends Keyed> craftClazz, Class<?> minecraftClazz, boolean newMethod) {
|
||||
String methodName = (newMethod) ? RegistryConversionTest.MINECRAFT_TO_BUKKIT_NEW : RegistryConversionTest.MINECRAFT_TO_BUKKIT;
|
||||
Method method = null;
|
||||
@@ -111,7 +111,7 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -112,7 +112,7 @@ public class RegistryConversionTest {
|
||||
|
||||
@Order(2)
|
||||
@RegistriesTest
|
||||
|
@ -1092,7 +1100,7 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
Class<? extends Keyed> craftClazz, Class<?> minecraftClazz, boolean newMethod) {
|
||||
String methodName = (newMethod) ? RegistryConversionTest.BUKKIT_TO_MINECRAFT_NEW : RegistryConversionTest.BUKKIT_TO_MINECRAFT;
|
||||
Method method = null;
|
||||
@@ -158,9 +158,9 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -159,9 +159,9 @@ public class RegistryConversionTest {
|
||||
""", minecraftClazz.getName(), methodName, clazz.getSimpleName());
|
||||
}
|
||||
|
||||
|
@ -1104,7 +1112,7 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
this.checkValidMinecraftToBukkit(clazz);
|
||||
|
||||
try {
|
||||
@@ -179,7 +179,7 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -180,7 +180,7 @@ public class RegistryConversionTest {
|
||||
|
||||
@Order(3)
|
||||
@RegistriesTest
|
||||
|
@ -1113,7 +1121,7 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
this.checkValidBukkitToMinecraft(clazz);
|
||||
|
||||
try {
|
||||
@@ -198,14 +198,14 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -199,14 +199,14 @@ public class RegistryConversionTest {
|
||||
|
||||
@Order(3)
|
||||
@RegistriesTest
|
||||
|
@ -1130,7 +1138,7 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
Keyed bukkit = (Keyed) arguments[0];
|
||||
Object minecraft = arguments[1];
|
||||
|
||||
@@ -229,14 +229,14 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -230,14 +230,14 @@ public class RegistryConversionTest {
|
||||
|
||||
@Order(3)
|
||||
@RegistriesTest
|
||||
|
@ -1147,7 +1155,7 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
Keyed bukkit = (Keyed) arguments[0];
|
||||
Object minecraft = arguments[1];
|
||||
|
||||
@@ -264,7 +264,7 @@ public class RegistryConversionTest extends AbstractTestingBase {
|
||||
@@ -265,7 +265,7 @@ public class RegistryConversionTest {
|
||||
*/
|
||||
@Order(3)
|
||||
@RegistriesTest
|
||||
|
@ -1156,22 +1164,85 @@ index e48536683889cdea197746c55b0e67e7e4b9dc68..3216a3549011659a91cc4a0c656a56cd
|
|||
Class<? extends Keyed> craftClazz, Class<?> minecraftClazz) throws IllegalAccessException {
|
||||
this.checkValidMinecraftToBukkit(clazz);
|
||||
|
||||
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
|
||||
index bfbd80b60ac5df500d03c80de57e38aa7548dd46..cce9e2226ef554c10e1df1dbaa1791656d5d0799 100644
|
||||
--- a/src/test/java/org/bukkit/support/DummyServer.java
|
||||
+++ b/src/test/java/org/bukkit/support/DummyServer.java
|
||||
@@ -54,10 +54,7 @@ public final class DummyServer {
|
||||
when(instance.getLootTable(any())).then(mock -> new CraftLootTable(mock.getArgument(0),
|
||||
AbstractTestingBase.DATA_PACK.fullRegistries().getLootTable(ResourceKey.create(Registries.LOOT_TABLE, CraftNamespacedKey.toMinecraft(mock.getArgument(0))))));
|
||||
diff --git a/src/test/java/org/bukkit/support/extension/AllFeaturesExtension.java b/src/test/java/org/bukkit/support/extension/AllFeaturesExtension.java
|
||||
index e9eb521419bbacb03d7000ace355f2a9f5a6a9c5..8fef8421e3cf87913746a314a477634bd3e99300 100644
|
||||
--- a/src/test/java/org/bukkit/support/extension/AllFeaturesExtension.java
|
||||
+++ b/src/test/java/org/bukkit/support/extension/AllFeaturesExtension.java
|
||||
@@ -39,22 +39,7 @@ public class AllFeaturesExtension extends BaseExtension {
|
||||
|
||||
- when(instance.getRegistry(any())).then((Answer<Registry<?>>) mock -> {
|
||||
- Class<? extends Keyed> aClass = mock.getArgument(0);
|
||||
- return registers.computeIfAbsent(aClass, key -> CraftRegistry.createRegistry(aClass, AbstractTestingBase.REGISTRY_CUSTOM));
|
||||
- });
|
||||
+ // Paper - RegistryAccess
|
||||
Bukkit.setServer(server);
|
||||
|
||||
when(instance.getTag(any(), any(), any())).then(mock -> {
|
||||
String registry = mock.getArgument(0);
|
||||
- when(server.getRegistry(any()))
|
||||
- .then(invocation -> {
|
||||
- Class<? extends Keyed> keyed = invocation.getArgument(0);
|
||||
- if (spyRegistries.containsKey(keyed)) {
|
||||
- return spyRegistries.get(keyed);
|
||||
- }
|
||||
-
|
||||
- Registry<?> registry = CraftRegistry.createRegistry(keyed, RegistryHelper.getRegistry());
|
||||
- realRegistries.put(keyed, registry);
|
||||
-
|
||||
- Registry<?> spy = mock(registry.getClass(), withSettings().stubOnly().spiedInstance(registry).defaultAnswer(CALLS_REAL_METHODS));
|
||||
-
|
||||
- spyRegistries.put(keyed, spy);
|
||||
-
|
||||
- return spy;
|
||||
- });
|
||||
+ // Paper - Add RegistryAccess for managing registries - replaced with registry access
|
||||
|
||||
CraftRegistry.setMinecraftRegistry(RegistryHelper.getRegistry());
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/support/extension/LegacyExtension.java b/src/test/java/org/bukkit/support/extension/LegacyExtension.java
|
||||
index 94cf52cf7603e6814682c92b26fcf03a8b927838..c9c3227c3b7fa36ed80f2dc828885a0128e1e3d0 100644
|
||||
--- a/src/test/java/org/bukkit/support/extension/LegacyExtension.java
|
||||
+++ b/src/test/java/org/bukkit/support/extension/LegacyExtension.java
|
||||
@@ -30,11 +30,7 @@ public class LegacyExtension extends BaseExtension {
|
||||
|
||||
Bukkit.setServer(server);
|
||||
|
||||
- when(server.getRegistry(any()))
|
||||
- .then(invocation -> {
|
||||
- Class<? extends Keyed> keyed = invocation.getArgument(0);
|
||||
- return registries.computeIfAbsent(keyed, k -> CraftRegistry.createRegistry(keyed, RegistryHelper.getRegistry()));
|
||||
- });
|
||||
+ // Paper - Add RegistryAccess for managing registries - replaced with registry access
|
||||
|
||||
CraftRegistry.setMinecraftRegistry(RegistryHelper.getRegistry());
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/support/extension/SlowExtension.java b/src/test/java/org/bukkit/support/extension/SlowExtension.java
|
||||
index e0ce6836d4365c36303f6c675a75ef6a9b047b92..87364f223fbd6185b041138550fcb6e3ed07d1ae 100644
|
||||
--- a/src/test/java/org/bukkit/support/extension/SlowExtension.java
|
||||
+++ b/src/test/java/org/bukkit/support/extension/SlowExtension.java
|
||||
@@ -30,11 +30,7 @@ public class SlowExtension extends BaseExtension {
|
||||
|
||||
Bukkit.setServer(server);
|
||||
|
||||
- when(server.getRegistry(any()))
|
||||
- .then(invocation -> {
|
||||
- Class<? extends Keyed> keyed = invocation.getArgument(0);
|
||||
- return registries.computeIfAbsent(keyed, k -> CraftRegistry.createRegistry(keyed, RegistryHelper.getRegistry()));
|
||||
- });
|
||||
+ // Paper - Add RegistryAccess for managing registries - replaced with registry access
|
||||
|
||||
CraftRegistry.setMinecraftRegistry(RegistryHelper.getRegistry());
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/support/extension/VanillaFeatureExtension.java b/src/test/java/org/bukkit/support/extension/VanillaFeatureExtension.java
|
||||
index bbd5dd5b27937ddc3d8c57f2b604331495b0f311..626c3033e36897846fe84a77d05e2e91a15598e5 100644
|
||||
--- a/src/test/java/org/bukkit/support/extension/VanillaFeatureExtension.java
|
||||
+++ b/src/test/java/org/bukkit/support/extension/VanillaFeatureExtension.java
|
||||
@@ -30,11 +30,7 @@ public class VanillaFeatureExtension extends BaseExtension {
|
||||
|
||||
Bukkit.setServer(server);
|
||||
|
||||
- when(server.getRegistry(any()))
|
||||
- .then(invocation -> {
|
||||
- Class<? extends Keyed> keyed = invocation.getArgument(0);
|
||||
- return registries.computeIfAbsent(keyed, k -> CraftRegistry.createRegistry(keyed, RegistryHelper.getRegistry()));
|
||||
- });
|
||||
+ // Paper - Add RegistryAccess for managing registries - replaced with registry access
|
||||
|
||||
CraftRegistry.setMinecraftRegistry(RegistryHelper.getRegistry());
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java b/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java
|
||||
index 185f219b23ac57e15f8d0167b0077b7103a2f3f9..f4ba15a1b4b43822bd81b513af56c6667237c327 100644
|
||||
--- a/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java
|
||||
|
|
|
@ -38,10 +38,10 @@ index 5678d2007d5adf45dec0638c5dd848b601801814..0a7ed5a4f1644a70d8f98ad7a6962b81
|
|||
+ // Paper end - living entity allow attribute registration
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 0e0c65534a782ce8d73d38efd5e2c847f685fb89..6a4e5a08acbadf05f93bd663148a8d2400325da3 100644
|
||||
index 10f3defa8f4b57fb45cf7de06d415b72102e47d5..e56a0d8928e3c0e27b1acd171162e4a53b70d925 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -762,6 +762,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -768,6 +768,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return this.getHandle().craftAttributes.getAttribute(attribute);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ index 1963e826548c5a8859c50f57654784c3aef50e44..04a39cb6c13c26e2cb1d73a9da98df5d
|
|||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e4fab101b2d10759b9bd65d35715e377236a5989..99ff052c1935b9eba5fc519ae18c335893595337 100644
|
||||
index f402ef662779e096ee354b9edd66cca785b85f33..a9c6f53c7e828a4b7d0cefbaa98e50ff1db9354a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1181,9 +1181,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1183,9 +1183,15 @@ public final class CraftServer implements Server {
|
||||
File folder = new File(this.getWorldContainer(), name);
|
||||
World world = this.getWorld(name);
|
||||
|
||||
|
@ -41,7 +41,7 @@ index e4fab101b2d10759b9bd65d35715e377236a5989..99ff052c1935b9eba5fc519ae18c3358
|
|||
|
||||
if (folder.exists()) {
|
||||
Preconditions.checkArgument(folder.isDirectory(), "File (%s) exists and isn't a folder", name);
|
||||
@@ -1309,7 +1315,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1311,7 +1317,7 @@ public final class CraftServer implements Server {
|
||||
} else if (name.equals(levelName + "_the_end")) {
|
||||
worldKey = net.minecraft.world.level.Level.END;
|
||||
} else {
|
||||
|
@ -50,7 +50,7 @@ index e4fab101b2d10759b9bd65d35715e377236a5989..99ff052c1935b9eba5fc519ae18c3358
|
|||
}
|
||||
|
||||
// If set to not keep spawn in memory (changed from default) then adjust rule accordingly
|
||||
@@ -1405,6 +1411,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1407,6 +1413,15 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -67,10 +67,10 @@ index e4fab101b2d10759b9bd65d35715e377236a5989..99ff052c1935b9eba5fc519ae18c3358
|
|||
// Check if a World already exists with the UID.
|
||||
if (this.getWorld(world.getUID()) != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 481aeb922952578ea68ce2425c84e1a93eff0cf9..b075d4b21b53a3f39094444e4024556b23e399f2 100644
|
||||
index 66249c5caefb0879e13c02d5553b09b4122418b9..79915a93b36ddf2925444369a5df4e8f4fd5610e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -516,6 +516,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -522,6 +522,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public int nextEntityId() {
|
||||
return net.minecraft.world.entity.Entity.nextEntityId();
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose protocol version
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index b075d4b21b53a3f39094444e4024556b23e399f2..f833fcead688180daf7039e09dce46fde924043c 100644
|
||||
index 79915a93b36ddf2925444369a5df4e8f4fd5610e..09fa524fa1155d53d988c15c1af551f73c96ede5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -521,6 +521,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -527,6 +527,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public String getMainLevelName() {
|
||||
return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ index 0000000000000000000000000000000000000000..caa41c525d2b36b5a9f9942380f06c97
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 99ff052c1935b9eba5fc519ae18c335893595337..1b320ab17379da9b82320e63babb0f395d4b85a8 100644
|
||||
index a9c6f53c7e828a4b7d0cefbaa98e50ff1db9354a..a142c62a51ddf59e968c3ddb401dc137c4c07ef6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -305,6 +305,7 @@ public final class CraftServer implements Server {
|
||||
|
@ -187,7 +187,7 @@ index 99ff052c1935b9eba5fc519ae18c335893595337..1b320ab17379da9b82320e63babb0f39
|
|||
public static Exception excessiveVelEx; // Paper - Velocity warnings
|
||||
|
||||
static {
|
||||
@@ -389,6 +390,7 @@ public final class CraftServer implements Server {
|
||||
@@ -390,6 +391,7 @@ public final class CraftServer implements Server {
|
||||
if (this.configuration.getBoolean("settings.use-map-color-cache")) {
|
||||
MapPalette.setMapColorCache(new CraftMapColorCache(this.logger));
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ index 99ff052c1935b9eba5fc519ae18c335893595337..1b320ab17379da9b82320e63babb0f39
|
|||
}
|
||||
|
||||
public boolean getCommandBlockOverride(String command) {
|
||||
@@ -3006,5 +3008,11 @@ public final class CraftServer implements Server {
|
||||
@@ -3008,5 +3010,11 @@ public final class CraftServer implements Server {
|
||||
public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
|
||||
return mobGoals;
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index f833fcead688180daf7039e09dce46fde924043c..07de1316b65e71ab0a372f1a51ae3bc6953d6530 100644
|
||||
index 09fa524fa1155d53d988c15c1af551f73c96ede5..78d1b33a554ac8ca0f76585c6b97e35c2d337293 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -526,6 +526,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -532,6 +532,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public int getProtocolVersion() {
|
||||
return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion();
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ index f833fcead688180daf7039e09dce46fde924043c..07de1316b65e71ab0a372f1a51ae3bc6
|
|||
@Override
|
||||
diff --git a/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java b/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9f8abe2376f16aeffe4e9f90a2da04b7e3a55429
|
||||
index 0000000000000000000000000000000000000000..04e2568816f1fbe090b40e5a55d8d4effc045740
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java
|
||||
@@ -0,0 +1,41 @@
|
||||
|
@ -33,14 +33,14 @@ index 0000000000000000000000000000000000000000..9f8abe2376f16aeffe4e9f90a2da04b7
|
|||
+
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.environment.VanillaFeature;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
+import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
+
|
||||
+public class ItemStackRepairCheckTest extends AbstractTestingBase {
|
||||
+@VanillaFeature
|
||||
+public class ItemStackRepairCheckTest {
|
||||
+
|
||||
+ @Test
|
||||
+ public void testIsRepariableBy() {
|
||||
|
|
|
@ -65,10 +65,10 @@ index 66d773cadb74f9176e6cf68a565568034f52ec63..a1f2b9d40d374e8cdbaf916b25fa74b6
|
|||
return defaultAttributes.build();
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 07de1316b65e71ab0a372f1a51ae3bc6953d6530..c09c494ebe7a0c13b8bce4234a23a92c300153f9 100644
|
||||
index 78d1b33a554ac8ca0f76585c6b97e35c2d337293..5e8081350b2ec375373d8197bd1f3196652ec9d9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -385,7 +385,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -391,7 +391,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
@Override
|
||||
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot) {
|
||||
|
|
|
@ -45,10 +45,10 @@ index 04a39cb6c13c26e2cb1d73a9da98df5d04df69bc..5d137f8c42356359701e1bea7525f82c
|
|||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 6a4e5a08acbadf05f93bd663148a8d2400325da3..9032f0d30a781ac142e9a3d3a07cc4d4d51fc92f 100644
|
||||
index e56a0d8928e3c0e27b1acd171162e4a53b70d925..637bac756a8f41ed4abd8e3828886c561513e384 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -630,6 +630,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -636,6 +636,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return this.getHandle().hasLineOfSight(((CraftEntity) other).getHandle());
|
||||
}
|
||||
|
||||
|
|
|
@ -828,10 +828,10 @@ index 2cec61a1bb050c1ef81c5fc3d0afafe9ff29d459..97fa4e1e70203194bd939618b2fad926
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 9032f0d30a781ac142e9a3d3a07cc4d4d51fc92f..73719d488d165ec66a0a1f0301a1bd1ba435259a 100644
|
||||
index 637bac756a8f41ed4abd8e3828886c561513e384..19fb8acf614da707f49d922e520e4be93237b2cc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -123,6 +123,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -124,6 +124,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -845,7 +845,7 @@ index 9032f0d30a781ac142e9a3d3a07cc4d4d51fc92f..73719d488d165ec66a0a1f0301a1bd1b
|
|||
@Override
|
||||
public double getAbsorptionAmount() {
|
||||
return this.getHandle().getAbsorptionAmount();
|
||||
@@ -914,14 +921,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -920,14 +927,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
||||
@Override
|
||||
public boolean isInvisible() {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Stinger API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 73719d488d165ec66a0a1f0301a1bd1ba435259a..1f704ba3b67838718913f892d810364ae6a71d54 100644
|
||||
index 19fb8acf614da707f49d922e520e4be93237b2cc..efac0d3ed78c621a52f905b5d7f267b4fb180e65 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -361,6 +361,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -362,6 +362,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ index 73719d488d165ec66a0a1f0301a1bd1ba435259a..1f704ba3b67838718913f892d810364a
|
|||
|
||||
// Paper start - Add methods for working with arrows stuck in living entities
|
||||
@Override
|
||||
@@ -375,6 +380,34 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -376,6 +381,34 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
// Paper end - Add methods for working with arrows stuck in living entities
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityDamageItemEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 7497471649bec04ab8b43dec06b31edd892a5cfb..ad1cb11245108b5cb187b686ed7e6bc769193b52 100644
|
||||
index d1eac70fbfe2d863d3a342ed0e83223c65c36c03..a98d76c90cd855e723e7a8d810eee88a882d8b5c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -646,14 +646,14 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
@ -56,9 +56,9 @@ index 7497471649bec04ab8b43dec06b31edd892a5cfb..ad1cb11245108b5cb187b686ed7e6bc7
|
|||
if (j >= this.getMaxDamage()) {
|
||||
Item item = this.getItem();
|
||||
// CraftBukkit start - Check for item breaking
|
||||
- if (this.count == 1) {
|
||||
- if (this.count == 1 && player != null) {
|
||||
- org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(player, this);
|
||||
+ if (this.count == 1 && player instanceof final ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent
|
||||
+ if (this.count == 1 && player != null && player instanceof final ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(serverPlayer, this); // Paper - Add EntityDamageItemEvent
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
|
|
@ -82,7 +82,7 @@ index 4ea43872f9da72ed959dd0709f959402d01d5fe0..f6f10da21a752e927409ea16076701c4
|
|||
// CraftBukkit end
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java
|
||||
index 8c381e2745e7d5b63e72a60c5541b549f0d1b9bf..38690b28b6f67624d68877c1e89ebe30b402b233 100644
|
||||
index 09f86aec08ec958b8e3015020e9ae213db27d85c..37b39a2c696a59b0f52324cc222b83c0c9f341e6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java
|
||||
@@ -12,12 +12,17 @@ public class CraftSmithingTransformRecipe extends SmithingTransformRecipe implem
|
||||
|
@ -108,12 +108,12 @@ index 8c381e2745e7d5b63e72a60c5541b549f0d1b9bf..38690b28b6f67624d68877c1e89ebe30
|
|||
public void addToCraftingManager() {
|
||||
ItemStack result = this.getResult();
|
||||
|
||||
- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true), CraftItemStack.asNMSCopy(result))));
|
||||
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true), CraftItemStack.asNMSCopy(result), this.willCopyDataComponents()))); // Paper - Option to prevent data components copy
|
||||
- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(this.toNMS(this.getTemplate(), false), this.toNMS(this.getBase(), false), this.toNMS(this.getAddition(), false), CraftItemStack.asNMSCopy(result))));
|
||||
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(this.toNMS(this.getTemplate(), false), this.toNMS(this.getBase(), false), this.toNMS(this.getAddition(), false), CraftItemStack.asNMSCopy(result), this.willCopyDataComponents()))); // Paper - Option to prevent data components copy
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java
|
||||
index 87f20a4811d082f217638768417c1c0feb84f741..5d7782b168138383c606a2c52fbdebe1732364ac 100644
|
||||
index 8245b728d341a64f25357edbd2c3c447b6c0a0cf..389fa313f811279091cace76faaabf8bdb0fc94c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java
|
||||
@@ -12,17 +12,22 @@ public class CraftSmithingTrimRecipe extends SmithingTrimRecipe implements Craft
|
||||
|
@ -137,7 +137,7 @@ index 87f20a4811d082f217638768417c1c0feb84f741..5d7782b168138383c606a2c52fbdebe1
|
|||
|
||||
@Override
|
||||
public void addToCraftingManager() {
|
||||
- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true))));
|
||||
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true), this.willCopyDataComponents()))); // Paper - Option to prevent data components copy
|
||||
- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(this.toNMS(this.getTemplate(), false), this.toNMS(this.getBase(), false), this.toNMS(this.getAddition(), false))));
|
||||
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(this.toNMS(this.getTemplate(), false), this.toNMS(this.getBase(), false), this.toNMS(this.getAddition(), false), this.willCopyDataComponents()))); // Paper - Option to prevent data components copy
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,18 +82,20 @@ index 73c5ffff70605b32188a9bb5fb6c0ee04cb66efe..711d227f5ee6d63356a94a0567968da4
|
|||
|
||||
diff --git a/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..69c9678f8218c240be1044eeabe1c6bef7747b1e
|
||||
index 0000000000000000000000000000000000000000..345c96bfb6c559b41c2b6682067198a74d35b440
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java
|
||||
@@ -0,0 +1,24 @@
|
||||
@@ -0,0 +1,26 @@
|
||||
+package io.papermc.paper.scoreboard;
|
||||
+
|
||||
+import org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations;
|
||||
+import org.bukkit.scoreboard.DisplaySlot;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
+
|
||||
+@Normal
|
||||
+public class DisplaySlotTest {
|
||||
+
|
||||
+ @Test
|
||||
|
|
|
@ -81,10 +81,10 @@ index 0000000000000000000000000000000000000000..ec9ebd2d539333293c51b7edfa18f18b
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index c09c494ebe7a0c13b8bce4234a23a92c300153f9..95a6f26f75efda7db41db9091107502e8d4e0453 100644
|
||||
index 5e8081350b2ec375373d8197bd1f3196652ec9d9..70c06eb6e743232d0e8243b12a927084c6c9414b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -538,6 +538,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -544,6 +544,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
}
|
||||
return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial));
|
||||
}
|
||||
|
@ -105,10 +105,10 @@ index c09c494ebe7a0c13b8bce4234a23a92c300153f9..95a6f26f75efda7db41db9091107502e
|
|||
@Override
|
||||
diff --git a/src/test/java/io/papermc/paper/attribute/EntityTypeAttributesTest.java b/src/test/java/io/papermc/paper/attribute/EntityTypeAttributesTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e8cdfa385230d3de202122e4df5e07f61f80ce75
|
||||
index 0000000000000000000000000000000000000000..f512d416df883036965ff6c802fd242a4c9c8079
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/attribute/EntityTypeAttributesTest.java
|
||||
@@ -0,0 +1,39 @@
|
||||
@@ -0,0 +1,40 @@
|
||||
+package io.papermc.paper.attribute;
|
||||
+
|
||||
+import org.bukkit.attribute.Attributable;
|
||||
|
@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..e8cdfa385230d3de202122e4df5e07f6
|
|||
+import org.bukkit.attribute.AttributeInstance;
|
||||
+import org.bukkit.attribute.AttributeModifier;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
@ -124,12 +124,13 @@ index 0000000000000000000000000000000000000000..e8cdfa385230d3de202122e4df5e07f6
|
|||
+import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
+
|
||||
+public class EntityTypeAttributesTest extends AbstractTestingBase {
|
||||
+@AllFeatures
|
||||
+public class EntityTypeAttributesTest {
|
||||
+
|
||||
+ @Test
|
||||
+ public void testIllegalEntity() {
|
||||
+ assertFalse(EntityType.EGG.hasDefaultAttributes());
|
||||
+ assertThrows(IllegalArgumentException.class, () -> EntityType.EGG.getDefaultAttributes());
|
||||
+ assertThrows(IllegalArgumentException.class, EntityType.EGG::getDefaultAttributes);
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
|
|
|
@ -164,10 +164,10 @@ index 8ca86852319d7463f60832bc98b825b0b4325995..62ada73302c6b3ce3fb2dcc8c31a1d9c
|
|||
|
||||
private final DisplayInfo handle;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 0cb2b616e0fa060b7aae6c47502f75ee7647e917..17d6a4cdd16d34f83e0752c3bdaee08288425a07 100644
|
||||
index 760f56d36f0e4a74b58628408a286a499d6664ec..34e41ea24e1673109f14153a1a0c8e794fed20bb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -435,6 +435,11 @@ public class Commodore {
|
||||
@@ -453,6 +453,11 @@ public class Commodore {
|
||||
super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf);
|
||||
return;
|
||||
}
|
||||
|
@ -181,20 +181,22 @@ index 0cb2b616e0fa060b7aae6c47502f75ee7647e917..17d6a4cdd16d34f83e0752c3bdaee082
|
|||
if (modern) {
|
||||
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..47535c27d7cffc4b5ee6cc9e145b1087477eef79
|
||||
index 0000000000000000000000000000000000000000..6fe9c10ffd1dd5244ead05642609794623054cce
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java
|
||||
@@ -0,0 +1,24 @@
|
||||
@@ -0,0 +1,26 @@
|
||||
+package io.papermc.paper.advancement;
|
||||
+
|
||||
+import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import net.kyori.adventure.text.format.TextColor;
|
||||
+import net.minecraft.advancements.AdvancementType;
|
||||
+import net.minecraft.network.chat.contents.TranslatableContents;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
+
|
||||
+@Normal
|
||||
+public class AdvancementFrameTest {
|
||||
+
|
||||
+ @Test
|
||||
|
|
|
@ -37,10 +37,10 @@ index eabb8b42b890224dd19b879ff276e9908674310d..803a19063c03627dbea79cb1c395ae35
|
|||
+ // Paper end - old getSpawnEgg API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 17d6a4cdd16d34f83e0752c3bdaee08288425a07..157fbe09ab22f3218d9d3f72e8c0a5a3d727eaeb 100644
|
||||
index 34e41ea24e1673109f14153a1a0c8e794fed20bb..63d4ffe93a445abf3c766d4f1f8fbf4a412a2a03 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -442,6 +442,15 @@ public class Commodore {
|
||||
@@ -460,6 +460,15 @@ public class Commodore {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
|
|||
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 836356ecb3c91fd7886ac9ae83f1cc835469e198..f21bf6c8bbf30c59f1588c2105dbd7f80c07a0f1 100644
|
||||
index 65b1833125ce4b1190bf276a69ad4c0c88875d58..4c36bb6f61a75f20df911cd0a8a6ddc84800edd0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2144,6 +2144,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
@ -50,10 +50,10 @@ index 7c04eb9e7eb5ff728465b46e3739eb2598ef1204..6fab713531665298d3b03e7960a17ecb
|
|||
@Override
|
||||
public boolean isInvisible() { // Paper - moved up from LivingEntity
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 95a6f26f75efda7db41db9091107502e8d4e0453..0e849b49329054005c20a5773de2ff15bf3f6e5d 100644
|
||||
index 70c06eb6e743232d0e8243b12a927084c6c9414b..c10273445c4b5ef089f86fc08a944da69d708244 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -488,7 +488,33 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -494,7 +494,33 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.parse(MinecraftServer.getServer().registryAccess(), compound).orElseThrow());
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ index 1cfc906317f07a44f06a4adf021c44e34a2f1d07..6baa313b8201ed23193d7885c85606b0
|
|||
PersistentEntitySectionManager.LOGGER.warn("Entity {} wasn't found in section {} (destroying due to {})", new Object[]{this.entity, SectionPos.of(this.currentSectionKey), reason});
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e165199e30c96e0402c581d389eaae4c0869385f..654935df9dcc80de31caeccdfbeb11010f9dde4b 100644
|
||||
index 16e715c48acc882a9b355d885e181f1dd916fa76..bf4be21f24af1e569267be6413dbee533c153fc5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1760,6 +1760,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
@ -202,10 +202,10 @@ index e165199e30c96e0402c581d389eaae4c0869385f..654935df9dcc80de31caeccdfbeb1101
|
|||
|
||||
ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(ResourceLocation.parse(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 1f704ba3b67838718913f892d810364ae6a71d54..097f03c83a90f476b74834407d2dcd0e98fe010a 100644
|
||||
index efac0d3ed78c621a52f905b5d7f267b4fb180e65..0ed2910e64b6efdb4180c5bc23a146aced87c3d9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -524,6 +524,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -525,6 +525,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
||||
@Override
|
||||
public boolean addPotionEffect(PotionEffect effect, boolean force) {
|
||||
|
|
|
@ -278,10 +278,10 @@ index 58ea6a1f95a09c22125a8262b1b221004ebce0e4..ea6533c1ac218aa075da3401807a06fc
|
|||
BlockPos blockposition = NaturalSpawner.getRandomPosWithin(world, chunk);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e09b0a624a80216db5b6f7882c3765f2eb967b06..b8117fac959a894c9821c82f624bc463174d3568 100644
|
||||
index 36a1b2704debdb8a2f247180d263a1a95bcba24b..b638ccf0e46eeb375a59a42d6f29edd3f084fa17 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2329,6 +2329,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2331,6 +2331,11 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public int getSpawnLimit(SpawnCategory spawnCategory) {
|
||||
|
@ -294,7 +294,7 @@ index e09b0a624a80216db5b6f7882c3765f2eb967b06..b8117fac959a894c9821c82f624bc463
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 654935df9dcc80de31caeccdfbeb11010f9dde4b..d00ceebe07a837cd4b40a76379d1a8eec66e2272 100644
|
||||
index bf4be21f24af1e569267be6413dbee533c153fc5..838ffddba99964748dfe95d68ca93b578bc3292b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1718,9 +1718,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
@ -315,18 +315,20 @@ index 654935df9dcc80de31caeccdfbeb11010f9dde4b..d00ceebe07a837cd4b40a76379d1a8ee
|
|||
}
|
||||
diff --git a/src/test/java/io/papermc/paper/command/subcommands/MobcapsCommandTest.java b/src/test/java/io/papermc/paper/command/subcommands/MobcapsCommandTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..fd238eacee24ebf0d0ce82b96107e093ca4866b0
|
||||
index 0000000000000000000000000000000000000000..6fdc77caa74845786c78a6ba087062b4d698cb82
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/command/subcommands/MobcapsCommandTest.java
|
||||
@@ -0,0 +1,20 @@
|
||||
@@ -0,0 +1,22 @@
|
||||
+package io.papermc.paper.command.subcommands;
|
||||
+
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+import net.minecraft.world.entity.MobCategory;
|
||||
+import org.bukkit.support.environment.Normal;
|
||||
+import org.junit.jupiter.api.Assertions;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+@Normal
|
||||
+public class MobcapsCommandTest {
|
||||
+ @Test
|
||||
+ public void testMobCategoryColors() {
|
||||
|
|
|
@ -25,10 +25,10 @@ index 8169d08c1bccf7c9896bb083eba388f918fac6c9..a514fe98d3d2b65d2cfd029079c69189
|
|||
@Override
|
||||
diff --git a/src/test/java/io/papermc/paper/inventory/CraftMetaTropicalFishBucketTest.java b/src/test/java/io/papermc/paper/inventory/CraftMetaTropicalFishBucketTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a71e1d488a74dcac70b1dca889181527395be9b5
|
||||
index 0000000000000000000000000000000000000000..68a557cedbffb41f27ba21096e2ae5eebbf13f5c
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/inventory/CraftMetaTropicalFishBucketTest.java
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -0,0 +1,41 @@
|
||||
+package io.papermc.paper.inventory;
|
||||
+
|
||||
+import org.bukkit.DyeColor;
|
||||
|
@ -36,11 +36,12 @@ index 0000000000000000000000000000000000000000..a71e1d488a74dcac70b1dca889181527
|
|||
+import org.bukkit.entity.TropicalFish;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.bukkit.inventory.meta.TropicalFishBucketMeta;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.junit.jupiter.api.Assertions;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+public class CraftMetaTropicalFishBucketTest extends AbstractTestingBase {
|
||||
+@AllFeatures
|
||||
+public class CraftMetaTropicalFishBucketTest {
|
||||
+
|
||||
+ @Test
|
||||
+ public void testAllCombinations() {
|
||||
|
|
|
@ -26,7 +26,7 @@ index 48bee70ba4188a4a55beb6584224b0f23784dd88..cbb777f499a4e8a447153c04d09c0c71
|
|||
if (state instanceof InventoryHolder) return (InventoryHolder) state;
|
||||
return null;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
index 302955eed07d3af91f90875583c70a236bbe11b2..f9eb60d5a70da9a4d485288ab03d80829cf171a9 100644
|
||||
index 80bd6e8a6dadb74356a9fa9aa394efbd31c49c37..fe7e3e0628783d8d1be9635b689da8a9cb46c5d7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
@@ -20,7 +20,7 @@ import org.bukkit.persistence.PersistentDataContainer;
|
||||
|
@ -38,7 +38,7 @@ index 302955eed07d3af91f90875583c70a236bbe11b2..f9eb60d5a70da9a4d485288ab03d8082
|
|||
|
||||
private final T tileEntity;
|
||||
private final T snapshot;
|
||||
@@ -188,14 +188,10 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
||||
@@ -196,14 +196,10 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -458,7 +458,7 @@ index 83ac5fc6cbbd249b5865ab203b150f53f01c9f05..b7ff7af2513204b151340538d50a65c8
|
|||
}
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java b/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java
|
||||
index 81d4c8867ebcba1b805be1828e0a6a476963a855..9ff1a8068533ba5fc2fb43188d9a5c544a907618 100644
|
||||
index c032daa6957df2ad8b621379e415ad925f5cc162..a9810c88e05ebc1af60c051faa45e50ee183924f 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java
|
||||
+++ b/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.core.registries.BuiltInRegistries;
|
||||
|
@ -467,9 +467,9 @@ index 81d4c8867ebcba1b805be1828e0a6a476963a855..9ff1a8068533ba5fc2fb43188d9a5c54
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.bukkit.support.environment.AllFeatures;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -41,4 +42,13 @@ public class BlockStateTest extends AbstractTestingBase {
|
||||
@@ -42,4 +43,13 @@ public class BlockStateTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ index 56589fee8dd09783e01f2ae290ffacb5dff3f05f..718b653a118a1c64d07efab93192f10d
|
|||
biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 3c947dc0aea06d66a00aeca51355ea41e8d98f88..60a77bd04489ee592ec61d3d739cb3062c1eefbb 100644
|
||||
index a473993ea48afd05a884e3ffcbdd15abe74580d2..a87a0c9672b53db0e06292c339b3b1e163901942 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -369,7 +369,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
@ -31,10 +31,10 @@ index 3c947dc0aea06d66a00aeca51355ea41e8d98f88..60a77bd04489ee592ec61d3d739cb306
|
|||
chunkgenerator = new NoiseBasedChunkGenerator(worldChunkManager, cga.settings);
|
||||
} else if (chunkgenerator instanceof FlatLevelSource cpf) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b8117fac959a894c9821c82f624bc463174d3568..8364316aac2c13c99244912122c333feeeb5dd06 100644
|
||||
index b638ccf0e46eeb375a59a42d6f29edd3f084fa17..bb232cd338f94b03f2add34766927ecae019e388 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1306,7 +1306,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1308,7 +1308,7 @@ public final class CraftServer implements Server {
|
||||
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
|
||||
LevelStem worlddimension = iregistry.get(actualDimension);
|
||||
|
||||
|
@ -44,7 +44,7 @@ index b8117fac959a894c9821c82f624bc463174d3568..8364316aac2c13c99244912122c333fe
|
|||
biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 0c2734c1d06b6c5dff383f9c6139c0389f220a76..110a5d92d6154bc39c1916006a5cb74798092445 100644
|
||||
index 838ffddba99964748dfe95d68ca93b578bc3292b..bb837f7fa46a7f5926a67ce3f725a328b9bff415 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -212,6 +212,39 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
|
|
@ -62,21 +62,23 @@ index 21d4224c8993f521d6004d708ecbf71fa6d09306..6cf790c9fa23ea313423fdaeb7c181bf
|
|||
if (this == other) {
|
||||
diff --git a/src/test/java/io/papermc/paper/effects/EffectCategoryTest.java b/src/test/java/io/papermc/paper/effects/EffectCategoryTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6262598f85bd7d9af5546cc0a96531b2f4baf64d
|
||||
index 0000000000000000000000000000000000000000..a57e8fdc35efc7e0353d4f36c91578390ee4572e
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/effects/EffectCategoryTest.java
|
||||
@@ -0,0 +1,28 @@
|
||||
@@ -0,0 +1,30 @@
|
||||
+package io.papermc.paper.effects;
|
||||
+
|
||||
+import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import net.minecraft.world.effect.MobEffectCategory;
|
||||
+import org.bukkit.craftbukkit.potion.CraftPotionEffectType;
|
||||
+import org.bukkit.potion.PotionEffectType;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
+import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
+
|
||||
+@AllFeatures
|
||||
+public class EffectCategoryTest {
|
||||
+
|
||||
+ @Test
|
||||
|
|
|
@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 8364316aac2c13c99244912122c333feeeb5dd06..d06e1f67e675034fb5d2ed71f409848155521ada 100644
|
||||
index bb232cd338f94b03f2add34766927ecae019e388..c0eca359919c55ba7b33520277c124eb54d935d7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2160,6 +2160,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2162,6 +2162,13 @@ public final class CraftServer implements Server {
|
||||
return this.console.console;
|
||||
}
|
||||
|
||||
|
|
|
@ -316,10 +316,10 @@ index e76f96a5c48d1eda2f9bbb3e11dd79f23f9ab75c..2b263246135c85aa225120519e9702a6
|
|||
}
|
||||
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..9061ad5868ac18e76ae4d51d23d101c5e25f7f52
|
||||
index 0000000000000000000000000000000000000000..c77345f7e0c9bf179b8b35a8b300085f31fd45af
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/world/structure/StructureSeedConfigTest.java
|
||||
@@ -0,0 +1,75 @@
|
||||
@@ -0,0 +1,77 @@
|
||||
+package io.papermc.paper.world.structure;
|
||||
+
|
||||
+import io.papermc.paper.configuration.PaperConfigurations;
|
||||
|
@ -333,7 +333,8 @@ index 0000000000000000000000000000000000000000..9061ad5868ac18e76ae4d51d23d101c5
|
|||
+import net.minecraft.world.level.levelgen.structure.StructureSet;
|
||||
+import net.minecraft.world.level.levelgen.structure.placement.StructurePlacement;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.bukkit.support.RegistryHelper;
|
||||
+import org.bukkit.support.environment.AllFeatures;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+import org.spigotmc.SpigotConfig;
|
||||
|
@ -341,7 +342,8 @@ index 0000000000000000000000000000000000000000..9061ad5868ac18e76ae4d51d23d101c5
|
|||
+
|
||||
+import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
+
|
||||
+public class StructureSeedConfigTest extends AbstractTestingBase {
|
||||
+@AllFeatures
|
||||
+public class StructureSeedConfigTest {
|
||||
+
|
||||
+ @Test
|
||||
+ public void checkStructureSeedDefaults() throws ReflectiveOperationException {
|
||||
|
@ -354,7 +356,7 @@ index 0000000000000000000000000000000000000000..9061ad5868ac18e76ae4d51d23d101c5
|
|||
+ final SpigotWorldConfig config = PaperConfigurations.SPIGOT_WORLD_DEFAULTS.get();
|
||||
+
|
||||
+
|
||||
+ final Registry<StructureSet> structureSets = AbstractTestingBase.REGISTRY_CUSTOM.registryOrThrow(Registries.STRUCTURE_SET);
|
||||
+ final Registry<StructureSet> structureSets = RegistryHelper.getRegistry().registryOrThrow(Registries.STRUCTURE_SET);
|
||||
+ for (final ResourceKey<StructureSet> setKey : structureSets.registryKeySet()) {
|
||||
+ assertEquals(ResourceLocation.DEFAULT_NAMESPACE, setKey.location().getNamespace());
|
||||
+ final StructureSet set = structureSets.getOrThrow(setKey);
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
|
|||
Copies appropriate checks from CraftWorld#getSpawnLimit
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d06e1f67e675034fb5d2ed71f409848155521ada..87ef72b05f6bbeac7f0fcdb0bb27b359b277898c 100644
|
||||
index c0eca359919c55ba7b33520277c124eb54d935d7..1a2081267e85ef5c1edd4808fbda5bb442a00252 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2337,6 +2337,8 @@ public final class CraftServer implements Server {
|
||||
@@ -2339,6 +2339,8 @@ public final class CraftServer implements Server {
|
||||
@Override
|
||||
public int getSpawnLimit(SpawnCategory spawnCategory) {
|
||||
// Paper start - Add mobcaps commands
|
||||
|
|
|
@ -46,10 +46,10 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 87ef72b05f6bbeac7f0fcdb0bb27b359b277898c..9a513feb638c913ee67ff00036efe8d27c3eb5fb 100644
|
||||
index 1a2081267e85ef5c1edd4808fbda5bb442a00252..8589b0218659ae5ddbaac5437316bf59265324dd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2686,6 +2686,15 @@ public final class CraftServer implements Server {
|
||||
@@ -2688,6 +2688,15 @@ public final class CraftServer implements Server {
|
||||
return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey);
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ index 87ef72b05f6bbeac7f0fcdb0bb27b359b277898c..9a513feb638c913ee67ff00036efe8d2
|
|||
default -> throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
@@ -2718,6 +2727,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2720,6 +2729,13 @@ public final class CraftServer implements Server {
|
||||
net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE;
|
||||
return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList());
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ index 413a37991d1df6314dd9938e5eb5f28f5b69efb8..e7d6f4e6ac41b183c702d5195e4f9413
|
|||
|
||||
if (worlddata.getCustomBossEvents() != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 9a513feb638c913ee67ff00036efe8d27c3eb5fb..65cb367f0824b4045c436dd66809dd9a3eeccbcd 100644
|
||||
index 8589b0218659ae5ddbaac5437316bf59265324dd..74d2f6df5a4cdab8a24ca1769c7b7d98ef87bcfe 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1332,10 +1332,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1334,10 +1334,11 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue