9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

Updated Upstream (Purpur)

Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@d6ac530c [ci/skip] ignore deprecation or removal warnings
PurpurMC/Purpur@8c293626 [ci/skip] ignore deprecation or removal warnings
PurpurMC/Purpur@65b1288b Updated Upstream (Paper)
PurpurMC/Purpur@6be184ec Merge branch 'ver/1.21.4' into ver/1.21.5
PurpurMC/Purpur@0311dfcd Updated Upstream (Paper)
PurpurMC/Purpur@ecd0d703 Updated Upstream (Paper)
PurpurMC/Purpur@c5bb590f [ci/skip] Mention API Checks for CONTRIBUTING.md
PurpurMC/Purpur@96f0ee1e Add check for max growth age special case (#1652)
PurpurMC/Purpur@d4af7947 Add configurable smooth snow accumulation (#1651)
PurpurMC/Purpur@51aafbc7 Final 1.21.4 Upstream (Paper)
PurpurMC/Purpur@ba521eb6 read & write spawn data properly for placing spawners option
PurpurMC/Purpur@751d8388 fix color signs not working properly
PurpurMC/Purpur@f5a9280b Merge branch 'ver/1.21.4' into ver/1.21.5
PurpurMC/Purpur@f8450874 Updated Upstream (Paper)
This commit is contained in:
Dreeam
2025-04-14 11:07:43 -04:00
parent d08d6116f0
commit 6345e99c97
8 changed files with 107 additions and 53 deletions

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
Original license: MIT Original license: MIT
Original project: https://github.com/PurpurMC/Purpur Original project: https://github.com/PurpurMC/Purpur
Commit: 54283ad076012dd5308b92f2469c842ad054a782 Commit: f8450874da4e2d29863b544b70cc7b962a04aa70
Patches listed below are removed in this patch, They exists in Gale or Leaf: Patches listed below are removed in this patch, They exists in Gale or Leaf:
* "co/aikar/timings/TimedEventExecutor.java.patch" * "co/aikar/timings/TimedEventExecutor.java.patch"

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur Server Minecraft Changes
Original license: MIT Original license: MIT
Original project: https://github.com/PurpurMC/Purpur Original project: https://github.com/PurpurMC/Purpur
Commit: 54283ad076012dd5308b92f2469c842ad054a782 Commit: f8450874da4e2d29863b544b70cc7b962a04aa70
Patches listed below are removed in this patch, They exists in Gale or Leaf: Patches listed below are removed in this patch, They exists in Gale or Leaf:
* "net/minecraft/CrashReport.java.patch" * "net/minecraft/CrashReport.java.patch"
@@ -721,7 +721,7 @@ index f262a7c5ae4e7d56f16f5c0f4f145a2e428abbe4..614c7d9f673c926562acc8fa3b378862
private JComponent buildOnboardingPanel() { private JComponent buildOnboardingPanel() {
String onboardingLink = "https://docs.papermc.io/paper/next-steps"; String onboardingLink = "https://docs.papermc.io/paper/next-steps";
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f2518617f906576 100644 index cce8c151e46873c2de9be77d832bf695ee44ee24..66b64b243ebcde8fe551baf54aa868c4221d2e00 100644
--- a/net/minecraft/server/level/ServerLevel.java --- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java
@@ -201,6 +201,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -201,6 +201,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -798,7 +798,7 @@ index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f251861
this.setDayTime(this.levelData.getDayTime() + 1L); this.setDayTime(this.levelData.getDayTime() + 1L);
} }
} }
@@ -829,8 +857,22 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -829,7 +857,21 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public void setDayTime(long time) { public void setDayTime(long time) {
this.serverLevelData.setDayTime(time); this.serverLevelData.setDayTime(time);
@@ -810,17 +810,16 @@ index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f251861
+ this.serverLevelData.setDayTime((long) i); + this.serverLevelData.setDayTime((long) i);
+ this.forceTime = true; + this.forceTime = true;
+ // Purpur end - Configurable daylight cycle + // Purpur end - Configurable daylight cycle
} + }
+
+ // Purpur start - Configurable daylight cycle + // Purpur start - Configurable daylight cycle
+ public boolean isForceTime() { + public boolean isForceTime() {
+ return this.forceTime; + return this.forceTime;
+ } }
+ // Purpur end - Configurable daylight cycle + // Purpur end - Configurable daylight cycle
+
public void tickCustomSpawners(boolean spawnEnemies, boolean spawnFriendlies) { public void tickCustomSpawners(boolean spawnEnemies, boolean spawnFriendlies) {
for (CustomSpawner customSpawner : this.customSpawners) { for (CustomSpawner customSpawner : this.customSpawners) {
customSpawner.tick(this, spawnEnemies, spawnFriendlies);
@@ -926,9 +968,17 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -926,9 +968,17 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
&& this.random.nextDouble() < currentDifficultyAt.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses && this.random.nextDouble() < currentDifficultyAt.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
&& !this.getBlockState(blockPos.below()).is(Blocks.LIGHTNING_ROD); && !this.getBlockState(blockPos.below()).is(Blocks.LIGHTNING_ROD);
@@ -841,7 +840,43 @@ index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f251861
skeletonHorse.setAge(0); skeletonHorse.setAge(0);
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ()); skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
@@ -984,7 +1034,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -961,9 +1011,35 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
if (blockState.is(Blocks.SNOW)) {
int layersValue = blockState.getValue(SnowLayerBlock.LAYERS);
if (layersValue < Math.min(_int, 8)) {
+ // Purpur start - Smooth snow accumulation
+ boolean canSnow = true;
+ // Ensure snow doesn't get more than N layers taller than its neighbors
+ // We only need to check blocks that are taller than the minimum step height
+ if (org.purpurmc.purpur.PurpurConfig.smoothSnowAccumulationStep > 0 && layersValue >= org.purpurmc.purpur.PurpurConfig.smoothSnowAccumulationStep) {
+ int layersValueMin = layersValue - org.purpurmc.purpur.PurpurConfig.smoothSnowAccumulationStep;
+ for (Direction direction : Direction.Plane.HORIZONTAL) {
+ BlockPos blockPosNeighbor = heightmapPos.relative(direction);
+ BlockState blockStateNeighbor = this.getBlockState(blockPosNeighbor);
+ if (blockStateNeighbor.is(Blocks.SNOW)) {
+ // Special check for snow layers, if neighbors are too short, don't accumulate
+ int layersValueNeighbor = blockStateNeighbor.getValue(SnowLayerBlock.LAYERS);
+ if (layersValueNeighbor <= layersValueMin) {
+ canSnow = false;
+ break;
+ }
+ } else if (!Block.isFaceFull(blockStateNeighbor.getCollisionShape(this, blockPosNeighbor), direction.getOpposite())) {
+ // Since our layer is tall enough already, if we have a non-full neighbor block, don't accumulate
+ canSnow = false;
+ break;
+ }
+ }
+ }
+ if (canSnow) {
+ // Purpur end - Smooth snow accumulation
BlockState blockState1 = blockState.setValue(SnowLayerBlock.LAYERS, layersValue + 1);
Block.pushEntitiesUp(blockState, blockState1, this, heightmapPos);
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, blockState1, 3, null); // CraftBukkit
+ } // Purpur - Smooth snow accumulation
}
} else {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, Blocks.SNOW.defaultBlockState(), 3, null); // CraftBukkit
@@ -984,7 +1060,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
pointOfInterestType -> pointOfInterestType.is(PoiTypes.LIGHTNING_ROD), pointOfInterestType -> pointOfInterestType.is(PoiTypes.LIGHTNING_ROD),
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1, blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
pos, pos,
@@ -850,7 +885,7 @@ index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f251861
PoiManager.Occupancy.ANY PoiManager.Occupancy.ANY
); );
return optional.map(blockPos -> blockPos.above(1)); return optional.map(blockPos -> blockPos.above(1));
@@ -1033,8 +1083,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -1033,8 +1109,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
Component component; Component component;
if (this.sleepStatus.areEnoughSleeping(_int)) { if (this.sleepStatus.areEnoughSleeping(_int)) {
@@ -877,7 +912,7 @@ index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f251861
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(_int)); component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(_int));
} }
@@ -1167,6 +1235,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -1167,6 +1261,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@VisibleForTesting @VisibleForTesting
public void resetWeatherCycle() { public void resetWeatherCycle() {
// CraftBukkit start // CraftBukkit start
@@ -885,7 +920,7 @@ index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f251861
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// If we stop due to everyone sleeping we should reset the weather duration to some other random value. // If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time.... // Not that everyone ever manages to get the whole server to sleep at the same time....
@@ -1174,6 +1243,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -1174,6 +1269,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.serverLevelData.setRainTime(0); this.serverLevelData.setRainTime(0);
} }
// CraftBukkit end // CraftBukkit end
@@ -893,7 +928,7 @@ index cce8c151e46873c2de9be77d832bf695ee44ee24..0f09a2b0cbc17f1d64638f677f251861
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// CraftBukkit start // CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value. // If we stop due to everyone sleeping we should reset the weather duration to some other random value.
@@ -2652,7 +2722,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -2652,7 +2748,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// Spigot start // Spigot start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start - Fix merchant inventory not closing on entity removal // Paper start - Fix merchant inventory not closing on entity removal
@@ -2295,7 +2330,7 @@ index 3f351fdb3cb76612d88bde713a2639d4319a7c6d..745f73e1f80d9c433630e31769b404ee
protected ParticleOptions getInkParticle() { protected ParticleOptions getInkParticle() {
return ParticleTypes.GLOW_SQUID_INK; return ParticleTypes.GLOW_SQUID_INK;
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 08c2021a43f626ae142d38d0d0492bffeb1b346b..dfca015796b87059b19db55b4911bd0de2580798 100644 index befed81ecf698d27971d18fe2743562742e4e1d3..eb17ef1e0c350e97149452dbdc79398d71370fb1 100644
--- a/net/minecraft/world/entity/LivingEntity.java --- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java
@@ -224,9 +224,9 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -224,9 +224,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -15414,7 +15449,7 @@ index a31ac95237515b874f59941ec24c74e2c357b3d8..c816bd47577cbc898b10d0cfd9c40404
} }
diff --git a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java diff --git a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
index fe11f3ec82ebdbdf3d024d7273fb16b6823b1ece..05a25847d0f32e3bb9679263b3090458cadd5756 100644 index fe11f3ec82ebdbdf3d024d7273fb16b6823b1ece..daaf0ddee9192fa24a70954ce52b381560fcbc1f 100644
--- a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java --- a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
+++ b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java +++ b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
@@ -34,12 +34,12 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements @@ -34,12 +34,12 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements
@@ -15422,7 +15457,7 @@ index fe11f3ec82ebdbdf3d024d7273fb16b6823b1ece..05a25847d0f32e3bb9679263b3090458
@Override @Override
public BlockState getStateForPlacement(RandomSource random) { public BlockState getStateForPlacement(RandomSource random) {
- return this.defaultBlockState().setValue(AGE, random.nextInt(25)); - return this.defaultBlockState().setValue(AGE, random.nextInt(25));
+ return this.defaultBlockState().setValue(AGE, random.nextInt(getMaxGrowthAge())); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + return this.defaultBlockState().setValue(AGE, getMaxGrowthAge() == 0 ? 0 : random.nextInt(getMaxGrowthAge())); // Purpur - kelp, cave, weeping, and twisting configurable max growth age
} }
@Override @Override
@@ -15804,10 +15839,10 @@ index 9131098e3ae4e6ffdf1491eb62537e385f75b6b2..ddedc08a96e500a390421d39be36590f
&& ( && (
blockState.is(BlockTags.SNOW_LAYER_CAN_SURVIVE_ON) blockState.is(BlockTags.SNOW_LAYER_CAN_SURVIVE_ON)
diff --git a/net/minecraft/world/level/block/SpawnerBlock.java b/net/minecraft/world/level/block/SpawnerBlock.java diff --git a/net/minecraft/world/level/block/SpawnerBlock.java b/net/minecraft/world/level/block/SpawnerBlock.java
index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2c7881028e68179f4cdb5d4dcca0b92589b5af5b 100644 index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2076474168410f376beebc072af4959e5d08c101 100644
--- a/net/minecraft/world/level/block/SpawnerBlock.java --- a/net/minecraft/world/level/block/SpawnerBlock.java
+++ b/net/minecraft/world/level/block/SpawnerBlock.java +++ b/net/minecraft/world/level/block/SpawnerBlock.java
@@ -38,6 +38,57 @@ public class SpawnerBlock extends BaseEntityBlock { @@ -38,6 +38,59 @@ public class SpawnerBlock extends BaseEntityBlock {
); );
} }
@@ -15821,7 +15856,9 @@ index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2c7881028e68179f4cdb5d4dcca0b925
+ java.util.Optional<net.minecraft.world.entity.EntityType<?>> type = java.util.Optional.empty(); + java.util.Optional<net.minecraft.world.entity.EntityType<?>> type = java.util.Optional.empty();
+ if (nextSpawnData != null) { + if (nextSpawnData != null) {
+ type = net.minecraft.world.entity.EntityType.by(nextSpawnData.getEntityToSpawn()); + type = net.minecraft.world.entity.EntityType.by(nextSpawnData.getEntityToSpawn());
+ net.minecraft.world.level.SpawnData.CODEC.encodeStart(net.minecraft.nbt.NbtOps.INSTANCE, nextSpawnData).result().ifPresent(tag -> item.set(net.minecraft.core.component.DataComponents.CUSTOM_DATA, net.minecraft.world.item.component.CustomData.EMPTY.update(compoundTag -> compoundTag.put("Purpur.SpawnData", tag)))); + net.minecraft.nbt.CompoundTag spawnDataTag = new net.minecraft.nbt.CompoundTag();
+ spawnDataTag.storeNullable("SpawnData", net.minecraft.world.level.SpawnData.CODEC, nextSpawnData);
+ item.set(net.minecraft.core.component.DataComponents.CUSTOM_DATA, net.minecraft.world.item.component.CustomData.EMPTY.update(compoundTag -> compoundTag.put("Purpur.SpawnData", spawnDataTag)));
+ } + }
+ +
+ if (type.isPresent()) { + if (type.isPresent()) {
@@ -15865,7 +15902,7 @@ index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2c7881028e68179f4cdb5d4dcca0b925
@Override @Override
protected void spawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) { protected void spawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) {
super.spawnAfterBreak(state, level, pos, stack, dropExperience); super.spawnAfterBreak(state, level, pos, stack, dropExperience);
@@ -46,6 +97,7 @@ public class SpawnerBlock extends BaseEntityBlock { @@ -46,6 +99,7 @@ public class SpawnerBlock extends BaseEntityBlock {
@Override @Override
public int getExpDrop(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) { public int getExpDrop(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) {
@@ -16461,7 +16498,7 @@ index 4b2462ece4eb5abb76ea9259b3e6a77f8a8e4e07..d35d04823e5d0de4487310caadd013f7
+ // Purpur end - Enchantment Table Persists Lapis + // Purpur end - Enchantment Table Persists Lapis
} }
diff --git a/net/minecraft/world/level/block/entity/SignBlockEntity.java b/net/minecraft/world/level/block/entity/SignBlockEntity.java diff --git a/net/minecraft/world/level/block/entity/SignBlockEntity.java b/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 8f87248a77c2083541105cfd1da1bc87bd122ba4..c5184985867b40daf2d86ed8b354f8d0fc960329 100644 index 8f87248a77c2083541105cfd1da1bc87bd122ba4..4c5de8783b2fc87a442e194e0069ce9cd5b5fd6c 100644
--- a/net/minecraft/world/level/block/entity/SignBlockEntity.java --- a/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java +++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -151,16 +151,32 @@ public class SignBlockEntity extends BlockEntity { @@ -151,16 +151,32 @@ public class SignBlockEntity extends BlockEntity {
@@ -16499,7 +16536,7 @@ index 8f87248a77c2083541105cfd1da1bc87bd122ba4..c5184985867b40daf2d86ed8b354f8d0
); );
} }
} }
@@ -298,6 +314,26 @@ public class SignBlockEntity extends BlockEntity { @@ -298,6 +314,24 @@ public class SignBlockEntity extends BlockEntity {
return new CommandSourceStack(commandSource, Vec3.atCenterOf(pos), Vec2.ZERO, (ServerLevel)level, 2, string, component, level.getServer(), player); // Paper - Fix commands from signs not firing command events return new CommandSourceStack(commandSource, Vec3.atCenterOf(pos), Vec2.ZERO, (ServerLevel)level, 2, string, component, level.getServer(), player); // Paper - Fix commands from signs not firing command events
} }
@@ -16512,11 +16549,9 @@ index 8f87248a77c2083541105cfd1da1bc87bd122ba4..c5184985867b40daf2d86ed8b354f8d0
+ for (int i = 0; i < 4; i++) { + for (int i = 0; i < 4; i++) {
+ final var component = io.papermc.paper.adventure.PaperAdventure.asAdventure(lines[i]); + final var component = io.papermc.paper.adventure.PaperAdventure.asAdventure(lines[i]);
+ final String line = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacyAmpersand().serialize(component); + final String line = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacyAmpersand().serialize(component);
+ final var text = net.kyori.adventure.text.Component.text(line);
+ final String json = net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.gson().serialize(text);
+ final CompoundTag sideNbt = nbt.getCompoundOrEmpty(side); + final CompoundTag sideNbt = nbt.getCompoundOrEmpty(side);
+ final net.minecraft.nbt.ListTag messagesNbt = sideNbt.getListOrEmpty("messages"); + final net.minecraft.nbt.ListTag messagesNbt = sideNbt.getListOrEmpty("messages");
+ messagesNbt.set(i, net.minecraft.nbt.StringTag.valueOf(json)); + messagesNbt.set(i, net.minecraft.nbt.StringTag.valueOf(line));
+ } + }
+ nbt.putString("PurpurEditor", "true"); + nbt.putString("PurpurEditor", "true");
+ return ClientboundBlockEntityDataPacket.create(this, (blockEntity, registryAccess) -> nbt); + return ClientboundBlockEntityDataPacket.create(this, (blockEntity, registryAccess) -> nbt);
@@ -16750,10 +16785,10 @@ index c22acc8889fbb3c9ee698624189c195ee4b5eefb..5767fbfd7f33c5276fb4335ce473b2e1
} }
diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..c03f80f20761384f08ab2c07d9999297c3c96a3b index 0000000000000000000000000000000000000000..f71afc2b7f32dfe2c10ba2c14713778208cd6de3
--- /dev/null --- /dev/null
+++ b/org/purpurmc/purpur/PurpurConfig.java +++ b/org/purpurmc/purpur/PurpurConfig.java
@@ -0,0 +1,581 @@ @@ -0,0 +1,592 @@
+package org.purpurmc.purpur; +package org.purpurmc.purpur;
+ +
+import com.google.common.base.Throwables; +import com.google.common.base.Throwables;
@@ -17083,6 +17118,7 @@ index 0000000000000000000000000000000000000000..c03f80f20761384f08ab2c07d9999297
+ public static boolean cryingObsidianValidForPortalFrame = false; + public static boolean cryingObsidianValidForPortalFrame = false;
+ public static int beeInsideBeeHive = 3; + public static int beeInsideBeeHive = 3;
+ public static boolean anvilCumulativeCost = true; + public static boolean anvilCumulativeCost = true;
+ public static int smoothSnowAccumulationStep = 0;
+ public static int lightningRodRange = 128; + public static int lightningRodRange = 128;
+ public static Set<Enchantment> grindstoneIgnoredEnchants = new HashSet<>(); + public static Set<Enchantment> grindstoneIgnoredEnchants = new HashSet<>();
+ public static boolean grindstoneRemoveAttributes = false; + public static boolean grindstoneRemoveAttributes = false;
@@ -17126,6 +17162,16 @@ index 0000000000000000000000000000000000000000..c03f80f20761384f08ab2c07d9999297
+ cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame); + cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
+ beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive); + beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive);
+ anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost); + anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost);
+ smoothSnowAccumulationStep = getInt("settings.blocks.snow.smooth-accumulation-step", smoothSnowAccumulationStep);
+ if (smoothSnowAccumulationStep > 7) {
+ smoothSnowAccumulationStep = 7;
+ log(Level.WARNING, "blocks.snow.smooth-accumulation-step is set to above maximum allowed value of 7");
+ log(Level.WARNING, "Using value of 7 to prevent issues");
+ } else if (smoothSnowAccumulationStep < 0) {
+ smoothSnowAccumulationStep = 0;
+ log(Level.WARNING, "blocks.snow.smooth-accumulation-step is set to below minimum allowed value of 0");
+ log(Level.WARNING, "Using value of 0 to prevent issues");
+ }
+ lightningRodRange = getInt("settings.blocks.lightning_rod.range", lightningRodRange); + lightningRodRange = getInt("settings.blocks.lightning_rod.range", lightningRodRange);
+ ArrayList<String> defaultCurses = new ArrayList<>(){{ + ArrayList<String> defaultCurses = new ArrayList<>(){{
+ add("minecraft:binding_curse"); + add("minecraft:binding_curse");
@@ -22338,10 +22384,10 @@ index 0000000000000000000000000000000000000000..b257f35caa13b660854cf17f41fd8fba
+} +}
diff --git a/org/purpurmc/purpur/item/SpawnerItem.java b/org/purpurmc/purpur/item/SpawnerItem.java diff --git a/org/purpurmc/purpur/item/SpawnerItem.java b/org/purpurmc/purpur/item/SpawnerItem.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..f7de0c7d50382fb1a46534bfab91d70e309fa57d index 0000000000000000000000000000000000000000..cfa02aa027a049af982a05a69ce7f682580e6153
--- /dev/null --- /dev/null
+++ b/org/purpurmc/purpur/item/SpawnerItem.java +++ b/org/purpurmc/purpur/item/SpawnerItem.java
@@ -0,0 +1,41 @@ @@ -0,0 +1,43 @@
+package org.purpurmc.purpur.item; +package org.purpurmc.purpur.item;
+ +
+import java.util.Optional; +import java.util.Optional;
@@ -22376,7 +22422,9 @@ index 0000000000000000000000000000000000000000..f7de0c7d50382fb1a46534bfab91d70e
+ if (mobTypeStringOptional.isPresent()) { + if (mobTypeStringOptional.isPresent()) {
+ EntityType.byString(mobTypeStringOptional.get()).ifPresent(type -> spawner.getSpawner().setEntityId(type, level, level.random, pos)); + EntityType.byString(mobTypeStringOptional.get()).ifPresent(type -> spawner.getSpawner().setEntityId(type, level, level.random, pos));
+ } else if (customData.contains("Purpur.SpawnData")) { + } else if (customData.contains("Purpur.SpawnData")) {
+ customData.read("SpawnData", net.minecraft.world.level.SpawnData.CODEC).ifPresent(spawnData -> spawner.getSpawner().nextSpawnData = spawnData); + customData.getCompound("Purpur.SpawnData")
+ .flatMap(spawnerData -> spawnerData.read("SpawnData", net.minecraft.world.level.SpawnData.CODEC))
+ .ifPresent(spawnData -> spawner.getSpawner().nextSpawnData = spawnData);
+ } + }
+ } + }
+ } + }

