mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-21 18:58:16 +02:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@04a97aac more renames PaperMC/Paper@bc310d25 fix wrong absorb PaperMC/Paper@546acb55 fix debug pathfinding flag PaperMC/Paper@dfa3e44f Reorganize level storage layout to closer mirror 26.1 vanilla with CB per-level 'world container' behavior. PaperMC/Paper@b50fa5ca Call BlockDispenseEvent for SpawnEggItem PaperMC/Paper@15af4554 Cleanup final CombatTracker diff PaperMC/Paper@439972cd Readd BlockGrowEvent for cactus flower PaperMC/Paper@57e26551 Correctly replace setBlock in TripWireHookBlock PaperMC/Paper@c20b0909 Skip villager treasure map trade if disabled PaperMC/Paper@fd22888e Get MapData from server data storage PaperMC/Paper@17e063ac cleanup block data PaperMC/Paper@c7003253 [ci/skip] revert command size limit to vanilla for test server PaperMC/Paper@3ed80980 Adjust tick loop logic PaperMC/Paper@af7555e5 Fix block entity ticking list (#13724) PaperMC/Paper@062aadc6 remove type id from note block instruments PaperMC/Paper@6a08bca0 finish TagKey -> HolderSet migration PaperMC/Paper@fe91bd9e fix SO error for breeze target PaperMC/Paper@a12cd1a5 update crystal proximity checks for new range PaperMC/Paper@a44c689a Reduce diff in VineBlock.java PaperMC/Paper@b3fabd13 Correctly move FarmlandBlock#fallOn super call PaperMC/Paper@4932672f Simplify diff in AbstractPiglin PaperMC/Paper@71497253 Readd dropped StemBlock BlockGrowEvent hunk PaperMC/Paper@0110d9fe Simplify diff in DoublePlantBlock PaperMC/Paper@5b507f54 Readd dropped isInWorldBounds "inline" PaperMC/Paper@63078f4b Simplify diff in ConduitBlockEntity PaperMC/Paper@fd98513c fix provides_banner_patterns component type PaperMC/Paper@6a154f13 fix some client desync PaperMC/Paper@d6b3a3f3 missed one case PaperMC/Paper@d957fb49 Call WorldGameRuleChangeEvent for World Options Menu (#13720) PaperMC/Paper@03853ba2 Skip transient components in dumpitem command (#13689)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
// Paper start - improve tick loop
|
||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L));
|
||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L));
|
||||
@@ -404,6 +_,7 @@
|
||||
@@ -419,6 +_,7 @@
|
||||
public double[] computeTPS() {
|
||||
final long interval = this.tickRateManager().nanosecondsPerTick();
|
||||
return new double[] {
|
||||
@@ -25,7 +25,7 @@
|
||||
getTPS(this.tickTimes1m, interval),
|
||||
getTPS(this.tickTimes5m, interval),
|
||||
getTPS(this.tickTimes15m, interval)
|
||||
@@ -925,6 +_,15 @@
|
||||
@@ -941,6 +_,15 @@
|
||||
|
||||
LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -41,7 +41,7 @@
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.spark.disable(); // Paper - spark
|
||||
@@ -1014,6 +_,8 @@
|
||||
@@ -1030,6 +_,8 @@
|
||||
this.safeShutdown(wait, false);
|
||||
}
|
||||
public void safeShutdown(final boolean wait, final boolean isRestarting) {
|
||||
@@ -50,7 +50,7 @@
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper - Debugging
|
||||
if (this.isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
@@ -1176,11 +_,21 @@
|
||||
@@ -1196,11 +_,21 @@
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
// Paper start - Improve outdated version checking
|
||||
@@ -73,7 +73,7 @@
|
||||
while (this.running) {
|
||||
final long tickStart = System.nanoTime(); // Paper - improve tick loop
|
||||
long thisTickNanos; // Paper - improve tick loop - diff on change, expect this to be tick interval
|
||||
@@ -1194,9 +_,11 @@
|
||||
@@ -1214,9 +_,11 @@
|
||||
final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(thisTickNanos, tickStart));
|
||||
final long catchup = (long)Math.max(
|
||||
1,
|
||||
@@ -84,9 +84,9 @@
|
||||
+ lagging = getTPS()[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur - Lagging threshold
|
||||
+
|
||||
// adjust ticksBehind so that it is not greater-than catchup
|
||||
if (ticksBehind > catchup) {
|
||||
if (ticksBehind - catchup > 0L) {
|
||||
final long difference = ticksBehind - catchup;
|
||||
@@ -1784,7 +_,7 @@
|
||||
@@ -1818,7 +_,7 @@
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -378,8 +_,25 @@
|
||||
@@ -380,8 +_,25 @@
|
||||
// CraftBukkit end
|
||||
this.tickTime = tickTime;
|
||||
this.server = server;
|
||||
@@ -36,7 +36,7 @@
|
||||
ChunkGenerator generator = levelStem.generator();
|
||||
// CraftBukkit start
|
||||
this.serverLevelData.setWorld(this);
|
||||
@@ -464,6 +_,7 @@
|
||||
@@ -465,6 +_,7 @@
|
||||
this.environmentAttributes = EnvironmentAttributeSystem.builder().addDefaultLayers(this).build();
|
||||
this.updateSkyBrightness();
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -520,7 +_,7 @@
|
||||
@@ -521,7 +_,7 @@
|
||||
}
|
||||
|
||||
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
||||
@@ -53,7 +53,7 @@
|
||||
Optional<Holder<WorldClock>> defaultClock = this.dimensionType().defaultClock();
|
||||
org.bukkit.event.world.TimeSkipEvent event = null; // Paper - time skip event
|
||||
if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) {
|
||||
@@ -728,9 +_,18 @@
|
||||
@@ -729,9 +_,18 @@
|
||||
&& this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
|
||||
&& !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS);
|
||||
if (isTrap) {
|
||||
@@ -73,7 +73,7 @@
|
||||
horse.setAge(0);
|
||||
horse.setPos(pos.getX(), pos.getY(), pos.getZ());
|
||||
this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -765,9 +_,35 @@
|
||||
@@ -766,9 +_,35 @@
|
||||
if (state.is(Blocks.SNOW)) {
|
||||
int currentLayers = state.getValue(SnowLayerBlock.LAYERS);
|
||||
if (currentLayers < Math.min(maxHeight, 8)) {
|
||||
@@ -109,7 +109,7 @@
|
||||
}
|
||||
} else {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
|
||||
@@ -788,7 +_,7 @@
|
||||
@@ -789,7 +_,7 @@
|
||||
p -> p.is(PoiTypes.LIGHTNING_ROD),
|
||||
lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1,
|
||||
center,
|
||||
@@ -118,7 +118,7 @@
|
||||
PoiManager.Occupancy.ANY
|
||||
);
|
||||
return nearbyLightningRod.map(blockPos -> blockPos.above(1));
|
||||
@@ -836,8 +_,26 @@
|
||||
@@ -837,8 +_,26 @@
|
||||
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
||||
Component message;
|
||||
if (this.sleepStatus.areEnoughSleeping(percentage)) {
|
||||
@@ -145,7 +145,7 @@
|
||||
message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage));
|
||||
}
|
||||
|
||||
@@ -1003,6 +_,7 @@
|
||||
@@ -1004,6 +_,7 @@
|
||||
public void resetWeatherCycle() {
|
||||
WeatherData weatherData = this.getWeatherData();
|
||||
// CraftBukkit start
|
||||
@@ -153,7 +153,7 @@
|
||||
weatherData.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.
|
||||
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
||||
@@ -1010,6 +_,7 @@
|
||||
@@ -1011,6 +_,7 @@
|
||||
weatherData.setRainTime(0);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -161,7 +161,7 @@
|
||||
weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||
// CraftBukkit start
|
||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||
@@ -1655,7 +_,7 @@
|
||||
@@ -1662,7 +_,7 @@
|
||||
Explosion.BlockInteraction blockInteraction = switch (interactionType) {
|
||||
case NONE -> Explosion.BlockInteraction.KEEP;
|
||||
case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY);
|
||||
@@ -170,7 +170,7 @@
|
||||
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
|
||||
: Explosion.BlockInteraction.KEEP;
|
||||
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
|
||||
@@ -2561,7 +_,7 @@
|
||||
@@ -2569,7 +_,7 @@
|
||||
// Spigot start
|
||||
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
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3998,7 +_,7 @@
|
||||
@@ -4000,7 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean canUsePortal(final boolean ignorePassenger) {
|
||||
@@ -146,7 +146,7 @@
|
||||
}
|
||||
|
||||
public boolean canTeleport(final Level from, final Level to) {
|
||||
@@ -4546,6 +_,12 @@
|
||||
@@ -4548,6 +_,12 @@
|
||||
return Mth.lerp(partial, this.yRotO, this.yRot);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
public boolean touchingUnloadedChunk() {
|
||||
AABB box = this.getBoundingBox().inflate(1.0);
|
||||
int x0 = Mth.floor(box.minX);
|
||||
@@ -4840,7 +_,7 @@
|
||||
@@ -4842,7 +_,7 @@
|
||||
}
|
||||
|
||||
public float maxUpStep() {
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
this.interestedAngleO = this.interestedAngle;
|
||||
if (this.isInterested()) {
|
||||
this.interestedAngle = this.interestedAngle + (1.0F - this.interestedAngle) * 0.4F;
|
||||
@@ -504,13 +_,27 @@
|
||||
@@ -516,13 +_,27 @@
|
||||
itemStack.consume(1, player);
|
||||
this.tryToTame(player);
|
||||
return InteractionResult.SUCCESS_SERVER;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
@@ -964,6 +_,7 @@
|
||||
@@ -965,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
protected boolean canRide(final Entity vehicle) {
|
||||
@@ -8,7 +8,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -999,7 +_,7 @@
|
||||
@@ -1000,7 +_,7 @@
|
||||
boolean shouldDrop = level.getGameRules().get(GameRules.MOB_DROPS);
|
||||
int xpCount = 500;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/net/minecraft/world/item/BlockItem.java
|
||||
@@ -138,7 +_,16 @@
|
||||
@@ -132,7 +_,16 @@
|
||||
protected boolean updateCustomBlockEntityTag(
|
||||
final BlockPos pos, final Level level, final @Nullable Player player, final ItemStack itemStack, final BlockState placedState
|
||||
) {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
protected @Nullable BlockState getPlacementState(final BlockPlaceContext context) {
|
||||
@@ -200,6 +_,7 @@
|
||||
@@ -194,6 +_,7 @@
|
||||
}
|
||||
|
||||
if (!type.onlyOpCanSetNbt() || player != null && (player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place")))) { // Spigot - add permission
|
||||
@@ -26,7 +26,7 @@
|
||||
return customData.loadInto(blockEntity, level.registryAccess());
|
||||
}
|
||||
|
||||
@@ -240,6 +_,7 @@
|
||||
@@ -234,6 +_,7 @@
|
||||
public void onDestroyed(final ItemEntity entity) {
|
||||
ItemContainerContents container = entity.getItem().set(DataComponents.CONTAINER, ItemContainerContents.EMPTY);
|
||||
if (container != null) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// revert back all captured blocks
|
||||
for (org.bukkit.block.BlockState blockstate : blocks) {
|
||||
((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace();
|
||||
+ ((org.bukkit.craftbukkit.block.CraftBlock) blockstate.getBlock()).getNMS().getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed
|
||||
+ ((org.bukkit.craftbukkit.block.CraftBlock) blockstate.getBlock()).getBlockState().getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed
|
||||
}
|
||||
|
||||
SignItem.openSign = null; // SPIGOT-6758 - Reset on early return
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/EntityGetter.java
|
||||
+++ b/net/minecraft/world/level/EntityGetter.java
|
||||
@@ -146,7 +_,7 @@
|
||||
@@ -142,7 +_,7 @@
|
||||
|
||||
default boolean hasNearbyAlivePlayer(final double x, final double y, final double z, final double range) {
|
||||
for (Player player : this.players()) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public static final MapCodec<CactusBlock> CODEC = simpleCodec(CactusBlock::new);
|
||||
public static final IntegerProperty AGE = BlockStateProperties.AGE_15;
|
||||
public static final int MAX_AGE = 15;
|
||||
@@ -117,7 +_,7 @@
|
||||
@@ -113,7 +_,7 @@
|
||||
protected boolean canSurvive(final BlockState state, final LevelReader level, final BlockPos pos) {
|
||||
for (Direction direction : Direction.Plane.HORIZONTAL) {
|
||||
BlockState neighbor = level.getBlockState(pos.relative(direction));
|
||||
@@ -18,7 +18,7 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -148,4 +_,34 @@
|
||||
@@ -144,4 +_,34 @@
|
||||
protected boolean isPathfindable(final BlockState state, final PathComputationType type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
} else if (this == Blocks.CAVE_VINES) {
|
||||
modifier = level.spigotConfig.caveVinesModifier;
|
||||
}
|
||||
- if (state.getValue(AGE) < 25 && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
+ if (state.getValue(AGE) < getMaxGrowthAge() && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution // Purpur - kelp, cave, weeping, and twisting configurable max growth age
|
||||
- if (state.getValue(AGE) < 25 && random.nextDouble() < ((modifier / 100.0) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
+ if (state.getValue(AGE) < getMaxGrowthAge() && random.nextDouble() < ((modifier / 100.0) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution // Purpur - kelp, cave, weeping, and twisting configurable max growth age
|
||||
// Spigot end
|
||||
BlockPos growthPos = pos.relative(this.growthDirection);
|
||||
if (this.canGrowInto(level.getBlockState(growthPos))) {
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
if (damageTarget && targetEntity != null) { // CraftBukkit
|
||||
- if (targetEntity.hurtServer(level, level.damageSources().magic().eventBlockDamager(level, worldPosition), 4.0F)) // CraftBukkit - move up
|
||||
+ if (targetEntity.hurtServer(level, level.damageSources().magic().eventBlockDamager(level, worldPosition), level.purpurConfig.conduitDamageAmount)) // CraftBukkit - move up // Purpur - Conduit behavior configuration
|
||||
level.playSound(
|
||||
null, targetEntity.getX(), targetEntity.getY(), targetEntity.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F
|
||||
);
|
||||
level.playSound(
|
||||
null, targetEntity.getX(), targetEntity.getY(), targetEntity.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F
|
||||
);
|
||||
@@ -225,19 +_,25 @@
|
||||
return selectNewTarget(level, pos);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user