mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
More more work
This commit is contained in:
parent
24201b38ce
commit
ee2c1caf9b
95 changed files with 30 additions and 51 deletions
patches/server
Add-PlayerAttackEntityCooldownResetEvent.patchAdd-Raw-Byte-ItemStack-Serialization.patchAdd-ThrownEggHatchEvent.patchAdd-debug-for-sync-chunk-loads.patchAdd-effect-to-block-break-naturally.patchAdd-option-for-console-having-all-permissions.patchAdd-option-to-allow-iron-golems-to-spawn-in-air.patchAdd-option-to-nerf-pigmen-from-nether-portals.patchAdd-phantom-creative-and-insomniac-controls.patchAdd-tick-times-API-and-mspt-command.patchAdd-villager-reputation-API.patchAnti-Xray.patchAvoid-hopper-searches-if-there-are-no-items.patchBees-get-gravity-in-void.-Fixes-MC-167279.patchConfigurable-chance-of-villager-zombie-infection.patchDead-Player-s-shouldn-t-be-able-to-move.patchDelay-Chunk-Unloads-based-on-Player-Movement.patchDeobfuscate-stacktraces-in-log-messages-crash-report.patchDo-not-allow-bees-to-load-chunks-for-beehives.patchDon-t-crash-if-player-is-attempted-to-be-removed-fro.patchDon-t-fire-BlockFade-on-worldgen-threads.patchDon-t-move-existing-players-to-world-spawn.patchDon-t-run-entity-collision-code-if-not-needed.patchDon-t-tick-dead-players.patchEnsure-EntityRaider-respects-game-and-entity-rules-f.patchEnsure-safe-gateway-teleport.patchEntity-Activation-Range-2.0.patchEntity-Jump-API.patchExperienceOrbMergeEvent.patchExpose-MinecraftServer-isRunning.patchExpose-game-version.patchFix-Chunk-Post-Processing-deadlock-risk.patchFix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patchFix-Light-Command.patchFix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patchFix-PotionEffect-ignores-icon-flag.patchFix-items-not-falling-correctly.patchFix-items-vanishing-through-end-portal.patchFix-last-firework-in-stack-not-having-effects-when-d.patchFix-missing-chunks-due-to-integer-overflow.patchFix-numerous-item-duplication-issues-and-teleport-is.patchFix-piston-physics-inconsistency-MC-188840.patchFix-sand-duping.patchFix-villager-trading-demand-MC-163962.patchGuard-against-serializing-mismatching-chunk-coordina.patchImplement-Mob-Goal-API.patchImplement-Player-Client-Options-API.patchImplement-alternative-item-despawn-rate.patchImprove-Arrow-API.patchImproved-Watchdog-Support.patchIncrease-Light-Queue-Size.patchInventory-getHolder-method-without-block-snapshot.patchLag-compensate-eating.patchLoad-Chunks-for-Login-Asynchronously.patchMake-the-GUI-graph-fancier.patchMaps-shouldn-t-load-chunks.patchMove-player-to-spawn-point-if-spawn-in-unloaded-worl.patchOptimise-ArraySetSorted-removeIf.patchOptimise-Chunk-getFluid.patchOptimise-IEntityAccess-getPlayerByUUID.patchOptimise-getChunkAt-calls-for-loaded-chunks.patchOptimize-Collision-to-not-load-chunks.patchOptimize-GoalSelector-Goal.Flag-Set-operations.patchOptimize-Pathfinding.patchOptimize-ServerLevels-chunk-level-checking-methods.patchOptimize-Voxel-Shape-Merging.patchOptimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patchOptimize-brigadier-child-sorting-performance.patchOptimize-call-to-getFluid-for-explosions.patchOption-for-maximum-exp-value-when-merging-orbs.patchPillager-patrol-spawn-settings-and-per-player-option.patchPotential-bed-API.patchPrevent-Double-PlayerChunkMap-adds-crashing-server.patchPrevent-opening-inventories-when-frozen.patchPrevent-position-desync-in-playerconnection-causing-.patchPrevent-teleporting-dead-entities.patchProtect-Bedrock-and-End-Portal-Frames-from-being-des.patchReduce-Either-Optional-allocation.patchReduce-MutableInt-allocations-from-light-engine.patchReduce-allocation-of-Vec3D-by-entity-tracker.patchReduce-memory-footprint-of-NBTTagCompound.patchRemote-Connections-shouldn-t-hold-up-shutdown.patchRemove-garbage-Java-version-check.patchSet-cap-on-JDK-per-thread-native-byte-buffer-cache.patchSet-spigots-verbose-world-setting-to-false-by-def.patchTracking-Range-Improvements.patchUse-distance-map-to-optimise-entity-tracker.patchUse-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patchValidate-PickItem-Packet-and-kick-for-invalid.patchValidate-tripwire-hook-placement-before-update.patchVillager-Restocks-API.patchWait-for-Async-Tasks-during-shutdown.patchadd-hand-to-BlockMultiPlaceEvent.patchimplement-optional-per-player-mob-spawns.patchmisc-debugging-dumps.patch
|
@ -1262,25 +1262,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.threadingDetector.checkAndUnlock();
|
||||
}
|
||||
|
||||
- public static <T> Codec<PalettedContainer<T>> codecRW(IdMap<T> idMap, Codec<T> codec, PalettedContainer.Strategy strategy, T object) {
|
||||
- PalettedContainerRO.Unpacker<T, PalettedContainer<T>> unpacker = PalettedContainer::unpack;
|
||||
- public static <T> Codec<PalettedContainer<T>> codecRW(IdMap<T> idList, Codec<T> entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) {
|
||||
+ // Paper start - Anti-Xray - Add preset values
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse public static <T> Codec<PalettedContainer<T>> codecRW(IdMap<T> idMap, Codec<T> codec, PalettedContainer.Strategy strategy, T object) { return PalettedContainer.codecRW(idMap, codec, strategy, object, null); }
|
||||
+ public static <T> Codec<PalettedContainer<T>> codecRW(IdMap<T> idMap, Codec<T> codec, PalettedContainer.Strategy strategy, T object, T @org.jetbrains.annotations.Nullable [] presetValues) {
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse public static <T> Codec<PalettedContainer<T>> codecRW(IdMap<T> idList, Codec<T> entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) {return codecRW(idList, entryCodec, paletteProvider, defaultValue, null);}
|
||||
+ public static <T> Codec<PalettedContainer<T>> codecRW(IdMap<T> idList, Codec<T> entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) {
|
||||
+ PalettedContainerRO.Unpacker<T, PalettedContainer<T>> unpacker = (idMapx, strategyx, packedData) -> {
|
||||
+ return unpack(idMapx, strategyx, packedData, object, presetValues);
|
||||
+ };
|
||||
+ // Paper end
|
||||
return codec(idMap, codec, strategy, object, unpacker);
|
||||
PalettedContainerRO.Unpacker<T, PalettedContainer<T>> unpacker = PalettedContainer::unpack;
|
||||
return codec(idList, entryCodec, paletteProvider, defaultValue, unpacker);
|
||||
}
|
||||
|
||||
public static <T> Codec<PalettedContainerRO<T>> codecRO(IdMap<T> idMap, Codec<T> codec, PalettedContainer.Strategy strategy, T object) {
|
||||
PalettedContainerRO.Unpacker<T, PalettedContainerRO<T>> unpacker = (idMapx, strategyx, packedData) -> {
|
||||
- return unpack(idMapx, strategyx, packedData).map((palettedContainer) -> {
|
||||
+ return unpack(idMapx, strategyx, packedData, object, null).map((palettedContainer) -> { // Paper - Anti-Xray - Add preset values
|
||||
return palettedContainer;
|
||||
});
|
||||
};
|
||||
@@ -0,0 +0,0 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
|
||||
});
|
||||
}
|
||||
|
@ -1407,17 +1399,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
}
|
||||
|
||||
- private static <T> DataResult<PalettedContainer<T>> unpack(IdMap<T> idMap, PalettedContainer.Strategy strategy, PalettedContainerRO.PackedData<T> packedData) {
|
||||
+ private static <T> DataResult<PalettedContainer<T>> unpack(IdMap<T> idMap, PalettedContainer.Strategy strategy, PalettedContainerRO.PackedData<T> packedData, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { // Paper - Anti-Xray - Add preset values
|
||||
List<T> list = packedData.paletteEntries();
|
||||
int i = strategy.size();
|
||||
int j = strategy.calculateBitsForSerialization(idMap, list.size());
|
||||
- private static <T> DataResult<PalettedContainer<T>> unpack(IdMap<T> idList, PalettedContainer.Strategy paletteProvider, PalettedContainerRO.PackedData<T> serialized) {
|
||||
+ private static <T> DataResult<PalettedContainer<T>> unpack(IdMap<T> idList, PalettedContainer.Strategy paletteProvider, PalettedContainerRO.PackedData<T> serialized, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { // Paper - Anti-Xray - Add preset values
|
||||
List<T> list = serialized.paletteEntries();
|
||||
int i = paletteProvider.size();
|
||||
int j = paletteProvider.calculateBitsForSerialization(idList, list.size());
|
||||
@@ -0,0 +0,0 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
|
||||
}
|
||||
}
|
||||
|
||||
- return DataResult.success(new PalettedContainer<>(idMap, strategy, configuration, bitStorage, list));
|
||||
+ return DataResult.success(new PalettedContainer<>(idMap, strategy, configuration, bitStorage, list, defaultValue, presetValues)); // Paper - Anti-Xray - Add preset values
|
||||
- return DataResult.success(new PalettedContainer<>(idList, paletteProvider, configuration, bitStorage, list));
|
||||
+ return DataResult.success(new PalettedContainer<>(idList, paletteProvider, configuration, bitStorage, list, defaultValue, presetValues)); // Paper - Anti-Xray - Add preset values
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1464,7 +1456,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java
|
||||
@@ -0,0 +0,0 @@ public interface PalettedContainerRO<T> {
|
||||
|
||||
void getAll(Consumer<T> consumer);
|
||||
void getAll(Consumer<T> action);
|
||||
|
||||
- void write(FriendlyByteBuf buf);
|
||||
+ // Paper start - Anti-Xray - Add chunk packet info
|
|
@ -522,19 +522,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
});
|
||||
private final PacketFlow receiving;
|
||||
private final Queue<Connection.PacketHolder> queue = Queues.newConcurrentLinkedQueue();
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
@@ -0,0 +0,0 @@ public class ServerboundChatPacket implements Packet<ServerGamePacketListener> {
|
||||
|
||||
// Spigot Start
|
||||
private static final java.util.concurrent.ExecutorService executors = java.util.concurrent.Executors.newCachedThreadPool(
|
||||
- new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon( true ).setNameFormat( "Async Chat Thread - #%d" ).build() );
|
||||
+ new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon( true ).setNameFormat( "Async Chat Thread - #%d" ).setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)).build() ); // Paper
|
||||
public void handle(final ServerGamePacketListener listener) {
|
||||
if ( !this.message.startsWith("/") )
|
||||
{
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
@ -19,11 +19,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java
|
||||
@@ -0,0 +0,0 @@ public final class DensityFunctions {
|
||||
int l = j / 2;
|
||||
int m = i % 2;
|
||||
int n = j % 2;
|
||||
- float f = 100.0F - Mth.sqrt((float)(i * i + j * j)) * 8.0F;
|
||||
+ float f = 100.0F - Mth.sqrt((long) i * (long) i + (long) j * (long) j) * 8.0F; // Paper - cast ints to long to avoid integer overflow
|
||||
int j = z / 2;
|
||||
int k = x % 2;
|
||||
int l = z % 2;
|
||||
- float f = 100.0F - Mth.sqrt((float)(x * x + z * z)) * 8.0F;
|
||||
+ float f = 100.0F - Mth.sqrt((long) x * (long) x + (long) z * (long) z) * 8.0F; // Paper - cast ints to long to avoid integer overflow
|
||||
f = Mth.clamp(f, -100.0F, 80.0F);
|
||||
|
||||
for(int o = -12; o <= 12; ++o) {
|
||||
for(int m = -12; m <= 12; ++m) {
|
|
@ -40,17 +40,17 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
private static final int NO_BLOCK_UPDATES_TO_ACK = -1;
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
private static final int PENDING_MESSAGE_DISCONNECT_THRESHOLD = 4096;
|
||||
public final Connection connection;
|
||||
private final MinecraftServer server;
|
||||
+ public Runnable playerJoinReady; // Paper
|
||||
public ServerPlayer player;
|
||||
private int tickCount;
|
||||
private int ackBlockChangesUpTo = -1;
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
// CraftBukkit end
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ // Paper start - login async
|
||||
+ Runnable playerJoinReady = this.playerJoinReady;
|
||||
|
@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
if (this.ackBlockChangesUpTo > -1) {
|
||||
this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo));
|
||||
this.ackBlockChangesUpTo = -1;
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
this.lastVehicle = null;
|
||||
this.clientVehicleIsFloating = false;
|
||||
this.aboveGroundVehicleTickCount = 0;
|
||||
|
@ -77,7 +77,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
|
||||
}
|
||||
// Paper end
|
||||
} else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) {
|
||||
|
@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
if (entityplayer == null) {
|
||||
this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
|
||||
}
|
||||
|
||||
this.connection.send(new ClientboundGameProfilePacket(this.gameProfile));
|
|
@ -17,7 +17,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
|
||||
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
|
||||
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<ClientboundPlayerPositionPacket.RelativeArgument> set, boolean flag) {
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@Override
|
||||
public void handlePickItem(ServerboundPickItemPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
|
@ -61,7 +61,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
|
||||
} catch (Exception exception) {
|
||||
ServerLoginPacketListenerImpl.LOGGER.error("Couldn't place player in world", exception);
|
||||
MutableComponent ichatmutablecomponent = Component.translatable("multiplayer.disconnect.invalid_player_data");
|
Loading…
Add table
Reference in a new issue