mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-26 18:39:23 +00:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@1f93f566 [ci/skip] Improve getPotentialBedLocation deprecation (#12857) PaperMC/Paper@6fb36e34 Replace compileOnly with implementation for test visibility (#12841) PaperMC/Paper@aa4ef067 Update DataConverter constants for 1.21.8 PaperMC/Paper@f7c59f91 Fix broken resource pack API when configured in configuration stage (#12866) PaperMC/Paper@0dad7f15 Add Bee#set/getTimeSinceSting() methods (#12792) PaperMC/Paper@782ce950 Allow forcing break effects when using breakNaturally (#12734) PaperMC/Paper@a2d37f12 Remove invalid team colors nicely (#12874) PaperMC/Paper@617e5a46 Update to configurate 4.2.0 (#12869) PaperMC/Paper@602ea9f0 Restore previous PlayerToggleSneakEvent behaviour (#12815) PaperMC/Paper@c8a8c0ef feat(plugin): make Plugin extend Namespaced (#12867)
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
implementation("net.kyori:adventure-text-serializer-ansi:4.23.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||
runtimeConfiguration(sourceSets.main.map { it.runtimeClasspath })
|
||||
@@ -143,41 +_,58 @@
|
||||
@@ -143,24 +_,38 @@
|
||||
all its classes to check if they are plugins.
|
||||
Scanning takes about 1-2 seconds so adding this speeds up the server start.
|
||||
*/
|
||||
@@ -112,8 +112,7 @@
|
||||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.24.3")
|
||||
+ // Leaf end - Bump Dependencies
|
||||
implementation("org.ow2.asm:asm-commons:9.8")
|
||||
implementation("org.spongepowered:configurate-yaml:4.2.0-20250225.064233-199")
|
||||
implementation("org.spongepowered:configurate-core:4.2.0-20250225.064233-204") // Pinned dependency of above pinned yaml snapshot.
|
||||
implementation("org.spongepowered:configurate-yaml:4.2.0")
|
||||
|
||||
+ // Purpur start
|
||||
+ implementation("org.mozilla:rhino-runtime:1.7.15")
|
||||
@@ -135,15 +134,7 @@
|
||||
implementation("com.googlecode.json-simple:json-simple:1.1.1") { // change to runtimeOnly once Timings is removed
|
||||
isTransitive = false // includes junit
|
||||
}
|
||||
|
||||
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.9")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.22") // Dreeam TODO - Update to 2.0.1
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.22") // Dreeam TODO - Update to 2.0.1
|
||||
+ // Leaf end - Bump Dependencies
|
||||
|
||||
@@ -168,11 +_,13 @@
|
||||
testImplementation("io.github.classgraph:classgraph:4.8.179") // For mob goal test
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
|
||||
testImplementation("org.junit.platform:junit-platform-suite-engine:1.12.2")
|
||||
@@ -161,7 +152,7 @@
|
||||
|
||||
implementation("net.neoforged:srgutils:1.0.9") // Mappings handling
|
||||
implementation("net.neoforged:AutoRenamingTool:2.0.3") // Remap plugins
|
||||
@@ -188,31 +_,45 @@
|
||||
@@ -183,31 +_,45 @@
|
||||
implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
|
||||
implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
|
||||
|
||||
@@ -216,7 +207,7 @@
|
||||
"Build-Number" to (build ?: ""),
|
||||
"Build-Time" to buildTime.toString(),
|
||||
"Git-Branch" to gitBranch,
|
||||
@@ -271,7 +_,7 @@
|
||||
@@ -266,7 +_,7 @@
|
||||
jvmArgumentProviders.add(provider)
|
||||
}
|
||||
|
||||
@@ -225,7 +216,7 @@
|
||||
idea {
|
||||
module {
|
||||
generatedSourceDirs.add(generatedDir.toFile())
|
||||
@@ -329,6 +_,8 @@
|
||||
@@ -324,6 +_,8 @@
|
||||
val memoryGb = providers.gradleProperty("paper.runMemoryGb").getOrElse("2")
|
||||
minHeapSize = "${memoryGb}G"
|
||||
maxHeapSize = "${memoryGb}G"
|
||||
@@ -234,7 +225,7 @@
|
||||
|
||||
doFirst {
|
||||
workingDir.mkdirs()
|
||||
@@ -391,3 +_,78 @@
|
||||
@@ -386,3 +_,78 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,10 +291,10 @@ index 17f33a309ead525975a3090514a6367260f0af09..f4360d9472ba344f2e7afd6d798d313d
|
||||
Commands.literal("export")
|
||||
.then(
|
||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||
index 8bab2c26e10e8495fd39be470bcb02917fe56f40..e72eda830644851656fae3118c513d7bd701be45 100644
|
||||
index 41005f6b9f53a9c1125ad5e08538d9f5aacb3571..411e1284a208ca1a097cf6eaa92e1e0d2203d83d 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -579,11 +579,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -580,11 +580,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world
|
||||
private static int joinAttemptsThisTick; // Paper - Buffer joins to world
|
||||
private static int currTick; // Paper - Buffer joins to world
|
||||
@@ -1313,7 +1313,7 @@ index de630a692291926c52a0947f9943e59433ab130a..ca9ba2a2535eab66622230778efdf941
|
||||
this.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
|
||||
}
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 3f1f68ed20ec6c944f031afc74052e63594e84e6..6fc36c917bee5453e4aadd018389893c0f5dd6f4 100644
|
||||
index 04d6647ca0d9c69054bc2f1fdacc80497e0a7804..51e2aad2034c289e7f6838cb7ac6686593072903 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -338,6 +338,20 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1570,7 +1570,7 @@ index f9fad100d3e5e4b44a5b0f88e288e6fac7a250f7..6d320ed179393e47398c44f2ba2b2285
|
||||
}
|
||||
} catch (AuthenticationUnavailableException var4) {
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 92b92476835d6de2a5db89529d58fd0b3067bac6..5d65f070fe622ed27f4fc26688589a8701de8782 100644
|
||||
index 77f74c35b0221fb6b14cc1d6acdb77c6bf8f68c6..7d1d455e67cab4eba3473b7111e30e9b1dcc282c 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -412,6 +412,7 @@ public abstract class PlayerList {
|
||||
@@ -3693,7 +3693,7 @@ index cdf44c2586db396f1afdcbae4174b8b4fb00f48e..4d99a1bf2dc141630a76942ccbf1f608
|
||||
animal.resetLove();
|
||||
level.broadcastEntityEvent(this, (byte)18);
|
||||
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
|
||||
index d40954f03c865bfbc5beb308bbcf7b7c9ac48eb9..ca5651f15552f91fba650747d28a75c00fa11442 100644
|
||||
index 13f24836649790a34b988e2d63accb043e6ff080..7573f1be88ca23096e02efe2fa933429fa4421ba 100644
|
||||
--- a/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -150,6 +150,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
|
||||
@@ -26,18 +26,18 @@ Locally this patch drops the entity tracker tick by a full 1.5x.
|
||||
Co-authored-by: Quang Tran <3d7777456@gmail.com>
|
||||
|
||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||
index e72eda830644851656fae3118c513d7bd701be45..01fb1bf0eba70b740b12731c79feadefc8fe96f0 100644
|
||||
index 411e1284a208ca1a097cf6eaa92e1e0d2203d83d..ce7013f14f78b0d28806c91679cfe56f02998ee6 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -148,6 +148,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
public @Nullable net.minecraft.server.level.ServerPlayer savedPlayerForLoginEventLegacy; // Paper - playerloginevent
|
||||
@@ -149,6 +149,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
public @Nullable org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper
|
||||
// Paper start - Optimize network
|
||||
public boolean isPending = true;
|
||||
+ private io.netty.channel.SingleThreadEventLoop eventLoop; // Paper - optimise packets that are not flushed
|
||||
public boolean queueImmunity;
|
||||
// Paper end - Optimize network
|
||||
|
||||
@@ -159,6 +160,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -160,6 +161,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
public void channelActive(ChannelHandlerContext context) throws Exception {
|
||||
super.channelActive(context);
|
||||
this.channel = context.channel();
|
||||
@@ -45,7 +45,7 @@ index e72eda830644851656fae3118c513d7bd701be45..01fb1bf0eba70b740b12731c79feadef
|
||||
this.address = this.channel.remoteAddress();
|
||||
this.preparing = false; // Spigot
|
||||
if (this.delayedDisconnect != null) {
|
||||
@@ -473,6 +475,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -474,6 +476,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
if (this.channel.eventLoop().inEventLoop()) {
|
||||
this.doSendPacket(packet, channelFutureListener, flag);
|
||||
} else {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Async switch connection state
|
||||
|
||||
|
||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||
index 01fb1bf0eba70b740b12731c79feadefc8fe96f0..a6077984e139be5cbcc00f8f0828f1992d3604a6 100644
|
||||
index ce7013f14f78b0d28806c91679cfe56f02998ee6..d04531c7316fc13207a6b7312a82697eb51b96f7 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -343,6 +343,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -344,6 +344,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
if (protocolInfo.flow() != this.getReceiving()) {
|
||||
throw new IllegalStateException("Invalid inbound protocol: " + protocolInfo.id());
|
||||
} else {
|
||||
@@ -20,7 +20,7 @@ index 01fb1bf0eba70b740b12731c79feadefc8fe96f0..a6077984e139be5cbcc00f8f0828f199
|
||||
this.packetListener = packetInfo;
|
||||
this.disconnectListener = null;
|
||||
UnconfiguredPipelineHandler.InboundConfigurationTask inboundConfigurationTask = UnconfiguredPipelineHandler.setupInboundProtocol(protocolInfo);
|
||||
@@ -352,7 +357,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -353,7 +358,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
inboundConfigurationTask = inboundConfigurationTask.andThen(context -> context.pipeline().addAfter("decoder", "bundler", packetBundlePacker));
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ index 01fb1bf0eba70b740b12731c79feadefc8fe96f0..a6077984e139be5cbcc00f8f0828f199
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,6 +386,31 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -375,6 +387,31 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,10 +69,10 @@ index 01fb1bf0eba70b740b12731c79feadefc8fe96f0..a6077984e139be5cbcc00f8f0828f199
|
||||
if (this.packetListener != null) {
|
||||
throw new IllegalStateException("Listener already set");
|
||||
diff --git a/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java b/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
index ea892dd1d23d0f16c11381d1e8d75164a2791a3d..25c6e9f1b88ea7bfa2c7f1d130d56c581202960e 100644
|
||||
index c032d5beb28a2181697cc43bd295d839464d34ed..ed593fa6795f0fd05e38bba3b656dcd72e690af8 100644
|
||||
--- a/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
@@ -152,11 +152,34 @@ public class ServerConfigurationPacketListenerImpl extends ServerCommonPacketLis
|
||||
@@ -153,11 +153,34 @@ public class ServerConfigurationPacketListenerImpl extends ServerCommonPacketLis
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ index 9f7288223bc1f13e3664d82d2e883336f527e5e2..ed51fd7c4c9f26dbcc348e6aefcafd36
|
||||
|
||||
public static void shutdownExecutors() {
|
||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||
index a6077984e139be5cbcc00f8f0828f1992d3604a6..4142ef85071b13427f99808482a1f1344ee976d3 100644
|
||||
index d04531c7316fc13207a6b7312a82697eb51b96f7..c64ce409b13a4f95e73cef7cc48db49eabffcc8a 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -645,13 +645,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -646,13 +646,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
if (!(this.packetListener instanceof net.minecraft.server.network.ServerLoginPacketListenerImpl loginPacketListener)
|
||||
|| loginPacketListener.state != net.minecraft.server.network.ServerLoginPacketListenerImpl.State.VERIFYING
|
||||
|| Connection.joinAttemptsThisTick++ < MAX_PER_TICK) {
|
||||
@@ -100,7 +100,7 @@ index 4535858701b2bb232b9d2feb2af6551526232ddc..e65c62dbe4c1560ae153e4c4344e9194
|
||||
- // Paper end - detailed watchdog information
|
||||
}
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 0709922df9b1dcef1010de725bf132d194e29aad..e39c3b7cea5de9a2e6d5e2256617c969d41a55c8 100644
|
||||
index 964c97a394122083a2f3c77b8ca529592c826080..a58ba94171b54feee82e4ec3d68d23f474507d8f 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1512,13 +1512,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -132,7 +132,7 @@ index 0709922df9b1dcef1010de725bf132d194e29aad..e39c3b7cea5de9a2e6d5e2256617c969
|
||||
|
||||
private void tickPassenger(Entity ridingEntity, Entity passengerEntity, final boolean isActive) { // Paper - EAR 2
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 2b29b0e5334ad9f8b3768e9b198565f093c6d3a4..086525c31bd8167baac79a7f41e3e4d1ca783136 100644
|
||||
index a253d714670f932d67e2c44fdf895716b6b595ec..641ad9779e7822d29d35a199fed8766887e62a8e 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1170,16 +1170,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
@@ -70,19 +70,26 @@ index d0c4037c3cc60c54ea4c60ffc2c227107fecd01c..c01f3bd5022371b71f2bdc00ebf9d134
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
index 266932720ae0af0f17df18ad1570b29631ed2c2a..58d250bfd14690ed79ca7716b584cc3f91d0e7e6 100644
|
||||
index a972eeddbdc59e53279a7c5c704e28c2fcdf7290..8485ebd3289e94fda018749de714654e2bbdbcb6 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
@@ -334,7 +334,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -341,13 +341,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
}
|
||||
|
||||
- private static List<Definition<? extends Annotation, ?, ? extends FieldProcessor.Factory<?, ?>>> defaultFieldProcessors() {
|
||||
+ private static List<Definition<? extends Annotation, ?, ? extends FieldProcessor.Factory<?, ?>>> defaultFieldProcessors() { // Gale - Gale configuration - private -> public
|
||||
return List.of(
|
||||
MergeMap.DEFINITION
|
||||
);
|
||||
}
|
||||
|
||||
- private static ContextMap createWorldContextMap(ServerLevel level) {
|
||||
+ public static ContextMap createWorldContextMap(ServerLevel level) { // Gale - Gale configuration
|
||||
+ public static ContextMap createWorldContextMap(ServerLevel level) { // Gale - Gale configuration - private -> public
|
||||
return createWorldContextMap(level.levelStorageAccess.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig, level.registryAccess(), level.getGameRules());
|
||||
}
|
||||
|
||||
@@ -437,17 +437,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -450,17 +450,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
|
||||
}
|
||||
|
||||
@@ -100,7 +107,7 @@ index 266932720ae0af0f17df18ad1570b29631ed2c2a..58d250bfd14690ed79ca7716b584cc3f
|
||||
@Deprecated
|
||||
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
@@ -470,9 +459,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -483,9 +472,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
|
||||
// Symlinks are not correctly checked in createDirectories
|
||||
@@ -119,28 +126,28 @@ index 266932720ae0af0f17df18ad1570b29631ed2c2a..58d250bfd14690ed79ca7716b584cc3f
|
||||
+ // Gale end - Gale configuration
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java b/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java
|
||||
index 05339a176083af667c16f77d76dc1878dafce3f0..9ca55cba185b9de566f911b08d671bee50bca075 100644
|
||||
index a8a82aca70a97e30ca680c86421c6a04ed8172f8..db23f74b4c02c43ab42cf8db15c400eedf35d343 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java
|
||||
@@ -46,7 +46,19 @@ public final class InnerClassFieldDiscoverer implements FieldDiscoverer<Map<Fiel
|
||||
return new InnerClassFieldDiscoverer(overrides);
|
||||
@@ -97,7 +97,19 @@ public final class InnerClassFieldDiscoverer implements FieldDiscoverer<Map<Fiel
|
||||
return create(overrides, fieldProcessors);
|
||||
}
|
||||
|
||||
- public static FieldDiscoverer<?> globalConfig() {
|
||||
- public static FieldDiscoverer<?> globalConfig(final List<Definition<?, ?, ? extends FieldProcessor.Factory<?, ?>>> fieldProcessors) {
|
||||
+ // Gale start - Gale configuration
|
||||
+ public static FieldDiscoverer<?> galeWorldConfig(io.papermc.paper.configuration.Configurations.ContextMap contextMap) {
|
||||
+ public static FieldDiscoverer<?> galeWorldConfig(final io.papermc.paper.configuration.Configurations.ContextMap contextMap, final List<Definition<?, ?, ? extends FieldProcessor.Factory<?, ?>>> fieldProcessors) {
|
||||
+ final Map<Class<?>, Object> overrides = Map.of(
|
||||
+ org.galemc.gale.configuration.GaleWorldConfiguration.class, new org.galemc.gale.configuration.GaleWorldConfiguration(
|
||||
+ contextMap.require(io.papermc.paper.configuration.PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(),
|
||||
+ contextMap.require(io.papermc.paper.configuration.Configurations.WORLD_KEY)
|
||||
+ )
|
||||
+ );
|
||||
+ return new InnerClassFieldDiscoverer(overrides);
|
||||
+ return create(overrides, fieldProcessors);
|
||||
+ }
|
||||
+ // Gale end - Gale configuration
|
||||
+
|
||||
+ public static FieldDiscoverer<?> globalConfig() { // Gale - Gale configuration
|
||||
return new InnerClassFieldDiscoverer(Collections.emptyMap());
|
||||
+ public static FieldDiscoverer<?> globalConfig(final List<Definition<?, ?, ? extends FieldProcessor.Factory<?, ?>>> fieldProcessors) { // Gale - Gale configuration
|
||||
return create(Collections.emptyMap(), fieldProcessors);
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
|
||||
@@ -127,7 +127,7 @@ index 0000000000000000000000000000000000000000..15a226e3854d731f7724025ea3459c8a
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
index e6ad63a56dc0fc969dbf3ed5bdc36b4187331e30..f99ee5383bb9f33c1ebdbc74a640c2f7dc20a046 100644
|
||||
index d243d661ea0efcd7bdb9716a2bbd0995cad8db16..74249a202a1dbfc227d5028e68991a1625a75554 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
@@ -142,6 +142,10 @@ public class MobGoalHelper {
|
||||
@@ -1087,10 +1087,10 @@ index cabdcbef0e6f7ca41ff5677bc2e6a81665ca812d..c47ca9ab164b6abd28e979c944569181
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 9d6235390c530b4f3780ac8d088ad8f6ee3db58e..ab454a7c53b074c8c60bab38c0544aa3b69d5c6d 100644
|
||||
index d4183bd69358b68980b80232d76863480d9b926c..aed79c57a691eb9a100e566c4d1163181af0b360 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -682,10 +682,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -681,10 +681,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
|
||||
@Override
|
||||
public void setPlayerListName(String name) {
|
||||
@@ -1107,7 +1107,7 @@ index 9d6235390c530b4f3780ac8d088ad8f6ee3db58e..ab454a7c53b074c8c60bab38c0544aa3
|
||||
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
|
||||
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
|
||||
if (player.getBukkitEntity().canSee(this)) {
|
||||
@@ -1486,6 +1491,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -1485,6 +1490,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
// Paper start - Teleport passenger API
|
||||
// Don't allow teleporting between worlds while keeping passengers
|
||||
if (ignorePassengers && entity.isVehicle() && location.getWorld() != this.getWorld()) {
|
||||
@@ -1115,7 +1115,7 @@ index 9d6235390c530b4f3780ac8d088ad8f6ee3db58e..ab454a7c53b074c8c60bab38c0544aa3
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1507,6 +1513,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -1506,6 +1512,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
}
|
||||
|
||||
if (entity.isVehicle() && !ignorePassengers) { // Paper - Teleport API
|
||||
@@ -1123,7 +1123,7 @@ index 9d6235390c530b4f3780ac8d088ad8f6ee3db58e..ab454a7c53b074c8c60bab38c0544aa3
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2793,6 +2800,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -2792,6 +2799,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
this.getHandle().getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(player.getAbilities().walkingSpeed); // SPIGOT-5833: combination of the two in 1.16+
|
||||
}
|
||||
|
||||
@@ -1152,7 +1152,7 @@ index 9d6235390c530b4f3780ac8d088ad8f6ee3db58e..ab454a7c53b074c8c60bab38c0544aa3
|
||||
private void validateSpeed(float value) {
|
||||
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);
|
||||
}
|
||||
@@ -3601,4 +3630,76 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -3600,4 +3629,76 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
this(new ShortArraySet(), new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: MIT
|
||||
Original project: https://github.com/KeYiMC/KeYi
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ab454a7c53b074c8c60bab38c0544aa3b69d5c6d..8c7f2e8a07a55b5e0ac7ddc955ca2f3376f85af5 100644
|
||||
index aed79c57a691eb9a100e566c4d1163181af0b360..17d519244b0d08829e28e9047134b8bee9cde81f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3702,4 +3702,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -3701,4 +3701,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message)));
|
||||
}
|
||||
// Purpur end - Death screen API
|
||||
|
||||
@@ -9,10 +9,10 @@ Original project: https://github.com/Cryptite/Slice
|
||||
Co-authored-by: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 8c7f2e8a07a55b5e0ac7ddc955ca2f3376f85af5..6cdfbba18deb2429d7478649821d8815511f8fa2 100644
|
||||
index 17d519244b0d08829e28e9047134b8bee9cde81f..7fb60f68ffb5e8d880d3c8395f64585461d7f5c9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1455,6 +1455,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -1454,6 +1454,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
// Paper end - Teleportation API
|
||||
}
|
||||
|
||||
|
||||
@@ -73,10 +73,10 @@ index 476eefebace887064b728f08af40c746b6f70787..beae8a57a0ce9b8e7d81619efe4c39d9
|
||||
if (entity instanceof EnderDragonPart complexPart) {
|
||||
if (complexPart.parentMob instanceof EnderDragon) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 6cdfbba18deb2429d7478649821d8815511f8fa2..e855ddb7f81124ccd0d1c8cc474777cca3056ad8 100644
|
||||
index 7fb60f68ffb5e8d880d3c8395f64585461d7f5c9..17bea636bd3ce09a01a5358a6a7f9d8c799c1f23 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2357,7 +2357,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -2356,7 +2356,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
|
||||
@Override
|
||||
public boolean canSee(Player player) {
|
||||
|
||||
@@ -16,7 +16,7 @@ This seems stupid, but it does seem that it improves the performance a bit, and
|
||||
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index e855ddb7f81124ccd0d1c8cc474777cca3056ad8..1e08ac054947b1a0a6cce2f886be1ed83c74a642 100644
|
||||
index 17bea636bd3ce09a01a5358a6a7f9d8c799c1f23..a6463974c63e40afce0c6656122f6f918fdc089b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -217,7 +217,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -26,9 +26,9 @@ index e855ddb7f81124ccd0d1c8cc474777cca3056ad8..1e08ac054947b1a0a6cce2f886be1ed8
|
||||
- private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>();
|
||||
+ private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // SparklyPaper - optimize canSee checks
|
||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||
public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API
|
||||
private long firstPlayed = 0;
|
||||
@@ -2362,9 +2362,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
private long lastPlayed = 0;
|
||||
@@ -2361,9 +2361,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
|
||||
@Override
|
||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||
|
||||
@@ -5,11 +5,11 @@ Subject: [PATCH] Don't throw exception on missing ResourceKey value
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
|
||||
index 6831b7b72c5e1f79eff36019ca2ff56531c26df8..a1b9949c9e36770724292ea2f71f21456ae7889f 100644
|
||||
index ad08f242cd195bdf952bde02d759f2c853b496ff..40086e9e4d031605f12f1a4e8f9e4c241a5a38b6 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
|
||||
@@ -23,7 +23,11 @@ public final class RegistryValueSerializer<T> extends RegistryEntrySerializer<T,
|
||||
protected T convertFromResourceKey(ResourceKey<T> key) throws SerializationException {
|
||||
@@ -33,7 +33,11 @@ public final class RegistryValueSerializer<T> extends RegistryEntrySerializer<T,
|
||||
protected T convertFromResourceKey(final ResourceKey<T> key) throws SerializationException {
|
||||
final T value = this.registry().getValue(key);
|
||||
if (value == null) {
|
||||
- throw new SerializationException("Missing value in " + this.registry() + " with key " + key.location());
|
||||
|
||||
@@ -59,7 +59,7 @@ index beae8a57a0ce9b8e7d81619efe4c39d908869319..6b1926080eddf61ff9c0156a6846f7f0
|
||||
}
|
||||
return set;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 1e08ac054947b1a0a6cce2f886be1ed83c74a642..7850bc5432bc88ec060ee64e45613b6f9c5c4fac 100644
|
||||
index a6463974c63e40afce0c6656122f6f918fdc089b..0f085618f6866bef1a526c6404f92e26f7bef0fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -217,7 +217,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
@@ -69,9 +69,9 @@ index 1e08ac054947b1a0a6cce2f886be1ed83c74a642..7850bc5432bc88ec060ee64e45613b6f
|
||||
- private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // SparklyPaper - optimize canSee checks
|
||||
+ private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = org.dreeam.leaf.config.modules.async.MultithreadedTracker.enabled ? it.unimi.dsi.fastutil.objects.Object2ObjectMaps.synchronize(new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>()) : new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // SparklyPaper - optimize canSee checks // Leaf - Multithreaded tracker
|
||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||
public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API
|
||||
private long firstPlayed = 0;
|
||||
@@ -2962,7 +2962,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
private long lastPlayed = 0;
|
||||
@@ -2961,7 +2961,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
Iterator<AttributeInstance> iterator = collection.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
AttributeInstance genericInstance = iterator.next();
|
||||
|
||||
@@ -328,7 +328,7 @@ index 3183dab5ae079402f5c0f2d5c0048a4d105d8eeb..ad53cef93c55e73579f2419e10196beb
|
||||
}
|
||||
// Paper end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3a1514b69 100644
|
||||
index dd122bbbe2c33183017dbde6997d3f1cd08479b5..4d8c87bd55e3503a84ad9a24b04a11a472d68f3c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -74,12 +74,97 @@ public class CraftBlock implements Block {
|
||||
@@ -871,7 +871,7 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
|
||||
@Override
|
||||
public int getBlockPower() {
|
||||
@@ -478,106 +746,180 @@ public class CraftBlock implements Block {
|
||||
@@ -478,23 +746,35 @@ public class CraftBlock implements Block {
|
||||
|
||||
@Override
|
||||
public PistonMoveReaction getPistonMoveReaction() {
|
||||
@@ -910,7 +910,8 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean breakNaturally(ItemStack item, boolean triggerEffect, boolean dropExperience) {
|
||||
@@ -506,84 +786,147 @@ public class CraftBlock implements Block {
|
||||
public boolean breakNaturally(ItemStack item, boolean triggerEffect, boolean dropExperience, boolean forceEffect) {
|
||||
// Paper end
|
||||
// Order matters here, need to drop before setting to air so skulls can get their data
|
||||
+ // Leaf start - SparklyPaper - parallel world ticking - Write operation check
|
||||
@@ -930,50 +931,45 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
net.minecraft.world.level.block.Block block = state.getBlock();
|
||||
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
|
||||
- boolean result = false;
|
||||
-
|
||||
+ boolean droppedItems = false;
|
||||
|
||||
- // Modelled off Player#hasCorrectToolForDrops
|
||||
- if (block != Blocks.AIR && (item == null || !state.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(state))) {
|
||||
- net.minecraft.world.level.block.Block.dropResources(state, this.world.getMinecraftWorld(), this.position, this.world.getBlockEntity(this.position), null, nmsItem, false); // Paper - Properly handle xp dropping
|
||||
- // Paper start - improve Block#breakNaturally
|
||||
- if (triggerEffect) {
|
||||
- if (state.getBlock() instanceof net.minecraft.world.level.block.BaseFireBlock) {
|
||||
- this.world.levelEvent(net.minecraft.world.level.block.LevelEvent.SOUND_EXTINGUISH_FIRE, this.position, 0);
|
||||
- } else {
|
||||
- this.world.levelEvent(net.minecraft.world.level.block.LevelEvent.PARTICLES_DESTROY_BLOCK, this.position, net.minecraft.world.level.block.Block.getId(state));
|
||||
+ boolean droppedItems = false;
|
||||
+
|
||||
- if (dropExperience) block.popExperience(this.world.getMinecraftWorld(), this.position, block.getExpDrop(state, this.world.getMinecraftWorld(), this.position, nmsItem, true));
|
||||
- // Paper end
|
||||
- result = true;
|
||||
- }
|
||||
+ // Experience dropping requires ServerLevel
|
||||
+ ServerLevel serverLevelForDrops = getServerLevel(); // Re-get ServerLevel specifically for drop logic
|
||||
+
|
||||
|
||||
- if ((result && triggerEffect) || (forceEffect && block != Blocks.AIR)) {
|
||||
- if (state.getBlock() instanceof net.minecraft.world.level.block.BaseFireBlock) {
|
||||
- this.world.levelEvent(net.minecraft.world.level.block.LevelEvent.SOUND_EXTINGUISH_FIRE, this.position, 0);
|
||||
- } else {
|
||||
- this.world.levelEvent(net.minecraft.world.level.block.LevelEvent.PARTICLES_DESTROY_BLOCK, this.position, net.minecraft.world.level.block.Block.getId(state));
|
||||
+ if (serverLevelForDrops != null) { // Only attempt drops/XP if we have a ServerLevel
|
||||
+ // Check if block should drop items
|
||||
+ if (!state.isAir() && (item == null || !state.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(state))) {
|
||||
+ // Drop items using ServerLevel
|
||||
+ net.minecraft.world.level.block.Block.dropResources(state, serverLevelForDrops, this.position, this.world.getBlockEntity(this.position), null, nmsItem, false);
|
||||
+
|
||||
+ // Trigger effect using LevelAccessor (safe)
|
||||
+ if (triggerEffect) {
|
||||
+ int eventId = (state.getBlock() instanceof net.minecraft.world.level.block.BaseFireBlock)
|
||||
+ ? net.minecraft.world.level.block.LevelEvent.SOUND_EXTINGUISH_FIRE
|
||||
+ : net.minecraft.world.level.block.LevelEvent.PARTICLES_DESTROY_BLOCK;
|
||||
+ int eventData = (eventId == net.minecraft.world.level.block.LevelEvent.PARTICLES_DESTROY_BLOCK)
|
||||
+ ? net.minecraft.world.level.block.Block.getId(state) : 0;
|
||||
+ this.world.levelEvent(eventId, this.position, eventData);
|
||||
+ }
|
||||
+ // Drop experience using ServerLevel
|
||||
+ if (dropExperience) {
|
||||
+ int xp = block.getExpDrop(state, serverLevelForDrops, this.position, nmsItem, true);
|
||||
+ if (xp > 0) { // Only pop if there's XP to drop
|
||||
+ block.popExperience(serverLevelForDrops, this.position, xp);
|
||||
+
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
+ droppedItems = true;
|
||||
+ }
|
||||
+ } else {
|
||||
+ // Log if we couldn't drop XP because it wasn't a ServerLevel
|
||||
+ if (dropExperience && !state.isAir()) { // Only warn if XP was requested and block wasn't air
|
||||
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.WARNING, "PWT: Cannot drop experience for breakNaturally: Not a ServerLevel.");
|
||||
+ }
|
||||
}
|
||||
+ // Still trigger effects if requested and possible with LevelAccessor
|
||||
+ if (triggerEffect && !state.isAir()) {
|
||||
+ int eventId = (state.getBlock() instanceof net.minecraft.world.level.block.BaseFireBlock)
|
||||
@@ -982,10 +978,17 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
+ int eventData = (eventId == net.minecraft.world.level.block.LevelEvent.PARTICLES_DESTROY_BLOCK)
|
||||
+ ? net.minecraft.world.level.block.Block.getId(state) : 0;
|
||||
+ this.world.levelEvent(eventId, this.position, eventData);
|
||||
}
|
||||
- if (dropExperience) block.popExperience(this.world.getMinecraftWorld(), this.position, block.getExpDrop(state, this.world.getMinecraftWorld(), this.position, nmsItem, true));
|
||||
- // Paper end
|
||||
- result = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Trigger effect using LevelAccessor (safe)
|
||||
+ if ((droppedItems && triggerEffect) || (forceEffect && block != Blocks.AIR)) {
|
||||
+ int eventId = (state.getBlock() instanceof net.minecraft.world.level.block.BaseFireBlock)
|
||||
+ ? net.minecraft.world.level.block.LevelEvent.SOUND_EXTINGUISH_FIRE
|
||||
+ : net.minecraft.world.level.block.LevelEvent.PARTICLES_DESTROY_BLOCK;
|
||||
+ int eventData = (eventId == net.minecraft.world.level.block.LevelEvent.PARTICLES_DESTROY_BLOCK)
|
||||
+ ? net.minecraft.world.level.block.Block.getId(state) : 0;
|
||||
+ this.world.levelEvent(eventId, this.position, eventData);
|
||||
}
|
||||
|
||||
- // SPIGOT-6778: Directly call setBlock instead of setBlockState, so that the block entity is not removed and custom remove logic is run.
|
||||
@@ -1092,7 +1095,7 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -592,31 +934,70 @@ public class CraftBlock implements Block {
|
||||
@@ -598,31 +941,70 @@ public class CraftBlock implements Block {
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> getDrops(ItemStack item, Entity entity) {
|
||||
@@ -1173,7 +1176,7 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
@Override
|
||||
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
|
||||
this.getCraftWorld().getBlockMetadata().setMetadata(this, metadataKey, newMetadataValue);
|
||||
@@ -639,57 +1020,148 @@ public class CraftBlock implements Block {
|
||||
@@ -645,57 +1027,148 @@ public class CraftBlock implements Block {
|
||||
|
||||
@Override
|
||||
public boolean isPassable() {
|
||||
@@ -1345,7 +1348,7 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -705,7 +1177,10 @@ public class CraftBlock implements Block {
|
||||
@@ -711,7 +1184,10 @@ public class CraftBlock implements Block {
|
||||
// Paper start
|
||||
@Override
|
||||
public com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup() {
|
||||
@@ -1357,7 +1360,7 @@ index b00a82816784ea2f6422ca98c1f11597105cc177..5c43785b891b8b6faf3f513510509ec3
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -718,26 +1193,76 @@ public class CraftBlock implements Block {
|
||||
@@ -724,26 +1200,76 @@ public class CraftBlock implements Block {
|
||||
return this.getNMS().getBlock().getDescriptionId();
|
||||
}
|
||||
|
||||
@@ -1508,7 +1511,7 @@ index 196835bdf95ba0e149b2977e9ef41698971f501f..eb7e63d4549e672ff1206055d2d75439
|
||||
net.minecraft.world.item.ItemStack nms = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(item);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
index db71a9fc02bfac7799b58f07da044e53b2273e98..842713df01a0bde562b2bef366af7d5429497bae 100644
|
||||
index 18f09de5c6549df3562e710ede825f75d69c046e..1b06f97caeda6f33938ff5391ecaad5a1fc26f36 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
@@ -195,14 +195,14 @@ public final class CraftBlockStates {
|
||||
@@ -1530,7 +1533,7 @@ index db71a9fc02bfac7799b58f07da044e53b2273e98..842713df01a0bde562b2bef366af7d54
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 5e73db484a5526f4c39c7cc2de5ddc3ff037d2e4..acb5182a59859f65653cd309ca85b8301ace5383 100644
|
||||
index 658385b2887d6debec7fc941c28621da5d263411..2e7ee5faf114e9b8619826c0252c5daac333f0b5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -829,6 +829,28 @@ public class CraftEventFactory {
|
||||
|
||||
@@ -14,11 +14,11 @@ import io.papermc.paper.configuration.legacy.RequiresSpigotInitialization;
|
||||
import io.papermc.paper.configuration.mapping.InnerClassFieldDiscoverer;
|
||||
import io.papermc.paper.configuration.serializer.ComponentSerializer;
|
||||
import io.papermc.paper.configuration.serializer.EnumValueSerializer;
|
||||
import io.papermc.paper.configuration.serializer.PacketClassSerializer;
|
||||
import io.papermc.paper.configuration.serializer.ServerboundPacketClassSerializer;
|
||||
import io.papermc.paper.configuration.serializer.StringRepresentableSerializer;
|
||||
import io.papermc.paper.configuration.serializer.collections.FastutilMapSerializer;
|
||||
import io.papermc.paper.configuration.serializer.collections.MapSerializer;
|
||||
import io.papermc.paper.configuration.serializer.collections.TableSerializer;
|
||||
import io.papermc.paper.configuration.serializer.collection.TableSerializer;
|
||||
import io.papermc.paper.configuration.serializer.collection.map.FastutilMapSerializer;
|
||||
import io.papermc.paper.configuration.serializer.collection.map.MapSerializer;
|
||||
import io.papermc.paper.configuration.serializer.registry.RegistryHolderSerializer;
|
||||
import io.papermc.paper.configuration.serializer.registry.RegistryValueSerializer;
|
||||
import io.papermc.paper.configuration.transformation.Transformations;
|
||||
@@ -140,7 +140,7 @@ public class GaleConfigurations extends Configurations<GaleGlobalConfiguration,
|
||||
}
|
||||
|
||||
private static ObjectMapper.Factory.Builder defaultGlobalFactoryBuilder(ObjectMapper.Factory.Builder builder) {
|
||||
return builder.addDiscoverer(InnerClassFieldDiscoverer.globalConfig());
|
||||
return builder.addDiscoverer(InnerClassFieldDiscoverer.globalConfig(PaperConfigurations.defaultFieldProcessors()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,7 +152,7 @@ public class GaleConfigurations extends Configurations<GaleGlobalConfiguration,
|
||||
private static ConfigurationOptions defaultGlobalOptions(RegistryAccess registryAccess, ConfigurationOptions options) {
|
||||
return options
|
||||
.header(GLOBAL_HEADER)
|
||||
.serializers(builder -> builder.register(new PacketClassSerializer())
|
||||
.serializers(builder -> builder.register(new ServerboundPacketClassSerializer())
|
||||
.register(new RegistryValueSerializer<>(new TypeToken<DataComponentType<?>>() {}, registryAccess, Registries.DATA_COMPONENT_TYPE, false))
|
||||
);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class GaleConfigurations extends Configurations<GaleGlobalConfiguration,
|
||||
return super.createWorldObjectMapperFactoryBuilder(contextMap)
|
||||
.addNodeResolver(new RequiresSpigotInitialization.Factory(contextMap.require(PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get()))
|
||||
.addNodeResolver(new NestedSetting.Factory())
|
||||
.addDiscoverer(InnerClassFieldDiscoverer.galeWorldConfig(contextMap));
|
||||
.addDiscoverer(InnerClassFieldDiscoverer.galeWorldConfig(contextMap, PaperConfigurations.defaultFieldProcessors()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user