View File

@@ -243,7 +243,7 @@ index 900c2fdd58da1ba6441f74175b6967b608248315..bf7f1338584d67ed93bd73f5de83a981
@Override @Override
diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java
index c03f80f20761384f08ab2c07d9999297c3c96a3b..bacfceada7d5d3d643c740af38ff8bdfb57b21f7 100644 index f71afc2b7f32dfe2c10ba2c14713778208cd6de3..23e959e348a1875d63b5862411dae162625a1aac 100644
--- a/org/purpurmc/purpur/PurpurConfig.java --- a/org/purpurmc/purpur/PurpurConfig.java
+++ b/org/purpurmc/purpur/PurpurConfig.java +++ b/org/purpurmc/purpur/PurpurConfig.java
@@ -322,6 +322,7 @@ public class PurpurConfig { @@ -322,6 +322,7 @@ public class PurpurConfig {
@@ -254,7 +254,7 @@ index c03f80f20761384f08ab2c07d9999297c3c96a3b..bacfceada7d5d3d643c740af38ff8bdf
public static boolean enderChestSixRows = false; public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false; public static boolean enderChestPermissionRows = false;
public static boolean cryingObsidianValidForPortalFrame = false; public static boolean cryingObsidianValidForPortalFrame = false;
@@ -364,6 +365,7 @@ public class PurpurConfig { @@ -365,6 +366,7 @@ public class PurpurConfig {
case 1 -> 9; case 1 -> 9;
default -> 27; default -> 27;
}); });

