mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-29 03:49:06 +00:00
Update to Paper 1.21.6
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -302,6 +_,7 @@
|
||||
@@ -303,6 +_,7 @@
|
||||
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
|
||||
+ public final Set<net.minecraft.world.entity.Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||
@@ -1657,6 +_,18 @@
|
||||
ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system
|
||||
@@ -1659,6 +_,18 @@
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) org.bukkit.Bukkit.getGlobalRegionScheduler()).tick();
|
||||
@@ -27,7 +27,7 @@
|
||||
getAllLevels().forEach(level -> {
|
||||
for (final net.minecraft.world.entity.Entity entity : level.getEntities().getAll()) {
|
||||
if (entity.isRemoved()) {
|
||||
@@ -1668,6 +_,8 @@
|
||||
@@ -1670,6 +_,8 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -36,7 +36,7 @@
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
profilerFiller.push("commandFunctions");
|
||||
@@ -1719,7 +_,16 @@
|
||||
@@ -1721,7 +_,16 @@
|
||||
profilerFiller.push("tick");
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -581,6 +_,31 @@
|
||||
@@ -608,6 +_,31 @@
|
||||
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
+ f1 = playerMoveControllableVehicleEvent.getTo().getPitch();
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
rootVehicle.absSnapTo(d, d1, d2, f, f1);
|
||||
this.player.absSnapTo(d, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
||||
+
|
||||
// Paper start - optimise out extra getCubes
|
||||
@@ -1468,7 +_,7 @@
|
||||
boolean teleportBack = flag1;
|
||||
if (!teleportBack) {
|
||||
@@ -1502,7 +_,7 @@
|
||||
d3 = d - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above
|
||||
d4 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above
|
||||
d5 = d2 - this.lastGoodZ; // Paper - diff on change, used for checking large move vectors above
|
||||
@@ -41,7 +41,7 @@
|
||||
if (this.player.onGround() && !packet.isOnGround() && flag) {
|
||||
// Paper start - Add PlayerJumpEvent
|
||||
org.bukkit.entity.Player player = this.getCraftPlayer();
|
||||
@@ -1502,7 +_,37 @@
|
||||
@@ -1536,7 +_,37 @@
|
||||
|
||||
boolean flag1 = this.player.verticalCollisionBelow;
|
||||
this.player.move(MoverType.PLAYER, new Vec3(d3, d4, d5));
|
||||
@@ -80,9 +80,9 @@
|
||||
final boolean didCollide = toX != this.player.getX() || toY != this.player.getY() || toZ != this.player.getZ(); // Paper - needed here as the difference in Y can be reset - also note: this is only a guess at whether collisions took place, floating point errors can make this true when it shouldn't be...
|
||||
// Paper start - prevent position desync
|
||||
if (this.awaitingPositionFromClient != null) {
|
||||
@@ -1636,14 +_,14 @@
|
||||
@@ -1669,14 +_,14 @@
|
||||
&& this.noBlocksAround(this.player);
|
||||
this.player.serverLevel().getChunkSource().move(this.player);
|
||||
this.player.level().getChunkSource().move(this.player);
|
||||
Vec3 vec3 = new Vec3(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
|
||||
- this.player.setOnGroundWithMovement(packet.isOnGround(), packet.horizontalCollision(), vec3);
|
||||
- this.player.doCheckFallDamage(vec3.x, vec3.y, vec3.z, packet.isOnGround());
|
||||
@@ -98,16 +98,16 @@
|
||||
|| this.player.hasLandedInLiquid()
|
||||
|| this.player.onClimbable()
|
||||
|| this.player.isSpectator()
|
||||
@@ -1658,7 +_,7 @@
|
||||
@@ -1691,7 +_,7 @@
|
||||
this.lastGoodZ = this.player.getZ();
|
||||
} else {
|
||||
this.internalTeleport(x, y, z, f, f1); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||
- this.player.doCheckFallDamage(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z, packet.isOnGround());
|
||||
+ this.player.doCheckFallDamage(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z, isOnGround); // SparklyPaper - Add PlayerPreMoveEvent
|
||||
this.player.removeLatestMovementRecordingBatch();
|
||||
this.player.removeLatestMovementRecording();
|
||||
}
|
||||
}
|
||||
@@ -3163,6 +_,21 @@
|
||||
@@ -3175,6 +_,21 @@
|
||||
} else {
|
||||
event = new CraftItemEvent(recipe, inventory, type, slotNum, click, action);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user