mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@cdad49b7 Do not mark plugin tickets as forced; keep correct ticket types PaperMC/Paper@a1c4fc96 Add generic ticket identifier PaperMC/Paper@745881bb Update Moonrise common for 1.21.5 PaperMC/Paper@e9d00eb6 Apply Moonrise patch PaperMC/Paper@ef0f0d10 Copy Moonrise 1.21.5 update over
This commit is contained in:
@@ -2,7 +2,7 @@ group = org.purpurmc.purpur
|
||||
version = 1.21.5-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion = 1.21.5
|
||||
paperCommit = db8c646d00d3ede50650ae27c89fd66be3be89e6
|
||||
paperCommit = ef0f0d101f97523b7b2df22fa90c04951bb48bca
|
||||
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.caching = true
|
||||
|
||||
@@ -18,10 +18,10 @@ index fa7a2a85adf7758a753c54a7cf75cc667922d3d7..b0a86aac9603e72062f59dbe67c88ed8
|
||||
public boolean isClientAuthoritative() {
|
||||
return false;
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index f34bc75f324454bf48f0ebf79111706bb027a54b..6ad266592c16bdeccfb689fb2ef2ee37e79a7b41 100644
|
||||
index f9aa990f0efa7abb681dd82fd5c8be9f8fcf917a..be8be8e3da80823917633de22985f7f4ef26dfe6 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1634,6 +1634,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1722,6 +1722,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
serverLevel.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
||||
serverLevel.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
||||
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
|
||||
@@ -30,7 +30,7 @@ index f34bc75f324454bf48f0ebf79111706bb027a54b..6ad266592c16bdeccfb689fb2ef2ee37
|
||||
/* Drop global time updates
|
||||
if (this.tickCount % 20 == 0) {
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 0e7405a480bffa81493ef2f2078c36ccda542cde..bc5c30430e79e2feb69c165d9e3e9b6a899b66ea 100644
|
||||
index 6e314abd57045693fd6016bce2b791eb68e40bb5..9b35652ed35c0b7ddb200239d932c83945ea4575 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -212,6 +212,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -42,10 +42,10 @@ index 0e7405a480bffa81493ef2f2078c36ccda542cde..bc5c30430e79e2feb69c165d9e3e9b6a
|
||||
@Override
|
||||
public @Nullable LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 839975cf328268e1f476f5c59e3323a395929395..bba6b5234b668827f90991e4885b5e19c2f97728 100644
|
||||
index 6f2640c7d7df73fc4ef5ad3f0b232bb3c4c4da47..86964fd2231bca608c2cb3155f70086e893dc1f7 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -764,6 +764,15 @@ public class ServerPlayer extends Player {
|
||||
@@ -794,6 +794,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.trackEnteredOrExitedLavaOnVehicle();
|
||||
this.updatePlayerAttributes();
|
||||
this.advancements.flushDirty(this, true);
|
||||
@@ -75,10 +75,10 @@ index 63e01ec7e4ab04bb7d389bff485dfedca344bfa2..84b1570d0d88f57f33ff8179f0a78d37
|
||||
if ((target instanceof net.minecraft.world.entity.animal.Bucketable && target instanceof LivingEntity && origItem != null && origItem == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelectedItem().isEmpty() || !ServerGamePacketListenerImpl.this.player.getInventory().getSelectedItem().is(origItem))) {
|
||||
target.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index d1899b2411e90b4641dcbc58760e4a19b62846c5..1335a04edd053c06e290c070e3c03d02598d97e7 100644
|
||||
index f6edaef36f55ef971386972b8c80d70aa4883ec7..6d18921bf283dac5279c82ae0562927db0f7f14f 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -2856,6 +2856,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3093,6 +3093,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.passengers = ImmutableList.copyOf(list);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ index d1899b2411e90b4641dcbc58760e4a19b62846c5..1335a04edd053c06e290c070e3c03d02
|
||||
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
|
||||
}
|
||||
}
|
||||
@@ -2897,6 +2904,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3134,6 +3141,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -107,7 +107,7 @@ index d1899b2411e90b4641dcbc58760e4a19b62846c5..1335a04edd053c06e290c070e3c03d02
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -4823,4 +4838,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5136,4 +5151,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
|
||||
}
|
||||
// Paper end - Expose entity id counter
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Minecart settings and WASD controls
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 6c5dab657ae7a7f5fd6fb73a86b3e8e4803dae50..998ce3a34e48e56cd907fc61cc3715518cbfae28 100644
|
||||
index 86964fd2231bca608c2cb3155f70086e893dc1f7..786222aeb501fb31e0d77661b87e8d097c88b8b7 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1153,6 +1153,11 @@ public class ServerPlayer extends Player {
|
||||
@@ -1183,6 +1183,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
} else {
|
||||
// Purpur start - Add boat fall damage config
|
||||
if (damageSource.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {
|
||||
|
||||
@@ -7,10 +7,10 @@ temporarily migrate to paper's config
|
||||
drop patch on the next minecraft release
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 6ad266592c16bdeccfb689fb2ef2ee37e79a7b41..e950e74d7c14d2e180e5ca879eb1048866d85051 100644
|
||||
index be8be8e3da80823917633de22985f7f4ef26dfe6..195dd839c50f5a86dffcbd3b6b82b5fb30a54e16 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1140,6 +1140,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1220,6 +1220,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Purpur end - config for startup commands
|
||||
|
||||
@@ -28,7 +28,7 @@ index 6ad266592c16bdeccfb689fb2ef2ee37e79a7b41..e950e74d7c14d2e180e5ca879eb10488
|
||||
long l;
|
||||
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 19bb96242fed268c23381a6f3eaef21e723666c5..127935326dbfa0aa454dc12d52dcef328fcf2771 100644
|
||||
index d02f2bb68b46678bf5033e2d310fcc6b22bd038f..8bb2c4266a543c4b6a3d9686d6010241a0f40c86 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -168,6 +168,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight
|
||||
Co-authored by: Encode42 <me@encode42.dev>
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 1335a04edd053c06e290c070e3c03d02598d97e7..7148e8c6deeb1e5f99eb6d2fe6c0fc9583e44934 100644
|
||||
index 6d18921bf283dac5279c82ae0562927db0f7f14f..f55db145661cab3cfc9ffa755792be2c3d80f50a 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -415,6 +415,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -521,6 +521,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Purpur end - Add canSaveToDisk to Entity
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||
@@ -917,6 +_,15 @@
|
||||
@@ -993,6 +_,15 @@
|
||||
|
||||
LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -42,7 +42,7 @@
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.spark.disable(); // Paper - spark
|
||||
@@ -1011,6 +_,8 @@
|
||||
@@ -1091,6 +_,8 @@
|
||||
this.safeShutdown(waitForServer, false);
|
||||
}
|
||||
public void safeShutdown(boolean waitForServer, boolean isRestarting) {
|
||||
@@ -51,7 +51,7 @@
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper - Debugging
|
||||
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
@@ -1030,6 +_,7 @@
|
||||
@@ -1110,6 +_,7 @@
|
||||
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
|
||||
private long lastTick = 0;
|
||||
private long catchupTime = 0;
|
||||
@@ -59,7 +59,7 @@
|
||||
public final RollingAverage tps1 = new RollingAverage(60);
|
||||
public final RollingAverage tps5 = new RollingAverage(60 * 5);
|
||||
public final RollingAverage tps15 = new RollingAverage(60 * 15);
|
||||
@@ -1115,6 +_,16 @@
|
||||
@@ -1195,6 +_,16 @@
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
while (this.running) {
|
||||
long l;
|
||||
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
|
||||
@@ -1139,14 +_,19 @@
|
||||
@@ -1219,14 +_,19 @@
|
||||
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
|
||||
final long diff = currentTime - tickSection;
|
||||
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
|
||||
@@ -99,7 +99,7 @@
|
||||
tickSection = currentTime;
|
||||
}
|
||||
// Paper end - further improve server tick loop
|
||||
@@ -1171,6 +_,12 @@
|
||||
@@ -1258,6 +_,12 @@
|
||||
profilerFiller.popPush("nextTickWait");
|
||||
this.mayHaveDelayedTasks = true;
|
||||
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
|
||||
@@ -112,7 +112,7 @@
|
||||
this.startMeasuringTaskExecutionTime();
|
||||
this.waitUntilNextTick();
|
||||
this.finishMeasuringTaskExecutionTime();
|
||||
@@ -1580,7 +_,7 @@
|
||||
@@ -1668,7 +_,7 @@
|
||||
long worldTime = level.getGameTime();
|
||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||
for (Player entityhuman : level.players()) {
|
||||
@@ -121,7 +121,7 @@
|
||||
continue;
|
||||
}
|
||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||
@@ -1744,7 +_,7 @@
|
||||
@@ -1832,7 +_,7 @@
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
private final RandomSequences randomSequences;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -350,7 +_,24 @@
|
||||
@@ -586,7 +_,24 @@
|
||||
// CraftBukkit end
|
||||
this.tickTime = tickTime;
|
||||
this.server = server;
|
||||
@@ -35,15 +35,15 @@
|
||||
this.serverLevelData = serverLevelData;
|
||||
ChunkGenerator chunkGenerator = levelStem.generator();
|
||||
// CraftBukkit start
|
||||
@@ -431,6 +_,7 @@
|
||||
this.gameEventDispatcher = new GameEventDispatcher(this);
|
||||
this.randomSequences = Objects.requireNonNullElseGet(randomSequences, () -> this.getDataStorage().computeIfAbsent(RandomSequences.TYPE));
|
||||
@@ -670,6 +_,7 @@
|
||||
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
|
||||
// Paper end - rewrite chunk system
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
+ this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -477,7 +_,7 @@
|
||||
@@ -716,7 +_,7 @@
|
||||
}
|
||||
|
||||
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
@@ -52,7 +52,7 @@
|
||||
// Paper start - create time skip event - move up calculations
|
||||
final long newDayTime = this.levelData.getDayTime() + 24000L;
|
||||
org.bukkit.event.world.TimeSkipEvent event = new org.bukkit.event.world.TimeSkipEvent(
|
||||
@@ -594,6 +_,13 @@
|
||||
@@ -835,6 +_,13 @@
|
||||
this.serverLevelData.getScheduledEvents().tick(this.server, l);
|
||||
Profiler.get().pop();
|
||||
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
||||
@@ -66,7 +66,7 @@
|
||||
this.setDayTime(this.levelData.getDayTime() + 1L);
|
||||
}
|
||||
}
|
||||
@@ -601,7 +_,21 @@
|
||||
@@ -842,7 +_,21 @@
|
||||
|
||||
public void setDayTime(long time) {
|
||||
this.serverLevelData.setDayTime(time);
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
public void tickCustomSpawners(boolean spawnEnemies, boolean spawnFriendlies) {
|
||||
for (CustomSpawner customSpawner : this.customSpawners) {
|
||||
@@ -678,9 +_,17 @@
|
||||
@@ -946,9 +_,17 @@
|
||||
&& 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);
|
||||
if (flag) {
|
||||
@@ -109,7 +109,7 @@
|
||||
skeletonHorse.setAge(0);
|
||||
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -738,7 +_,7 @@
|
||||
@@ -1006,7 +_,7 @@
|
||||
pointOfInterestType -> pointOfInterestType.is(PoiTypes.LIGHTNING_ROD),
|
||||
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
|
||||
pos,
|
||||
@@ -118,7 +118,7 @@
|
||||
PoiManager.Occupancy.ANY
|
||||
);
|
||||
return optional.map(blockPos -> blockPos.above(1));
|
||||
@@ -787,8 +_,26 @@
|
||||
@@ -1055,8 +_,26 @@
|
||||
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
Component component;
|
||||
if (this.sleepStatus.areEnoughSleeping(_int)) {
|
||||
@@ -145,7 +145,7 @@
|
||||
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(_int));
|
||||
}
|
||||
|
||||
@@ -921,6 +_,7 @@
|
||||
@@ -1189,6 +_,7 @@
|
||||
@VisibleForTesting
|
||||
public void resetWeatherCycle() {
|
||||
// CraftBukkit start
|
||||
@@ -153,7 +153,7 @@
|
||||
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.
|
||||
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
||||
@@ -928,6 +_,7 @@
|
||||
@@ -1196,6 +_,7 @@
|
||||
this.serverLevelData.setRainTime(0);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -161,7 +161,7 @@
|
||||
this.serverLevelData.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.
|
||||
@@ -2331,7 +_,7 @@
|
||||
@@ -2644,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
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
+ private boolean compassBar = false; // Purpur - Add compass command
|
||||
+ private boolean ramBar = false; // Purpur - Implement rambar commands
|
||||
|
||||
public ServerPlayer(MinecraftServer server, ServerLevel level, GameProfile gameProfile, ClientInformation clientInformation) {
|
||||
super(level, level.getSharedSpawnPos(), level.getSharedSpawnAngle(), gameProfile);
|
||||
@@ -525,6 +_,10 @@
|
||||
// Paper start - rewrite chunk system
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
@@ -555,6 +_,10 @@
|
||||
this.respawnConfig = compound.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
|
||||
this.spawnExtraParticlesOnFall = compound.getBooleanOr("spawn_extra_particles_on_fall", false);
|
||||
this.raidOmenPosition = compound.read("raid_omen_position", BlockPos.CODEC).orElse(null);
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -542,6 +_,9 @@
|
||||
@@ -572,6 +_,9 @@
|
||||
compound.storeNullable("raid_omen_position", BlockPos.CODEC, this.raidOmenPosition);
|
||||
this.saveEnderPearls(compound);
|
||||
this.getBukkitEntity().setExtraData(compound); // CraftBukkit
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
|
||||
private void saveParentVehicle(CompoundTag tag) {
|
||||
@@ -1024,6 +_,7 @@
|
||||
@@ -1054,6 +_,7 @@
|
||||
)
|
||||
);
|
||||
Team team = this.getTeam();
|
||||
@@ -40,7 +40,7 @@
|
||||
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
|
||||
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
|
||||
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
|
||||
@@ -1130,6 +_,13 @@
|
||||
@@ -1160,6 +_,13 @@
|
||||
if (this.isInvulnerableTo(level, damageSource)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -54,7 +54,7 @@
|
||||
Entity entity = damageSource.getEntity();
|
||||
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
||||
!(entity instanceof Player player && !this.canHarmPlayer(player))
|
||||
@@ -1360,6 +_,7 @@
|
||||
@@ -1390,6 +_,7 @@
|
||||
serverLevel.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
this.unsetRemoved();
|
||||
// CraftBukkit end
|
||||
@@ -62,7 +62,7 @@
|
||||
this.setServerLevel(level);
|
||||
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
|
||||
this.connection.resetPosition();
|
||||
@@ -1477,7 +_,7 @@
|
||||
@@ -1507,7 +_,7 @@
|
||||
new AABB(vec3.x() - 8.0, vec3.y() - 5.0, vec3.z() - 8.0, vec3.x() + 8.0, vec3.y() + 5.0, vec3.z() + 8.0),
|
||||
monster -> monster.isPreventingPlayerRest(this.serverLevel(), this)
|
||||
);
|
||||
@@ -71,7 +71,7 @@
|
||||
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
||||
}
|
||||
}
|
||||
@@ -1514,7 +_,19 @@
|
||||
@@ -1544,7 +_,19 @@
|
||||
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
|
||||
});
|
||||
if (!this.serverLevel().canSleepThroughNights()) {
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
|
||||
((ServerLevel)this.level()).updateSleepingPlayerList();
|
||||
@@ -1606,6 +_,7 @@
|
||||
@@ -1636,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText) {
|
||||
@@ -100,7 +100,7 @@
|
||||
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), signEntity.getBlockPos()));
|
||||
this.connection.send(new ClientboundOpenSignEditorPacket(signEntity.getBlockPos(), isFrontText));
|
||||
}
|
||||
@@ -1908,6 +_,26 @@
|
||||
@@ -1938,6 +_,26 @@
|
||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
@Override
|
||||
public void displayClientMessage(Component chatComponent, boolean actionBar) {
|
||||
this.sendSystemMessage(chatComponent, actionBar);
|
||||
@@ -2125,6 +_,20 @@
|
||||
@@ -2155,6 +_,20 @@
|
||||
);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
public void sendSystemMessage(Component mesage) {
|
||||
this.sendSystemMessage(mesage, false);
|
||||
}
|
||||
@@ -2263,7 +_,67 @@
|
||||
@@ -2293,7 +_,67 @@
|
||||
|
||||
public void resetLastActionTime() {
|
||||
this.lastActionTime = Util.getMillis();
|
||||
@@ -217,7 +217,7 @@
|
||||
|
||||
public ServerStatsCounter getStats() {
|
||||
return this.stats;
|
||||
@@ -2891,4 +_,56 @@
|
||||
@@ -2921,4 +_,56 @@
|
||||
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -284,6 +_,7 @@
|
||||
@@ -314,6 +_,7 @@
|
||||
return true;
|
||||
} else {
|
||||
// Paper start - Buffer OOB setBlock calls
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
@@ -141,6 +_,7 @@
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
||||
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, DataComponentGetter {
|
||||
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||
+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes
|
||||
// CraftBukkit start
|
||||
private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger();
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
@@ -304,8 +_,9 @@
|
||||
@@ -260,8 +_,9 @@
|
||||
public double xOld;
|
||||
public double yOld;
|
||||
public double zOld;
|
||||
@@ -19,7 +19,7 @@
|
||||
public int tickCount;
|
||||
private int remainingFireTicks = -this.getFireImmuneTicks();
|
||||
public boolean wasTouchingWater;
|
||||
@@ -339,8 +_,8 @@
|
||||
@@ -295,8 +_,8 @@
|
||||
public PortalProcessor portalProcess;
|
||||
public int portalCooldown;
|
||||
private boolean invulnerable;
|
||||
@@ -30,7 +30,7 @@
|
||||
private boolean hasGlowingTag;
|
||||
private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
|
||||
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
|
||||
@@ -394,6 +_,7 @@
|
||||
@@ -350,6 +_,7 @@
|
||||
public long activatedTick = Integer.MIN_VALUE;
|
||||
public boolean isTemporarilyActive;
|
||||
public long activatedImmunityTick = Integer.MIN_VALUE;
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
public void inactiveTick() {
|
||||
}
|
||||
@@ -406,10 +_,21 @@
|
||||
@@ -512,10 +_,21 @@
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - optimise entity tracker
|
||||
|
||||
+ // Purpur start - Add canSaveToDisk to Entity
|
||||
+ public boolean canSaveToDisk() {
|
||||
@@ -60,7 +60,7 @@
|
||||
this.position = Vec3.ZERO;
|
||||
this.blockPosition = BlockPos.ZERO;
|
||||
this.chunkPosition = ChunkPos.ZERO;
|
||||
@@ -779,6 +_,7 @@
|
||||
@@ -885,6 +_,7 @@
|
||||
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
|
||||
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
|
||||
// Paper end - Configurable nether ceiling damage
|
||||
@@ -68,7 +68,7 @@
|
||||
this.onBelowWorld();
|
||||
}
|
||||
}
|
||||
@@ -1682,7 +_,7 @@
|
||||
@@ -1830,7 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -1742,7 +_,7 @@
|
||||
@@ -1890,7 +_,7 @@
|
||||
return this.isInWater() || flag;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
if (this.getVehicle() instanceof AbstractBoat abstractBoat && !abstractBoat.isUnderWater()) {
|
||||
this.wasTouchingWater = false;
|
||||
} else if (this.updateFluidHeightAndDoFluidPushing(FluidTags.WATER, 0.014)) {
|
||||
@@ -2364,6 +_,13 @@
|
||||
@@ -2512,6 +_,13 @@
|
||||
compound.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -100,7 +100,7 @@
|
||||
return compound;
|
||||
} catch (Throwable var8) {
|
||||
CrashReport crashReport = CrashReport.forThrowable(var8, "Saving entity NBT");
|
||||
@@ -2481,6 +_,13 @@
|
||||
@@ -2629,6 +_,13 @@
|
||||
freezeLocked = compound.getBooleanOr("Paper.FreezeLock", false);
|
||||
}
|
||||
// Paper end
|
||||
@@ -114,7 +114,7 @@
|
||||
} catch (Throwable var8) {
|
||||
CrashReport crashReport = CrashReport.forThrowable(var8, "Loading entity NBT");
|
||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
|
||||
@@ -2620,6 +_,7 @@
|
||||
@@ -2857,6 +_,7 @@
|
||||
if (this.isAlive() && this instanceof Leashable leashable) {
|
||||
if (leashable.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -122,7 +122,7 @@
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
// Paper start - Expand EntityUnleashEvent
|
||||
org.bukkit.event.player.PlayerUnleashEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials());
|
||||
@@ -2936,15 +_,18 @@
|
||||
@@ -3173,15 +_,18 @@
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3149,7 +_,7 @@
|
||||
@@ -3386,7 +_,7 @@
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -151,7 +151,7 @@
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -3677,7 +_,7 @@
|
||||
@@ -3914,7 +_,7 @@
|
||||
// CraftBukkit end
|
||||
|
||||
public boolean canUsePortal(boolean allowPassengers) {
|
||||
@@ -160,7 +160,7 @@
|
||||
}
|
||||
|
||||
public boolean canTeleport(Level fromLevel, Level toLevel) {
|
||||
@@ -4212,6 +_,12 @@
|
||||
@@ -4451,6 +_,12 @@
|
||||
return Mth.lerp(partialTick, this.yRotO, this.yRot);
|
||||
}
|
||||
|
||||
@@ -170,10 +170,10 @@
|
||||
+ }
|
||||
+ // Purpur end - Stop squids floating on top of water
|
||||
+
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> fluidTag, double motionScale) {
|
||||
// Paper start - optimise collisions
|
||||
public boolean updateFluidHeightAndDoFluidPushing(final TagKey<Fluid> fluid, final double flowScale) {
|
||||
if (this.touchingUnloadedChunk()) {
|
||||
return false;
|
||||
@@ -4552,7 +_,7 @@
|
||||
@@ -4859,7 +_,7 @@
|
||||
}
|
||||
|
||||
public float maxUpStep() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/EntityGetter.java
|
||||
+++ b/net/minecraft/world/level/EntityGetter.java
|
||||
@@ -144,7 +_,7 @@
|
||||
@@ -185,7 +_,7 @@
|
||||
|
||||
default boolean hasNearbyAlivePlayer(double x, double y, double z, double distance) {
|
||||
for (Player player : this.players()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -158,11 +_,55 @@
|
||||
@@ -159,11 +_,55 @@
|
||||
}
|
||||
// Paper end - add paper world config
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
@@ -206,6 +_,8 @@
|
||||
) {
|
||||
@@ -839,6 +_,8 @@
|
||||
// Paper end - getblock optimisations - cache world height/sections
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
+ this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), env); // Purpur - Purpur config files
|
||||
@@ -65,7 +65,7 @@
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
@@ -1412,4 +_,14 @@
|
||||
@@ -2115,4 +_,14 @@
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -73,7 +_,7 @@
|
||||
@@ -316,7 +_,7 @@
|
||||
) {
|
||||
this.level = level;
|
||||
this.source = source;
|
||||
@@ -9,7 +9,7 @@
|
||||
this.center = center;
|
||||
this.fire = fire;
|
||||
this.blockInteraction = blockInteraction;
|
||||
@@ -356,10 +_,27 @@
|
||||
@@ -638,10 +_,27 @@
|
||||
|
||||
public void explode() {
|
||||
// CraftBukkit start
|
||||
@@ -35,6 +35,6 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Add PreExplodeEvents
|
||||
this.level.gameEvent(this.source, GameEvent.EXPLODE, this.center);
|
||||
List<BlockPos> list = this.calculateExplodedPositions();
|
||||
this.hurtEntities();
|
||||
// Paper start - collision optimisations
|
||||
this.blockCache = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>();
|
||||
this.chunkPosCache = new long[CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -49,7 +_,7 @@
|
||||
@@ -238,7 +_,7 @@
|
||||
|
||||
// Paper start
|
||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -190,7 +_,7 @@
|
||||
@@ -232,7 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
BlockState blockState1 = level.getBlockState(mutableBlockPos.setWithOffset(pos, Direction.DOWN));
|
||||
FluidState fluidState1 = blockState1.getFluidState();
|
||||
if (blockState1.isSolid() || this.isSourceBlockOfThisType(fluidState1)) {
|
||||
@@ -267,6 +_,12 @@
|
||||
@@ -319,6 +_,12 @@
|
||||
}
|
||||
|
||||
protected abstract boolean canConvertToSource(ServerLevel level);
|
||||
|
||||
Reference in New Issue
Block a user