View File

@@ -199,10 +199,10 @@ index 209a2b6a30d334fc4f6d0b1c02682db7f0b5e435..1489ecc2754901c6f30ec1b5ff0f324b
attributesToSync.clear(); attributesToSync.clear();
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index d23ed8dbda5132337c8c96c67cf924e438ea9f4b..889b7e8752129dd3b5ba196c4b29449615499515 100644 index 66177932ec65b7c4c2df0c021eeefbdb51f71eea..fc1430cb711a86281cfc7b7c94221e7ef867da9e 100644
--- a/net/minecraft/server/level/ServerLevel.java --- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java
@@ -2477,7 +2477,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -2503,7 +2503,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@Override @Override
public LevelEntityGetter<Entity> getEntities() { public LevelEntityGetter<Entity> getEntities() {

View File

@@ -97,7 +97,7 @@ index fd3d0f6cb53bc8b6186f0d86575f21007b2c20ed..cddeeab73e7b981701a42c5aad6b4777
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
} }
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 889b7e8752129dd3b5ba196c4b29449615499515..b9bff011c0ffb0efdaccc65847be69aad1a70681 100644 index fc1430cb711a86281cfc7b7c94221e7ef867da9e..d9a9a60e63e652ca83c26dba5d7bfa3a3834af35 100644
--- a/net/minecraft/server/level/ServerLevel.java --- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java
@@ -503,7 +503,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -503,7 +503,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -109,7 +109,7 @@ index 889b7e8752129dd3b5ba196c4b29449615499515..b9bff011c0ffb0efdaccc65847be69aa
return; return;
} }
@@ -2543,7 +2543,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -2569,7 +2569,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public boolean areEntitiesActuallyLoadedAndTicking(ChunkPos chunkPos) { public boolean areEntitiesActuallyLoadedAndTicking(ChunkPos chunkPos) {
// Paper start - rewrite chunk system // Paper start - rewrite chunk system
@@ -118,7 +118,7 @@ index 889b7e8752129dd3b5ba196c4b29449615499515..b9bff011c0ffb0efdaccc65847be69aa
return chunkHolder != null && chunkHolder.isEntityTickingReady(); return chunkHolder != null && chunkHolder.isEntityTickingReady();
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
} }
@@ -2558,7 +2558,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -2584,7 +2584,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public boolean canSpawnEntitiesInChunk(ChunkPos chunkPos) { public boolean canSpawnEntitiesInChunk(ChunkPos chunkPos) {
// Paper start - rewrite chunk system // Paper start - rewrite chunk system

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur Server Paper Changes
Original license: MIT Original license: MIT
Original project: https://github.com/PurpurMC/Purpur Original project: https://github.com/PurpurMC/Purpur
Commit: 54283ad076012dd5308b92f2469c842ad054a782 Commit: f8450874da4e2d29863b544b70cc7b962a04aa70
Patches listed below are removed in this patch, They exists in Gale or Leaf: Patches listed below are removed in this patch, They exists in Gale or Leaf:
* "Rebrand.patch" * "Rebrand.patch"

View File

@@ -5,6 +5,8 @@ IS_EOL=false
IS_UNSUPPORTED=false IS_UNSUPPORTED=false
IS_DEV=true IS_DEV=true
JAR_NAME="leaf-1.21.5"
CURRENT_TAG="ver-1.21.5"
RELEASE_NOTES="release_notes.md" RELEASE_NOTES="release_notes.md"
# Branch name # Branch name
@@ -13,7 +15,7 @@ echo "✨Current branch: $CURRENT_BRANCH"
# Latest tag name # Latest tag name
LATEST_TAG=$(git describe --tags --abbrev=0) LATEST_TAG=$(git describe --tags --abbrev=0)
if [ -z "$LATEST_TAG" ]; then if [ -z $LATEST_TAG ]; then
LATEST_TAG=$(git rev-list --max-parents=0 HEAD) LATEST_TAG=$(git rev-list --max-parents=0 HEAD)
echo "⚠No previous release found. Using initial commit." echo "⚠No previous release found. Using initial commit."
else else
@@ -21,12 +23,12 @@ else
fi fi
# Commit of the latest tag # Commit of the latest tag
LAST_RELEASE_COMMIT=$(git rev-list -n 1 "$LATEST_TAG") LAST_RELEASE_COMMIT=$(git rev-list -n 1 $LATEST_TAG)
echo "✨Last release commit: $LAST_RELEASE_COMMIT" echo "✨Last release commit: $LAST_RELEASE_COMMIT"
# Commits log # Commits log
COMMIT_LOG=$(git log "$LAST_RELEASE_COMMIT"..HEAD --pretty=format:"- [\`%h\`](https://github.com/"${GITHUB_REPO}"/commit/%H) %s (%an)") COMMIT_LOG=$(git log $LAST_RELEASE_COMMIT..HEAD --pretty=format:"- [\`%h\`](https://github.com/${GITHUB_REPO}/commit/%H) %s (%an)")
if [ -z "$COMMIT_LOG" ]; then if [ -z $COMMIT_LOG ]; then
COMMIT_LOG="No new commits since $LATEST_TAG." COMMIT_LOG="No new commits since $LATEST_TAG."
else else
echo "✅Commits log generated" echo "✅Commits log generated"
@@ -45,11 +47,11 @@ echo "" >> $RELEASE_NOTES
} >> $RELEASE_NOTES } >> $RELEASE_NOTES
# Get checksums # Get checksums
file="./leaf-1.21.5-"${BUILD_NUMBER}".jar" file="./$JAR_NAME-${BUILD_NUMBER}.jar"
if [ -f "$file" ]; then if [ -f $file ]; then
MD5=$(md5sum "$file" | awk '{ print $1 }') MD5=$(md5sum $file | awk '{ print $1 }')
SHA256=$(sha256sum "$file" | awk '{ print $1 }') SHA256=$(sha256sum $file | awk '{ print $1 }')
FILENAME=$(basename "$file") FILENAME=$(basename $file)
{ {
echo "| | $FILENAME |" echo "| | $FILENAME |"
@@ -66,7 +68,7 @@ else
fi fi
# EOL warning # EOL warning
if [ "$IS_EOL" = true ]; then if [ $IS_EOL = true ]; then
{ {
echo "" echo ""
echo "> [!WARNING]" echo "> [!WARNING]"
@@ -76,7 +78,7 @@ if [ "$IS_EOL" = true ]; then
fi fi
# Unsupported warning # Unsupported warning
if [ "$IS_UNSUPPORTED" = true ]; then if [ $IS_UNSUPPORTED = true ]; then
{ {
echo "" echo ""
echo "> [!CAUTION]" echo "> [!CAUTION]"
@@ -95,6 +97,10 @@ if [ "$IS_DEV" = true ]; then
} >> $RELEASE_NOTES } >> $RELEASE_NOTES
fi fi
# Delete last tag # Delete current release tag
gh release delete ver-1.21.5 --cleanup-tag -y -R "${GITHUB_REPO}" if git show-ref --tags $CURRENT_TAG --quiet; then
{
gh release delete $CURRENT_TAG --cleanup-tag -y -R "${GITHUB_REPO}"
}
fi
echo "🚀Ready for release" echo "🚀Ready for release"

View File

@@ -1,7 +1,6 @@
# Gale TODOs # Gale TODOs
- [ ] Do a benchmark for `Remove streams and iterators from range check`, getEffectiveRange in ChunkMap - [ ] Do a benchmark for `Remove streams and iterators from range check`, getEffectiveRange in ChunkMap
- [ ] Check gale force load chunk option whether need or whether need to change. - [ ] Check gale force load chunk option whether need or whether need to change.
- [ ] check reduce array allocation, whether need do clone for some reference, to prevent potential issues.. or add debug command for debugging?.
# Leaf TODOs # Leaf TODOs
- [ ] refactor leaves protocol manager opt and pr it. - [ ] refactor leaves protocol manager opt and pr it.
@@ -15,4 +14,5 @@
# 1.21.5 # 1.21.5
- [ ] Check beacon issues fix - [ ] Check beacon issues fix
- [ ] Update README.md - [ ] Update README.md
- [ ] Remove stream in Inventory and check new changes
- [ ] Update from Leaf 1.21.4 (curr commit: `1977a5b12c01f915d7c04a765b18957cbfbeeb24`) - [ ] Update from Leaf 1.21.4 (curr commit: `1977a5b12c01f915d7c04a765b18957cbfbeeb24`)