mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@e3aca921 Replace ConcurrentUtil's Validate with Objects PaperMC/Paper@9a626dd7 Rewrite ticket counter system PaperMC/Paper@65250cbe Drop "Optimize Collision to not load chunks" PaperMC/Paper@55d56d91 Apply "Flush regionfiles on save configuration option" PaperMC/Paper@920e8d35 Apply "Optimise collision checking in player move packet handling" PaperMC/Paper@ec492d3f Apply "Improve keepalive ping system" PaperMC/Paper@8f659478 Apply "Optimise EntityScheduler ticking" PaperMC/Paper@086b4fd4 Apply "Optional per player mob spawns" PaperMC/Paper@2f4211ed Apply "Improve cancelling PreCreatureSpawnEvent with per player mob spawns" PaperMC/Paper@b6d95574 Apply "Optimize Hoppers" PaperMC/Paper@388e6936 update generator PaperMC/Paper@a3c89a8f add javadocs for new api PaperMC/Paper@fcc763ad Call BlockRedstoneEvent for the shelf PaperMC/Paper@03eb18bb replace requireNonNull by checkArgument and deprecate MCUtil#toLocation PaperMC/Paper@6b7bf014 bump built-in datapack version PaperMC/Paper@2779a538 deprecate #lanterns material tag in favour of vanilla tag PaperMC/Paper@6f9957e8 Mannequin#createDefaultProfile -> Mannequin#defaultProfile PaperMC/Paper@24874e53 Also rename Mannequin profile getter/setters for consistency PaperMC/Paper@bc2ae107 Fix default respawn dimension being null for new worlds PaperMC/Paper@eb421583 Use 0.0.4 release of ConcurrentUtil PaperMC/Paper@bb017458 1.21.9-pre2 PaperMC/Paper@02492043 1.21.9-pre2 feature patches PaperMC/Paper@9360ba42 Identifying comments for MinecraftServer PaperMC/Paper@5d3aa537 Some diff improvements in prepare spawn task PaperMC/Paper@22ad4519 Move some stuff to ATs PaperMC/Paper@0ea15c97 Drop no longer applicable ATs PaperMC/Paper@cf78f2a2 bump api-version/datapack format and add a copper torch tag PaperMC/Paper@60cb0dfc generate ClientOption enums and mark CraftBlockData impl as null marked PaperMC/Paper@40252892 Add pre2 to api version PaperMC/Paper@f2cb073a Set build channel to alpha PaperMC/Paper@90b29c4c Port most of the anti-xray patch PaperMC/Paper@4a8e88dc Disable oldPaperCommit to fix CI build PaperMC/Paper@121ac2eb Port the last Anti-XRay hunk PaperMC/Paper@f43641f8 Use ConcurrentUtil 0.0.5 PaperMC/Paper@1f79388d fix end portal teleportation PaperMC/Paper@2efb400a [ci/skip] Adjust spawn location event docs PaperMC/Paper@cb9fc05d simplify overloads PaperMC/Paper@25ecc590 Enable Anti-Xray PaperMC/Paper@4d7185f6 Add AsyncPlayerSpawnLocationEvent#isNewPlayer (#13081) PaperMC/Paper@dc474a89 Fixup vanilla code for Anti-Xray changes PaperMC/Paper@0e23b024 Add back null check for chunkPacketBlockController
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -290,6 +_,7 @@
|
||||
@@ -291,6 +_,7 @@
|
||||
public joptsimple.OptionSet options;
|
||||
public org.bukkit.command.ConsoleCommandSender console;
|
||||
public static int currentTick; // Paper - improve tick loop
|
||||
@@ -8,7 +8,7 @@
|
||||
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
||||
public int autosavePeriod;
|
||||
// Paper - don't store the vanilla dispatcher
|
||||
@@ -300,7 +_,7 @@
|
||||
@@ -301,7 +_,7 @@
|
||||
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
|
||||
private static final int SAMPLE_INTERVAL = 20; // Paper - improve server tick loop
|
||||
@Deprecated(forRemoval = true) // Paper
|
||||
@@ -17,7 +17,7 @@
|
||||
// Spigot end
|
||||
public volatile boolean hasFullyShutdown; // Paper - Improved watchdog support
|
||||
public volatile boolean abnormalExit; // Paper - Improved watchdog support
|
||||
@@ -309,6 +_,8 @@
|
||||
@@ -310,6 +_,8 @@
|
||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||
@@ -923,6 +_,15 @@
|
||||
@@ -927,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
|
||||
@@ -1021,6 +_,8 @@
|
||||
@@ -1025,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
|
||||
@@ -1040,6 +_,7 @@
|
||||
@@ -1044,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);
|
||||
@@ -1126,6 +_,16 @@
|
||||
@@ -1130,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()) {
|
||||
@@ -1150,14 +_,19 @@
|
||||
@@ -1154,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
|
||||
@@ -1189,6 +_,12 @@
|
||||
@@ -1193,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();
|
||||
@@ -1634,7 +_,7 @@
|
||||
@@ -1627,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;
|
||||
@@ -1805,7 +_,7 @@
|
||||
@@ -1799,7 +_,7 @@
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -367,6 +_,7 @@
|
||||
@@ -368,6 +_,7 @@
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -484,6 +_,7 @@
|
||||
@@ -485,6 +_,7 @@
|
||||
public InteractionHand interactHand;
|
||||
public ItemStack interactItemStack;
|
||||
public InteractionResult useItemOn(ServerPlayer player, Level level, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
|
||||
@@ -16,7 +16,7 @@
|
||||
BlockPos blockPos = hitResult.getBlockPos();
|
||||
BlockState blockState = level.getBlockState(blockPos);
|
||||
boolean cancelledBlock = false;
|
||||
@@ -526,7 +_,7 @@
|
||||
@@ -527,7 +_,7 @@
|
||||
boolean flag = !player.getMainHandItem().isEmpty() || !player.getOffhandItem().isEmpty();
|
||||
boolean flag1 = player.isSecondaryUseActive() && flag;
|
||||
ItemStack itemStack = stack.copy();
|
||||
@@ -25,7 +25,7 @@
|
||||
InteractionResult interactionResult = blockState.useItemOn(player.getItemInHand(hand), level, player, hand, hitResult);
|
||||
if (interactionResult.consumesAction()) {
|
||||
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(player, blockPos, itemStack);
|
||||
@@ -572,4 +_,18 @@
|
||||
@@ -573,4 +_,18 @@
|
||||
public void setLevel(ServerLevel serverLevel) {
|
||||
this.level = serverLevel;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F, 0.02F, true));
|
||||
@@ -461,11 +_,21 @@
|
||||
@@ -457,11 +_,21 @@
|
||||
private void hitByShulkerBullet() {
|
||||
Vec3 vec3 = this.position();
|
||||
AABB boundingBox = this.getBoundingBox();
|
||||
@@ -48,7 +48,7 @@
|
||||
if (shulker != null) {
|
||||
shulker.setVariant(this.getVariant());
|
||||
shulker.snapTo(vec3);
|
||||
@@ -573,7 +_,7 @@
|
||||
@@ -569,7 +_,7 @@
|
||||
}
|
||||
|
||||
public Optional<DyeColor> getVariant() {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
public int getDamageValue() {
|
||||
return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage());
|
||||
}
|
||||
@@ -1203,6 +_,12 @@
|
||||
@@ -1209,6 +_,12 @@
|
||||
public boolean isEnchanted() {
|
||||
return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -164,11 +_,55 @@
|
||||
@@ -165,11 +_,55 @@
|
||||
}
|
||||
// Paper end - add paper world config
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
@@ -843,6 +_,8 @@
|
||||
@@ -845,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
|
||||
@@ -65,7 +65,7 @@
|
||||
this.generator = generator;
|
||||
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
|
||||
|
||||
@@ -2108,4 +_,14 @@
|
||||
@@ -2112,4 +_,14 @@
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -208,7 +_,7 @@
|
||||
@@ -263,7 +_,7 @@
|
||||
mutableBlockPos.set(x, y, z);
|
||||
double d = x + 0.5;
|
||||
double d1 = z + 0.5;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -106,6 +_,10 @@
|
||||
@@ -107,6 +_,10 @@
|
||||
input.read("PublicBukkitValues", CompoundTag.CODEC)
|
||||
.ifPresent(this.persistentDataContainer::putAll);
|
||||
// Paper end - read persistent data container
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
public final void loadWithComponents(ValueInput input) {
|
||||
@@ -118,6 +_,11 @@
|
||||
@@ -119,6 +_,11 @@
|
||||
}
|
||||
|
||||
protected void saveAdditional(ValueOutput output) {
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
public final CompoundTag saveWithFullMetadata(HolderLookup.Provider registries) {
|
||||
@@ -406,4 +_,17 @@
|
||||
@@ -408,4 +_,17 @@
|
||||
return this.blockEntity.getNameForReporting() + "@" + this.blockEntity.getBlockPos();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user