Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26244,7 +26244,7 @@ index 182e7468a01e76a22c7af3c081469b4f84f87558..b7915685026e9a944f42440e4a95215f
List<Entity> passengers = this.entity.getPassengers();
if (!passengers.equals(this.lastPassengers)) {
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index f25d50bcccf9b35ae70f8162c6b2b67fffcd319a..5494b92ab1c3c202a640e483e8a4bcb64395ed99 100644
index 061bc47972d9c67375c0ff9461c506625c80108c..7656665352632fc718bea91dcfd3dd41fc436e1f 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -181,7 +181,7 @@ import net.minecraft.world.waypoints.WaypointTransmitter;
Expand Down Expand Up @@ -27028,7 +27028,7 @@ index f25d50bcccf9b35ae70f8162c6b2b67fffcd319a..5494b92ab1c3c202a640e483e8a4bcb6
}

diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 09470e7c4238a66be16b3cf8cf93444700cc2508..55d27aa4cff91ea61ff2ab9256acd2cd8694304a 100644
index 80ee52cb77d079cda66b12e7d3fe683ccb47d7dc..9d4d70369907c3d18c15289ef6630cade8fc74fe 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -201,7 +201,7 @@ import net.minecraft.world.scores.criteria.ObjectiveCriteria;
Expand Down Expand Up @@ -27545,7 +27545,7 @@ index c86c72b384ade21165d61958119a21f2128ffdf8..481321fe20adc967d41959258e1915f7

public TicketType getType() {
diff --git a/net/minecraft/server/level/TicketType.java b/net/minecraft/server/level/TicketType.java
index f501cf98260742fc9e3e4bfba1faade49e4d6db6..b2914cbe1ba89ef23f3ca41a98d0c8679198ce4c 100644
index 835d3177b1287cbd7801b0428b19994432c6f78d..6d5bfc6e26932ba1d22b339b4bcadd2cce00c989 100644
--- a/net/minecraft/server/level/TicketType.java
+++ b/net/minecraft/server/level/TicketType.java
@@ -7,7 +7,45 @@ import java.lang.annotation.Target;
Expand Down Expand Up @@ -27597,7 +27597,7 @@ index f501cf98260742fc9e3e4bfba1faade49e4d6db6..b2914cbe1ba89ef23f3ca41a98d0c867
public static final int FLAG_PERSIST = 1; // Paper - diff on change - all listed in Flags annotation
@@ -27,7 +65,7 @@ public record TicketType(long timeout, @TicketType.Flags int flags) {
public static final TicketType UNKNOWN = register("unknown", 1L, FLAG_CAN_EXPIRE_IF_UNLOADED | FLAG_LOADING);
public static final TicketType PLUGIN = register("plugin", 0L, FLAG_LOADING | FLAG_SIMULATION); // CraftBukkit
public static final TicketType PLUGIN = register("plugin", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // CraftBukkit
public static final TicketType POST_TELEPORT = register("post_teleport", 5L, FLAG_LOADING | FLAG_SIMULATION); // Paper
- public static final TicketType PLUGIN_TICKET = register("plugin_ticket", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // Paper
+ public static final TicketType PLUGIN_TICKET = register("plugin_ticket", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); static { ((TicketType<org.bukkit.plugin.Plugin>)PLUGIN_TICKET).moonrise$setIdentifierComparator((org.bukkit.plugin.Plugin p1, org.bukkit.plugin.Plugin p2) -> p1.getName().compareTo(p2.getName())); } // Paper // Paper - rewrite chunk system
Expand Down Expand Up @@ -28137,7 +28137,7 @@ index 8cc5c0716392ba06501542ff5cbe71ee43979e5d..09fd99c9cbd23b5f3c899bfb00c9b896
+ // Paper end - block counting
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index eac79f778c33f323859543012565df36060d35d2..473d07ac3f9c640beb7594e5c540e730c0d6421e 100644
index 519fbc86a33848a79981222c29de88191f848411..57cff20212f6d5f83d4b0169bf6aa185a403e1d3 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -152,7 +152,7 @@ import org.jetbrains.annotations.Contract;
Expand Down Expand Up @@ -29259,7 +29259,7 @@ index d4c78c7f521b31ea9ce0cf7d62978b8e324b5d10..bcbe39eed2d254861689c95f7040f27b

// Paper start - Affects Spawning API
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
index bba1d068b13d9d0a36abdb888e864c5ff3fb6de6..c94eae678dd55fced81fcee683ca3c0e16443c7c 100644
index e57358f03da2a6be5997abbd895fafb768140e69..77b8f0f18748fc6a3c8c44f8eb496225e3f0eb8f 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -82,6 +82,7 @@ import net.minecraft.world.level.storage.LevelData;
Expand Down Expand Up @@ -29946,8 +29946,8 @@ index bba1d068b13d9d0a36abdb888e864c5ff3fb6de6..c94eae678dd55fced81fcee683ca3c0e
this.setBlocksDirty(pos, blockState, blockState1);
}

- if ((flags & 2) != 0 && (!this.isClientSide() || (flags & 4) == 0) && (this.isClientSide() || chunkAt == null || (chunkAt.getFullStatus() != null && chunkAt.getFullStatus().isOrAfter(FullChunkStatus.BLOCK_TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement
+ if ((flags & 2) != 0 && (!this.isClientSide() || (flags & 4) == 0) && (this.isClientSide() || chunkAt == null || (chunkAt.getFullStatus() != null && chunkAt.getFullStatus().isOrAfter(FullChunkStatus.FULL)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement // Paper - rewrite chunk system - change from ticking to full
- if ((flags & Block.UPDATE_CLIENTS) != 0 && (!this.isClientSide() || (flags & Block.UPDATE_INVISIBLE) == 0) && (this.isClientSide() || chunkAt == null || (chunkAt.getFullStatus() != null && chunkAt.getFullStatus().isOrAfter(FullChunkStatus.BLOCK_TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement
+ if ((flags & Block.UPDATE_CLIENTS) != 0 && (!this.isClientSide() || (flags & Block.UPDATE_INVISIBLE) == 0) && (this.isClientSide() || chunkAt == null || (chunkAt.getFullStatus() != null && chunkAt.getFullStatus().isOrAfter(FullChunkStatus.FULL)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement // Paper - rewrite chunk system - change from ticking to full
this.sendBlockUpdated(pos, blockState, state, flags);
}

Expand Down Expand Up @@ -30188,7 +30188,7 @@ index 60be05520f1093e3edc7dbfcf5bd01601d5e6e7b..fd5a38a9f24c26f8eca738f78180446d

@Nullable ChunkAccess getChunkIfLoadedImmediately(int x, int z); // Paper - ifLoaded api (we need this since current impl blocks if the chunk is loading)
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
index ebbf5ceab837675ffa6a5380c0c54bc1dd788348..6279596058f76f113d238be3201cb0c6e6b49566 100644
index 907956791afe10021d9fc86bab7a115ee9ff57a5..1e94326047622d8975fd1cc5f44e75104fd56946 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
@@ -62,6 +62,249 @@ public class ServerExplosion implements Explosion {
Expand Down Expand Up @@ -31068,7 +31068,7 @@ index 8d98cba3830dc5dfb5cae9a6f5fedfffee0d2cd8..73962e79a0f3d892e3155443a1b84508

public interface NoiseBiomeSource {
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
index f1340eb90e22772114a1303ef3f3f905fe101351..ab08211e0f64a14a335e3cc4479bcf1f82e25cdd 100644
index fffb4a9bcbf87254bdc51a32577d188d169b6a51..94b4143449c99ee35db44ab8e2a766d924aa6410 100644
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -355,7 +355,7 @@ public class Block extends BlockBehaviour implements ItemLike {
Expand Down Expand Up @@ -31715,7 +31715,7 @@ index 9dc13a5b6cc1afc118a261802c71da25ae577fe5..a49a06662de4062a77112e358f536d45

public static ProblemReporter.PathElement problemPath(ChunkPos pos) {
diff --git a/net/minecraft/world/level/chunk/ChunkGenerator.java b/net/minecraft/world/level/chunk/ChunkGenerator.java
index 2acee7d7211c4e7b9ac02e9a48d6c3ea239e6949..78600f4c583056403c93e72ec0996b00ec6d1284 100644
index faf8f53bdcaa69fbbd816739dd4f1e812ced2165..7b98964eb77a619bdaaf5a9d331e3cfe080b52a4 100644
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -116,7 +116,7 @@ public abstract class ChunkGenerator {
Expand Down Expand Up @@ -31876,7 +31876,7 @@ index 8c5585c5a961b03853849f92e2811425391e5405..ba91dc3b8b4d70af32b7d9323f22c1fa
public @Nullable BlockEntity getBlockEntity(BlockPos pos) {
return this.wrapped.getBlockEntity(pos);
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
index d95fb59650cf5018902321cc7be895b7e7de7f25..356a89ef2396f245e438d59d65edd0445693cb8b 100644
index ca8b498c707b29e2c1524cc07d01dd19ac110053..ea6a9306cf7b0c1b0a4f69eb2f1d604c95efb967 100644
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
@@ -63,7 +63,7 @@ import net.minecraft.world.ticks.TickContainerAccess;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] optimize dirt and snow spreading


diff --git a/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
index 492bf7416534a2fc0706a90cfc3243b8301580a7..bae64d24e8ce704fdc146650fce478820362b437 100644
index 0036d684e619e373b0e15e0c38788a2231864b52..b11c6d76cb9df1f92a4581646929d0dc79ec3e4a 100644
--- a/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
+++ b/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
@@ -17,8 +17,13 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock {
Expand Down Expand Up @@ -58,7 +58,7 @@ index 492bf7416534a2fc0706a90cfc3243b8301580a7..bae64d24e8ce704fdc146650fce47882
for (int i = 0; i < 4; i++) {
BlockPos blockPos = pos.offset(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
- if (level.getBlockState(blockPos).is(Blocks.DIRT) && canPropagate(blockState, level, blockPos)) {
- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockPos, blockState.setValue(SNOWY, isSnowySetting(level.getBlockState(blockPos.above()))), 3); // CraftBukkit
- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockPos, blockState.setValue(SNOWY, isSnowySetting(level.getBlockState(blockPos.above()))), Block.UPDATE_ALL); // CraftBukkit
+ // Paper start - Perf: optimize dirt and snow spreading
+ if (pos.getX() == blockPos.getX() && pos.getY() == blockPos.getY() && pos.getZ() == blockPos.getZ()) {
+ continue;
Expand All @@ -71,7 +71,7 @@ index 492bf7416534a2fc0706a90cfc3243b8301580a7..bae64d24e8ce704fdc146650fce47882
+ access = level.getChunkAt(blockPos);
+ }
+ if (access.getBlockState(blockPos).is(Blocks.DIRT) && SpreadingSnowyDirtBlock.canPropagate(access, blockState, level, blockPos)) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockPos, blockState.setValue(SNOWY, isSnowySetting(access.getBlockState(blockPos.above()))), 3); // CraftBukkit
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockPos, blockState.setValue(SNOWY, isSnowySetting(access.getBlockState(blockPos.above()))), Block.UPDATE_ALL); // CraftBukkit
+ // Paper end - Perf: optimize dirt and snow spreading
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class ComponentSerialization {
public static final Codec<Component> CODEC = Codec.recursive("Component", ComponentSerialization::createCodec);
- public static final StreamCodec<RegistryFriendlyByteBuf, Component> STREAM_CODEC = ByteBufCodecs.fromCodecWithRegistries(CODEC);
+ public static final StreamCodec<RegistryFriendlyByteBuf, Component> STREAM_CODEC = createTranslationAware(() -> net.minecraft.nbt.NbtAccounter.create(net.minecraft.nbt.NbtAccounter.DEFAULT_NBT_QUOTA)); // Paper - adventure
+ public static final StreamCodec<RegistryFriendlyByteBuf, Component> STREAM_CODEC = createTranslationAware(net.minecraft.nbt.NbtAccounter::defaultQuota); // Paper - adventure
public static final StreamCodec<RegistryFriendlyByteBuf, Optional<Component>> OPTIONAL_STREAM_CODEC = STREAM_CODEC.apply(ByteBufCodecs::optional);
- public static final StreamCodec<RegistryFriendlyByteBuf, Component> TRUSTED_STREAM_CODEC = ByteBufCodecs.fromCodecWithRegistriesTrusted(CODEC);
+ // Paper start - adventure; use locale from bytebuf for translation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
--- a/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
@@ -31,6 +_,11 @@
private final Collection<String> players;
private final Optional<ClientboundSetPlayerTeamPacket.Parameters> parameters;
@@ -57,6 +_,12 @@
);
}

+ // Paper start - Multiple Entries with Scoreboards
+ public static ClientboundSetPlayerTeamPacket createMultiplePlayerPacket(PlayerTeam team, Collection<String> players, ClientboundSetPlayerTeamPacket.Action operation) {
+ return new ClientboundSetPlayerTeamPacket(team.getName(), operation == ClientboundSetPlayerTeamPacket.Action.ADD ? 3 : 4, Optional.empty(), players);
+ public static ClientboundSetPlayerTeamPacket createMultiplePlayerPacket(PlayerTeam team, Collection<String> players, ClientboundSetPlayerTeamPacket.Action action) {
+ return new ClientboundSetPlayerTeamPacket(team.getName(), action == ClientboundSetPlayerTeamPacket.Action.ADD ? METHOD_JOIN : METHOD_LEAVE, Optional.empty(), players);
+ }
+ // Paper end - Multiple Entries with Scoreboards
private ClientboundSetPlayerTeamPacket(String name, int method, Optional<ClientboundSetPlayerTeamPacket.Parameters> parameters, Collection<String> players) {
this.name = name;
this.method = method;
+
private ClientboundSetPlayerTeamPacket(RegistryFriendlyByteBuf buffer) {
this.name = buffer.readUtf();
this.method = buffer.readByte();
@@ -197,7 +_,7 @@
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(buffer, this.displayName);
buffer.writeByte(this.options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
super.onObjectiveChanged(objective);
if (this.trackedObjectives.contains(objective)) {
- this.server.getPlayerList().broadcastAll(new ClientboundSetObjectivePacket(objective, ClientboundSetObjectivePacket.METHOD_CHANGE));
+ this.broadcastAll(new ClientboundSetObjectivePacket(objective, 2)); // CraftBukkit
+ this.broadcastAll(new ClientboundSetObjectivePacket(objective, ClientboundSetObjectivePacket.METHOD_CHANGE)); // CraftBukkit
}

this.setDirty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
Biome biome = this.getBiome(heightmapPos).value();
if (biome.shouldFreeze(this, blockPos)) {
- this.setBlockAndUpdate(blockPos, Blocks.ICE.defaultBlockState());
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockPos, Blocks.ICE.defaultBlockState(), 3, null); // CraftBukkit
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockPos, Blocks.ICE.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
}

if (this.isRaining()) {
Expand All @@ -355,11 +355,11 @@
BlockState blockState1 = blockState.setValue(SnowLayerBlock.LAYERS, layersValue + 1);
Block.pushEntitiesUp(blockState, blockState1, this, heightmapPos);
- this.setBlockAndUpdate(heightmapPos, blockState1);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, blockState1, 3, null); // CraftBukkit
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, blockState1, Block.UPDATE_ALL, null); // CraftBukkit
}
} else {
- this.setBlockAndUpdate(heightmapPos, Blocks.SNOW.defaultBlockState());
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, Blocks.SNOW.defaultBlockState(), 3, null); // CraftBukkit
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@
+ Runnable consumeAnchorCharge = null; // Paper - Fix SPIGOT-5989 (don't use charge until after respawn event)
if (!flag && useCharge && optional.isPresent()) {
- level.setBlock(blockPos, blockState.setValue(RespawnAnchorBlock.CHARGE, blockState.getValue(RespawnAnchorBlock.CHARGE) - 1), Block.UPDATE_ALL);
+ consumeAnchorCharge = () -> level.setBlock(blockPos, blockState.setValue(RespawnAnchorBlock.CHARGE, blockState.getValue(RespawnAnchorBlock.CHARGE) - 1), 3); // Paper - Fix SPIGOT-5989 (don't use charge until after respawn event)
+ consumeAnchorCharge = () -> level.setBlock(blockPos, blockState.setValue(RespawnAnchorBlock.CHARGE, blockState.getValue(RespawnAnchorBlock.CHARGE) - 1), Block.UPDATE_ALL); // Paper - Fix SPIGOT-5989 (don't use charge until after respawn event)
}
+ final Runnable finalConsumeAnchorCharge = consumeAnchorCharge; // Paper - Fix SPIGOT-5989

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public static final TicketType PORTAL = register("portal", 300L, FLAG_PERSIST | FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE);
public static final TicketType ENDER_PEARL = register("ender_pearl", 40L, FLAG_LOADING | FLAG_SIMULATION | FLAG_KEEP_DIMENSION_ACTIVE);
public static final TicketType UNKNOWN = register("unknown", 1L, FLAG_CAN_EXPIRE_IF_UNLOADED | FLAG_LOADING);
+ public static final TicketType PLUGIN = register("plugin", 0L, FLAG_LOADING | FLAG_SIMULATION); // CraftBukkit
+ public static final TicketType PLUGIN = register("plugin", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // CraftBukkit
+ public static final TicketType POST_TELEPORT = register("post_teleport", 5L, FLAG_LOADING | FLAG_SIMULATION); // Paper
+ public static final TicketType PLUGIN_TICKET = register("plugin_ticket", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // Paper
+ public static final TicketType FUTURE_AWAIT = register("future_await", NO_TIMEOUT, FLAG_LOADING | FLAG_SIMULATION); // Paper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@

public void setSharedFlagOnFire(boolean isOnFire) {
- this.setSharedFlag(FLAG_ONFIRE, isOnFire || this.hasVisualFire);
+ this.setSharedFlag(0, this.visualFire.toBooleanOrElse(isOnFire)); // Paper - improve visual fire API
+ this.setSharedFlag(FLAG_ONFIRE, this.visualFire.toBooleanOrElse(isOnFire)); // Paper - improve visual fire API
}

public void checkBelowWorld() {
Expand Down Expand Up @@ -1316,7 +1316,7 @@
- this.setSharedFlag(FLAG_INVISIBLE, invisible);
+ // CraftBukkit - start
+ if (!this.persistentInvisibility) { // Prevent Minecraft from removing our invisibility flag
+ this.setSharedFlag(5, invisible);
+ this.setSharedFlag(FLAG_INVISIBLE, invisible);
+ }
+ // CraftBukkit - end
}
Expand Down
Loading
Loading