More more more more more more more patches

This commit is contained in:
Nassim Jahnke 2023-03-14 21:55:49 +01:00
parent bacf389fc3
commit 1295869b43
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
131 changed files with 354 additions and 345 deletions

View File

@ -11,10 +11,10 @@ in IWorldServerData are removed as they were only used in certain places, with h
values used in other places. values used in other places.
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
index 83d0db5a9f03ee3ead10d9f61e5f425330eae0e9..02562a036d99d0ddadea28ae807c8e9463a8e341 100644 index 83d0db5a9f03ee3ead10d9f61e5f425330eae0e9..ae9f9112ce9bec82e7571f679017f1723d9eb982 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -40,32 +40,41 @@ public class WanderingTraderSpawner implements CustomSpawner { @@ -40,43 +40,54 @@ public class WanderingTraderSpawner implements CustomSpawner {
public WanderingTraderSpawner(ServerLevelData properties) { public WanderingTraderSpawner(ServerLevelData properties) {
this.serverLevelData = properties; this.serverLevelData = properties;
@ -70,9 +70,9 @@ index 83d0db5a9f03ee3ead10d9f61e5f425330eae0e9..02562a036d99d0ddadea28ae807c8e94
if (!world.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) { if (!world.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) {
return 0; return 0;
} else { } else {
@@ -73,10 +82,13 @@ public class WanderingTraderSpawner implements CustomSpawner { int i = this.spawnChance;
this.spawnChance = Mth.clamp(this.spawnChance + 25, 25, 75); - this.spawnChance = Mth.clamp(this.spawnChance + 25, 25, 75);
this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance);
+ this.spawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax); + this.spawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax);
+ //this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways + //this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways

View File

@ -974,7 +974,7 @@ index 3fc17817906876e83f040f908b8b1ba6cfa37b8b..9f138bc471b5c2a4fa813ff943dbe340
private boolean isValid; private boolean isValid;
public final Optional<PoiSection> noAllocateOptional = Optional.of(this); // Paper - rewrite chunk system public final Optional<PoiSection> noAllocateOptional = Optional.of(this); // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
index c396076bfb1d41cc0f8248d6f3aa4fc3f7d1c998..d783072bc964e45c308197e6f79874eb4a09f871 100644 index fc5901a257ffd6ec878d1acbf97b9e6be664c52e..82bdb2731c561e9802497214c20ca5193739bd7d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
@@ -71,11 +71,11 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl @@ -71,11 +71,11 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Optimise chunk tick iteration
Use a dedicated list of entity ticking chunks to reduce the cost Use a dedicated list of entity ticking chunks to reduce the cost
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index a61f55ed1fbe5aac5289014cb95cb6950b4c77fa..e11ec87e8007979a1c6932b414bcd70c10db746c 100644 index 51c112656f26f142bd6c126253520e812a338783..0f2590501d742b1f5a410d45c7781bd18b4a4525 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -88,6 +88,11 @@ public class ChunkHolder { @@ -88,6 +88,11 @@ public class ChunkHolder {
@ -72,10 +72,10 @@ index a61f55ed1fbe5aac5289014cb95cb6950b4c77fa..e11ec87e8007979a1c6932b414bcd70c
int i = 0; int i = 0;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 81870f23ae70db3a1290428df6a47d76baa9a722..1b8f221360f5edb4d244ec97104d85ffecef204c 100644 index 503a642165f6f1292c07e8a9e618218bb96a97e9..b0cfdead8a345eaab7747ed6b84271e8e09d1713 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -113,6 +113,8 @@ import org.bukkit.craftbukkit.generator.CustomChunkGenerator; @@ -116,6 +116,8 @@ import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
// CraftBukkit end // CraftBukkit end
@ -84,7 +84,7 @@ index 81870f23ae70db3a1290428df6a47d76baa9a722..1b8f221360f5edb4d244ec97104d85ff
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider { public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
private static final byte CHUNK_TYPE_REPLACEABLE = -1; private static final byte CHUNK_TYPE_REPLACEABLE = -1;
@@ -151,6 +153,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -154,6 +156,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
private final Queue<Runnable> unloadQueue; private final Queue<Runnable> unloadQueue;
int viewDistance; int viewDistance;
public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobDistanceMap; // Paper public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobDistanceMap; // Paper

View File

@ -19,7 +19,7 @@ index 23e564b05ba438924180c91f9b19a60731eedd1b..5ec241d49ff5e3a161a39006f05823a5
private MinecraftTimings() {} private MinecraftTimings() {}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 34619d107231fe188d2b4c8eeefba8b6eaf4d3a5..4fb05a2be3ff06ceddae37e1592db548c727a056 100644 index 990cbc7a5bdfa0bcdec456d004a4db43cc922845..87e5959a495eaccf3e6ec1102fb8a3f3edcc0cfe 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1305,6 +1305,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1305,6 +1305,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -30,7 +30,7 @@ index 34619d107231fe188d2b4c8eeefba8b6eaf4d3a5..4fb05a2be3ff06ceddae37e1592db548
return true; return true;
} else { } else {
if (this.haveTime()) { if (this.haveTime()) {
@@ -2685,4 +2686,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2711,4 +2712,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
// Paper end // Paper end
@ -126,10 +126,10 @@ index b768767b92bf7691a6e57627c69818a1f5fd82c8..ebd0da4f87c74f12d702e1ae4f320688
} }
// Paper start - optimise chunk tick iteration // Paper start - optimise chunk tick iteration
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5ec15aa3005e7cc401b9f391423008e1b75fe73f..9b2c24a01fd09d9520f3c8baff7c56ae48f0c5de 100644 index 834e5d2ef6045ef703321852f988db3fbf6cbba2..8faf55969232d44b999231b219a208e049a72755 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -214,6 +214,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -212,6 +212,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final StructureManager structureManager; private final StructureManager structureManager;
private final StructureCheck structureCheck; private final StructureCheck structureCheck;
private final boolean tickTime; private final boolean tickTime;
@ -137,7 +137,7 @@ index 5ec15aa3005e7cc401b9f391423008e1b75fe73f..9b2c24a01fd09d9520f3c8baff7c56ae
// CraftBukkit start // CraftBukkit start
public final LevelStorageSource.LevelStorageAccess convertable; public final LevelStorageSource.LevelStorageAccess convertable;
@@ -1045,6 +1046,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1044,6 +1045,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (fluid1.is(fluid)) { if (fluid1.is(fluid)) {
fluid1.tick(this, pos); fluid1.tick(this, pos);
} }
@ -145,7 +145,7 @@ index 5ec15aa3005e7cc401b9f391423008e1b75fe73f..9b2c24a01fd09d9520f3c8baff7c56ae
} }
@@ -1054,6 +1056,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1053,6 +1055,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (iblockdata.is(block)) { if (iblockdata.is(block)) {
iblockdata.tick(this, pos, this.random); iblockdata.tick(this, pos, this.random);
} }
@ -154,10 +154,10 @@ index 5ec15aa3005e7cc401b9f391423008e1b75fe73f..9b2c24a01fd09d9520f3c8baff7c56ae
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 81b94b2cda04cbb2bc89036448e48fef791b338b..b94736286adf22ea4ff5702fa7a45b5e212b232f 100644 index 5f43dbd3b4a50f425b188beb2ed9236ed2db0a06..a0fc6c0dd9754e443a634917d66ac46e170d9dc6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -826,6 +826,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -832,6 +832,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot end // Spigot end
} else if (this.shouldTickBlocksAt(tickingblockentity.getPos())) { } else if (this.shouldTickBlocksAt(tickingblockentity.getPos())) {
tickingblockentity.tick(); tickingblockentity.tick();
@ -169,7 +169,7 @@ index 81b94b2cda04cbb2bc89036448e48fef791b338b..b94736286adf22ea4ff5702fa7a45b5e
} }
} }
this.blockEntityTickers.removeAll(toRemove); this.blockEntityTickers.removeAll(toRemove);
@@ -840,6 +845,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -846,6 +851,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) { public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) {
try { try {
tickConsumer.accept(entity); tickConsumer.accept(entity);

View File

@ -10,7 +10,7 @@ hoping that at least then we don't swap chunks, and maybe recover
them all. them all.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
index f8edcc9697289c2cf43c9021d5518955d0d701e7..313a3319c630a4f26f9c53255a0ac67f3c15e410 100644 index 9981bbfd846a5380b99f0d894b121db554d03028..f7c7c351d99890adfa25e0a1368229e5cba37f98 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -70,6 +70,18 @@ import net.minecraft.world.ticks.ProtoChunkTicks; @@ -70,6 +70,18 @@ import net.minecraft.world.ticks.ProtoChunkTicks;
@ -32,7 +32,7 @@ index f8edcc9697289c2cf43c9021d5518955d0d701e7..313a3319c630a4f26f9c53255a0ac67f
public static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codecRW(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState(), null); // Paper - Anti-Xray - Add preset block states public static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codecRW(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState(), null); // Paper - Anti-Xray - Add preset block states
private static final Logger LOGGER = LogUtils.getLogger(); private static final Logger LOGGER = LogUtils.getLogger();
@@ -486,7 +498,7 @@ public class ChunkSerializer { @@ -485,7 +497,7 @@ public class ChunkSerializer {
nbttagcompound.putInt("xPos", chunkcoordintpair.x); nbttagcompound.putInt("xPos", chunkcoordintpair.x);
nbttagcompound.putInt("yPos", chunk.getMinSection()); nbttagcompound.putInt("yPos", chunk.getMinSection());
nbttagcompound.putInt("zPos", chunkcoordintpair.z); nbttagcompound.putInt("zPos", chunkcoordintpair.z);
@ -42,7 +42,7 @@ index f8edcc9697289c2cf43c9021d5518955d0d701e7..313a3319c630a4f26f9c53255a0ac67f
nbttagcompound.putString("Status", chunk.getStatus().getName()); nbttagcompound.putString("Status", chunk.getStatus().getName());
BlendingData blendingdata = chunk.getBlendingData(); BlendingData blendingdata = chunk.getBlendingData();
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
index e276b2ceddbb269ef9a8625f26cc1847ded3862a..6289858d54a6affd504533b1a280718a01446ebb 100644 index 10603eebf36caca7870e9cf087e99d529550ad3e..2b7c41a176f354001bc9f2e1a08a4e3d1dc547b3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -41,7 +41,7 @@ public class ChunkStorage implements AutoCloseable { @@ -41,7 +41,7 @@ public class ChunkStorage implements AutoCloseable {

View File

@ -320,10 +320,10 @@ index bdbe0362e49e73c05237f9f3143230e0b03e494e..8eb20ea852a8e89c431fea55a7b60833
super(name, Integer.class); super(name, Integer.class);
if (min < 0) { if (min < 0) {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
index a37424bbc6bee02354abaa793aa0865c556c6bbe..f923593bd336dd1a950ba61603d53edb3c9703eb 100644 index 66b8e23d799adaf872233ea44c54330d75135544..9d4faa3da8d62028074ce25f4a728e9ba5281428 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java --- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java +++ b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
@@ -22,6 +22,17 @@ public abstract class Property<T extends Comparable<T>> { @@ -24,6 +24,17 @@ public abstract class Property<T extends Comparable<T>> {
}, this::getName); }, this::getName);
private final Codec<Property.Value<T>> valueCodec = this.codec.xmap(this::value, Property.Value::value); private final Codec<Property.Value<T>> valueCodec = this.codec.xmap(this::value, Property.Value::value);

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Detail more information in watchdog dumps
- Dump player name, player uuid, position, and world for packet handling - Dump player name, player uuid, position, and world for packet handling
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 3355d0d75675e2f9a62c4681871ba0f403073286..46153b8e5823959e17621bbebd414d8998b77fb5 100644 index e2f28c9c51f30b0e2b22055bb10899d41fc4bdf8..2ff278d085b25f40c1bdf0cc0cb564fb441ae1cd 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -512,7 +512,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -519,7 +519,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
if (!(this.packetListener instanceof net.minecraft.server.network.ServerLoginPacketListenerImpl loginPacketListener) if (!(this.packetListener instanceof net.minecraft.server.network.ServerLoginPacketListenerImpl loginPacketListener)
|| loginPacketListener.state != net.minecraft.server.network.ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT || loginPacketListener.state != net.minecraft.server.network.ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT
|| Connection.joinAttemptsThisTick++ < MAX_PER_TICK) { || Connection.joinAttemptsThisTick++ < MAX_PER_TICK) {
@ -25,7 +25,7 @@ index 3355d0d75675e2f9a62c4681871ba0f403073286..46153b8e5823959e17621bbebd414d89
// Paper end // Paper end
} }
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
index acfa1907bfc9c29d261cfccc00d65bad9ad1a002..d6f3869f5725c7f081efb7f486f74dbb99d4d005 100644 index 46d9ad9cd8002770c26ed61f98593af71f534e71..aba1069d29389c07012ba9365fa6ae1d88fdf73c 100644
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java +++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
@@ -15,6 +15,24 @@ public class PacketUtils { @@ -15,6 +15,24 @@ public class PacketUtils {
@ -60,7 +60,7 @@ index acfa1907bfc9c29d261cfccc00d65bad9ad1a002..d6f3869f5725c7f081efb7f486f74dbb
+ packetProcessing.push(listener); // Paper - detailed watchdog information + packetProcessing.push(listener); // Paper - detailed watchdog information
+ try { // Paper - detailed watchdog information + try { // Paper - detailed watchdog information
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590 if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
if (listener.getConnection().isConnected()) { if (listener.isAcceptingMessages()) {
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
@@ -43,6 +63,12 @@ public class PacketUtils { @@ -43,6 +63,12 @@ public class PacketUtils {
} else { } else {
@ -76,10 +76,10 @@ index acfa1907bfc9c29d261cfccc00d65bad9ad1a002..d6f3869f5725c7f081efb7f486f74dbb
}); });
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD; throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9b2c24a01fd09d9520f3c8baff7c56ae48f0c5de..7c6b76399648d67e6726a13e1d29e1978bae641a 100644 index 8faf55969232d44b999231b219a208e049a72755..1f683d734b9e272c8f4c48d922f3dcd12d0ffd1a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1060,7 +1060,26 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1059,7 +1059,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
@ -106,7 +106,7 @@ index 9b2c24a01fd09d9520f3c8baff7c56ae48f0c5de..7c6b76399648d67e6726a13e1d29e197
++TimingHistory.entityTicks; // Paper - timings ++TimingHistory.entityTicks; // Paper - timings
// Spigot start // Spigot start
co.aikar.timings.Timing timer; // Paper co.aikar.timings.Timing timer; // Paper
@@ -1100,7 +1119,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1099,7 +1118,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1); this.tickPassenger(entity, entity1);
} }
// } finally { timer.stopTiming(); } // Paper - timings - move up // } finally { timer.stopTiming(); } // Paper - timings - move up
@ -122,10 +122,10 @@ index 9b2c24a01fd09d9520f3c8baff7c56ae48f0c5de..7c6b76399648d67e6726a13e1d29e197
private void tickPassenger(Entity vehicle, Entity passenger) { private void tickPassenger(Entity vehicle, Entity passenger) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f19ece7738e493c3e69ea298f55e3f32da31204e..ef515ec320454fd6a54457ca419ddd42d0c3b5c8 100644 index 3a388ead677be73b0ae4425a05a45cd34e95d586..2b3be52e421f21ed4736c9e9093c038d82ded227 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -971,7 +971,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -972,7 +972,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.onGround; return this.onGround;
} }
@ -168,7 +168,7 @@ index f19ece7738e493c3e69ea298f55e3f32da31204e..ef515ec320454fd6a54457ca419ddd42
if (this.noPhysics) { if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else { } else {
@@ -1144,6 +1179,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1145,6 +1180,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.level.getProfiler().pop(); this.level.getProfiler().pop();
} }
} }
@ -182,7 +182,7 @@ index f19ece7738e493c3e69ea298f55e3f32da31204e..ef515ec320454fd6a54457ca419ddd42
} }
protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) { protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) {
@@ -4027,7 +4069,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4091,7 +4133,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public void setDeltaMovement(Vec3 velocity) { public void setDeltaMovement(Vec3 velocity) {
@ -192,7 +192,7 @@ index f19ece7738e493c3e69ea298f55e3f32da31204e..ef515ec320454fd6a54457ca419ddd42
} }
public void addDeltaMovement(Vec3 velocity) { public void addDeltaMovement(Vec3 velocity) {
@@ -4113,7 +4157,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4177,7 +4221,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
// Paper end - fix MC-4 // Paper end - fix MC-4
if (this.position.x != x || this.position.y != y || this.position.z != z) { if (this.position.x != x || this.position.y != y || this.position.z != z) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Manually inline methods in BlockPosition
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index 08fee16ab39d9da3c4262b356dd956fd5c967d06..b1d12c78edf21cc29a9f9ca54e7957ddc8875ffb 100644 index 5a42e0315fb44c2a0390c51b123501498140238a..b37e0ff164a894d2033fb94bbbc2f630a0e66bcd 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java --- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -488,9 +488,9 @@ public class BlockPos extends Vec3i { @@ -474,9 +474,9 @@ public class BlockPos extends Vec3i {
} }
public BlockPos.MutableBlockPos set(int x, int y, int z) { public BlockPos.MutableBlockPos set(int x, int y, int z) {
@ -21,7 +21,7 @@ index 08fee16ab39d9da3c4262b356dd956fd5c967d06..b1d12c78edf21cc29a9f9ca54e7957dd
return this; return this;
} }
@@ -554,19 +554,19 @@ public class BlockPos extends Vec3i { @@ -540,19 +540,19 @@ public class BlockPos extends Vec3i {
// Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep // Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep
@Override @Override
public BlockPos.MutableBlockPos setX(int i) { public BlockPos.MutableBlockPos setX(int i) {
@ -45,7 +45,7 @@ index 08fee16ab39d9da3c4262b356dd956fd5c967d06..b1d12c78edf21cc29a9f9ca54e7957dd
} }
// Paper end // Paper end
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
index 9482d5ca34bbc098a5afa785054d6d60d6a2decb..cc73ce9f860d1ed3a746e08364a3be97ffa5c8c2 100644 index e87ef99260bff134529e00b9a75381cecaec01a4..74a3f2ba6aaec39ba4721fb546bfccb325c86343 100644
--- a/src/main/java/net/minecraft/core/Vec3i.java --- a/src/main/java/net/minecraft/core/Vec3i.java
+++ b/src/main/java/net/minecraft/core/Vec3i.java +++ b/src/main/java/net/minecraft/core/Vec3i.java
@@ -19,9 +19,9 @@ public class Vec3i implements Comparable<Vec3i> { @@ -19,9 +19,9 @@ public class Vec3i implements Comparable<Vec3i> {
@ -59,5 +59,5 @@ index 9482d5ca34bbc098a5afa785054d6d60d6a2decb..cc73ce9f860d1ed3a746e08364a3be97
+ protected int y; // Paper - protected + protected int y; // Paper - protected
+ protected int z; // Paper - protected + protected int z; // Paper - protected
private static Function<Vec3i, DataResult<Vec3i>> checkOffsetAxes(int maxAbsValue) { public static Codec<Vec3i> offsetCodec(int maxAbsValue) {
return (vec) -> { return ExtraCodecs.validate(CODEC, (vec) -> {

View File

@ -13,10 +13,10 @@ Paper recently reverted this optimisation, so it's been reintroduced
here. here.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b94736286adf22ea4ff5702fa7a45b5e212b232f..8be0e1097f0490bc87f3eb87249daa6c0f761bb7 100644 index a0fc6c0dd9754e443a634917d66ac46e170d9dc6..54f3d4504929b90dc500207ed74e17ec1967ba48 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -366,6 +366,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -372,6 +372,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Override @Override
public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline

View File

@ -24,10 +24,10 @@ and an action can be defined: DROP or KICK
If interval or rate are less-than 0, the limit is ignored If interval or rate are less-than 0, the limit is ignored
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 46153b8e5823959e17621bbebd414d8998b77fb5..fa0845ea094714c320617d3a39efac759ddbbd36 100644 index 2ff278d085b25f40c1bdf0cc0cb564fb441ae1cd..f7ab5db5f5301d6efee1141f7725548eded2ed74 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -154,6 +154,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -156,6 +156,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
} }
} }
// Paper end - allow controlled flushing // Paper end - allow controlled flushing
@ -50,7 +50,7 @@ index 46153b8e5823959e17621bbebd414d8998b77fb5..fa0845ea094714c320617d3a39efac75
public Connection(PacketFlow side) { public Connection(PacketFlow side) {
this.receiving = side; this.receiving = side;
@@ -234,6 +250,45 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -237,6 +253,45 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet<?> packet) { protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet<?> packet) {
if (this.channel.isOpen()) { if (this.channel.isOpen()) {

View File

@ -8,7 +8,7 @@ Lighting is purged on update anyways, so let's not add more
into the conversion process into the conversion process
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
index 6289858d54a6affd504533b1a280718a01446ebb..5a425be023d77f0370d102dfb52427147849ac1a 100644 index 2b7c41a176f354001bc9f2e1a08a4e3d1dc547b3..f89e31da562bb272b345b1446894ff64dcc3a079 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -51,6 +51,7 @@ public class ChunkStorage implements AutoCloseable { @@ -51,6 +51,7 @@ public class ChunkStorage implements AutoCloseable {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Don't lookup fluid state when raytracing
Just use the iblockdata already retrieved, removes a getType call. Just use the iblockdata already retrieved, removes a getType call.
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
index bca0838e40bc91d78e9b93df5318642d1c9f341e..9cf2f046d50a8a0e08189c9b4b5d2f323d1f790d 100644 index 411d6c3466337c8322dbbba1a10c3e205bff3c63..576a53fbb46d4e4a590725e25eebee015e81ecad 100644
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java --- a/src/main/java/net/minecraft/world/level/BlockGetter.java
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java +++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
@@ -84,7 +84,7 @@ public interface BlockGetter extends LevelHeightAccessor { @@ -84,7 +84,7 @@ public interface BlockGetter extends LevelHeightAccessor {

View File

@ -9,15 +9,15 @@ Configurable under
`send-full-pos-for-hard-colliding-entities` `send-full-pos-for-hard-colliding-entities`
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 6281ade15b2700d16dc1f98c2affea8c0ba936c9..64683e218c9c43cfd30514800cfa8da42e37563e 100644 index f9fc646811a3952065d1b9fc74ff7a10ae495c32..6dddd4eb8de9a08461245e35e65d4106f4e8e729 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -169,7 +169,7 @@ public class ServerEntity { @@ -184,7 +184,7 @@ public class ServerEntity {
long i1 = this.positionCodec.encodeZ(vec3d); long i1 = this.positionCodec.encodeZ(vec3d);
boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L; boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
- if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround()) { - if (!flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround()) {
+ if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync + if (!flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync
if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) { if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) {
if (flag2) { if (flag2) {
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.isOnGround()); packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.isOnGround());

View File

@ -9,7 +9,7 @@ easy win. The remaining problems with this function
are mostly with the block getting itself. are mostly with the block getting itself.
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
index 9cf2f046d50a8a0e08189c9b4b5d2f323d1f790d..d1eefa6ef3e9abfe7af4d8310aa64465fa2d5463 100644 index 576a53fbb46d4e4a590725e25eebee015e81ecad..64db14a5070229d38f453269c36f1199721b87fb 100644
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java --- a/src/main/java/net/minecraft/world/level/BlockGetter.java
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java +++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
@@ -84,6 +84,7 @@ public interface BlockGetter extends LevelHeightAccessor { @@ -84,6 +84,7 @@ public interface BlockGetter extends LevelHeightAccessor {

View File

@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap. better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 1b8f221360f5edb4d244ec97104d85ffecef204c..57e13cb9d1460be34fe06f7c7e14330f60f0a51a 100644 index b0cfdead8a345eaab7747ed6b84271e8e09d1713..d9358311fde6a0d9040d55cab907e8833d219c3a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1395,7 +1395,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1408,7 +1408,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity; final Entity entity;
private final int range; private final int range;
SectionPos lastSectionPos; SectionPos lastSectionPos;

View File

@ -7,10 +7,10 @@ Apparently the abstract block iteration was taking about
75% of the method call. 75% of the method call.
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
index 94ea6b8986c8fe3aee220ef0c95b65c5cef21c72..d089887030ac7c7a79abca97134ba9291e244059 100644 index e0aa9a57d6a5993d7333b7685b6fa1b50bc11ea0..34d744837e599633a3c2c0b72f253bb0e157f226 100644
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java --- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
@@ -138,19 +138,27 @@ public class FarmBlock extends Block { @@ -143,19 +143,27 @@ public class FarmBlock extends Block {
} }
private static boolean isNearWater(LevelReader world, BlockPos pos) { private static boolean isNearWater(LevelReader world, BlockPos pos) {

View File

@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..7d93652c1abbb6aee6eb7c26cf35d4d0
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 7c6b76399648d67e6726a13e1d29e1978bae641a..915dd3221124756fb94d60624cd552b1ab586ab5 100644 index 1f683d734b9e272c8f4c48d922f3dcd12d0ffd1a..9523f6acd2c86892b390e14aaab628b40b452bf1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -704,6 +704,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -704,6 +704,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -117,7 +117,7 @@ index 7c6b76399648d67e6726a13e1d29e1978bae641a..915dd3221124756fb94d60624cd552b1
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
@@ -746,18 +750,26 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -746,17 +750,25 @@ public class ServerLevel extends Level implements WorldGenLevel {
int l; int l;
if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
@ -142,29 +142,27 @@ index 7c6b76399648d67e6726a13e1d29e1978bae641a..915dd3221124756fb94d60624cd552b1
if (flag) { if (flag) {
int i1 = this.getGameRules().getInt(GameRules.RULE_SNOW_ACCUMULATION_HEIGHT); int i1 = this.getGameRules().getInt(GameRules.RULE_SNOW_ACCUMULATION_HEIGHT);
BlockState iblockdata;
+ blockposition.setY(normalY); // Paper + blockposition.setY(normalY); // Paper
if (i1 > 0 && biomebase.shouldSnow(this, blockposition)) { if (i1 > 0 && biomebase.shouldSnow(this, blockposition)) {
iblockdata = this.getBlockState(blockposition); BlockState iblockdata = this.getBlockState(blockposition);
if (iblockdata.is(Blocks.SNOW)) {
@@ -772,52 +784,55 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -772,51 +784,54 @@ public class ServerLevel extends Level implements WorldGenLevel {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.SNOW.defaultBlockState(), null); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.SNOW.defaultBlockState(), null); // CraftBukkit
} }
} }
+ blockposition.setY(downY); // Paper + blockposition.setY(downY); // Paper
- iblockdata = this.getBlockState(blockposition1); - Biome.Precipitation biomebase_precipitation = biomebase.getPrecipitationAt(blockposition1);
+ iblockdata = this.getBlockState(blockposition); // Paper + Biome.Precipitation biomebase_precipitation = biomebase.getPrecipitationAt(blockposition); // Paper
Biome.Precipitation biomebase_precipitation = biomebase.getPrecipitation();
- if (biomebase_precipitation == Biome.Precipitation.RAIN && biomebase.coldEnoughToSnow(blockposition1)) { if (biomebase_precipitation != Biome.Precipitation.NONE) {
+ if (biomebase_precipitation == Biome.Precipitation.RAIN && biomebase.coldEnoughToSnow(blockposition)) { // Paper - BlockState iblockdata2 = this.getBlockState(blockposition1);
biomebase_precipitation = Biome.Precipitation.SNOW; + BlockState iblockdata2 = this.getBlockState(blockposition); // Paper
- iblockdata2.getBlock().handlePrecipitation(iblockdata2, this, blockposition1, biomebase_precipitation);
+ iblockdata2.getBlock().handlePrecipitation(iblockdata2, this, blockposition, biomebase_precipitation); // Paper
} }
- iblockdata.getBlock().handlePrecipitation(iblockdata, this, blockposition1, biomebase_precipitation);
+ iblockdata.getBlock().handlePrecipitation(iblockdata, this, blockposition, biomebase_precipitation); // Paper
} }
} }
@ -186,7 +184,7 @@ index 7c6b76399648d67e6726a13e1d29e1978bae641a..915dd3221124756fb94d60624cd552b1
- BlockPos blockposition2 = this.getBlockRandomPos(j, l1, k, 15); - BlockPos blockposition2 = this.getBlockRandomPos(j, l1, k, 15);
- -
- gameprofilerfiller.push("randomTick"); - gameprofilerfiller.push("randomTick");
- BlockState iblockdata2 = chunksection.getBlockState(blockposition2.getX() - j, blockposition2.getY() - l1, blockposition2.getZ() - k); - BlockState iblockdata3 = chunksection.getBlockState(blockposition2.getX() - j, blockposition2.getY() - l1, blockposition2.getZ() - k);
+ LevelChunkSection[] sections = chunk.getSections(); + LevelChunkSection[] sections = chunk.getSections();
+ int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this); + int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this);
+ for (int sectionIndex = 0; sectionIndex < sections.length; ++sectionIndex) { + for (int sectionIndex = 0; sectionIndex < sections.length; ++sectionIndex) {
@ -195,8 +193,8 @@ index 7c6b76399648d67e6726a13e1d29e1978bae641a..915dd3221124756fb94d60624cd552b1
+ continue; + continue;
+ } + }
- if (iblockdata2.isRandomlyTicking()) { - if (iblockdata3.isRandomlyTicking()) {
- iblockdata2.randomTick(this, blockposition2, this.random); - iblockdata3.randomTick(this, blockposition2, this.random);
- } - }
+ int yPos = (sectionIndex + minSection) << 4; + int yPos = (sectionIndex + minSection) << 4;
+ for (int a = 0; a < randomTickSpeed; ++a) { + for (int a = 0; a < randomTickSpeed; ++a) {
@ -206,7 +204,7 @@ index 7c6b76399648d67e6726a13e1d29e1978bae641a..915dd3221124756fb94d60624cd552b1
+ continue; + continue;
+ } + }
- FluidState fluid = iblockdata2.getFluidState(); - FluidState fluid = iblockdata3.getFluidState();
+ long raw = section.tickingList.getRaw(index); + long raw = section.tickingList.getRaw(index);
+ int location = com.destroystokyo.paper.util.maplist.IBlockDataList.getLocationFromRaw(raw); + int location = com.destroystokyo.paper.util.maplist.IBlockDataList.getLocationFromRaw(raw);
+ int randomX = location & 15; + int randomX = location & 15;
@ -306,10 +304,10 @@ index 9686ce7536c9924b1b2aced4f013f46759cbc72e..5d8e9bdf5538b19681f21949368d862f
public void getAll(IntConsumer action) { public void getAll(IntConsumer action) {
for(int i = 0; i < this.size; ++i) { for(int i = 0; i < this.size; ++i) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
index 30663713e198bfe40b95c48524b71ea65f39965e..25503678e7d049a8b3172cfad8a5606958c32302 100644 index b03c919edc33f308409ceeea0dd1064d1c6d7906..1c2f927974aab4d9751088449edbc777677d6cd0 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
@@ -83,7 +83,7 @@ public class Turtle extends Animal { @@ -84,7 +84,7 @@ public class Turtle extends Animal {
} }
public void setHomePos(BlockPos pos) { public void setHomePos(BlockPos pos) {
@ -319,10 +317,10 @@ index 30663713e198bfe40b95c48524b71ea65f39965e..25503678e7d049a8b3172cfad8a56069
public BlockPos getHomePos() { public BlockPos getHomePos() {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 8be0e1097f0490bc87f3eb87249daa6c0f761bb7..158046d001cbd71b4cec2717f5e9266cc87cd2d0 100644 index 54f3d4504929b90dc500207ed74e17ec1967ba48..b8c097c52cdc2af9bc05cfb5cfd646bb3bfb664e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1369,10 +1369,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1371,10 +1371,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract RecipeManager getRecipeManager(); public abstract RecipeManager getRecipeManager();
public BlockPos getBlockRandomPos(int x, int y, int z, int l) { public BlockPos getBlockRandomPos(int x, int y, int z, int l) {
@ -343,7 +341,7 @@ index 8be0e1097f0490bc87f3eb87249daa6c0f761bb7..158046d001cbd71b4cec2717f5e9266c
public boolean noSave() { public boolean noSave() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index 066874d27495dcaa3dea254b7328257e46920357..c3f1334b2bb97f0633f3ea43b97ee49adfd8bc0d 100644 index 8c8445af8a2fe684fdbb468f8d8605d44a803758..c7e2796e136ee8fb7d7e438a7fc59826c05b761b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -27,6 +27,7 @@ public class LevelChunkSection { @@ -27,6 +27,7 @@ public class LevelChunkSection {
@ -436,10 +434,10 @@ index 066874d27495dcaa3dea254b7328257e46920357..c3f1334b2bb97f0633f3ea43b97ee49a
public PalettedContainer<BlockState> getStates() { public PalettedContainer<BlockState> getStates() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 715830d27490572bbe963515f046205c6d7e834d..3c7ef1e8e338a84eee34f39ce73e64876632ea87 100644 index 4cbceb1c18dbee75ac5154ff0c15a4e79bd31575..7c770d131d39da6900fdd22df36707d5f43e8cd0 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -383,6 +383,14 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -387,6 +387,14 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
} }
} }

View File

@ -20,10 +20,10 @@ up on this optimisation before he came along.
Locally this patch drops the entity tracker tick by a full 1.5x. Locally this patch drops the entity tracker tick by a full 1.5x.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index fa0845ea094714c320617d3a39efac759ddbbd36..1a077353811a0a233f1a7ee7b6afe6c535e49168 100644 index f7ab5db5f5301d6efee1141f7725548eded2ed74..398af26a2408916fda3e71e887bbb73994727bc7 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -46,6 +46,8 @@ import org.slf4j.Logger; @@ -48,6 +48,8 @@ import org.slf4j.Logger;
import org.slf4j.Marker; import org.slf4j.Marker;
import org.slf4j.MarkerFactory; import org.slf4j.MarkerFactory;
@ -32,7 +32,7 @@ index fa0845ea094714c320617d3a39efac759ddbbd36..1a077353811a0a233f1a7ee7b6afe6c5
public class Connection extends SimpleChannelInboundHandler<Packet<?>> { public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
private static final float AVERAGE_PACKETS_SMOOTHING = 0.75F; private static final float AVERAGE_PACKETS_SMOOTHING = 0.75F;
@@ -418,9 +420,19 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -425,9 +427,19 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
if (this.channel.eventLoop().inEventLoop()) { if (this.channel.eventLoop().inEventLoop()) {
this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper
} else { } else {

View File

@ -9,7 +9,7 @@ since the penalty of a map lookup could outweigh the benefits of
searching less players (as it basically did in the outside range patch). searching less players (as it basically did in the outside range patch).
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index e11ec87e8007979a1c6932b414bcd70c10db746c..bc46479fd0622a90fd98ac88f92b2840a22a2d04 100644 index 0f2590501d742b1f5a410d45c7781bd18b4a4525..904fcdeb7937d36208cc9a8d5eca9ef3a5b2cd9e 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -93,6 +93,12 @@ public class ChunkHolder { @@ -93,6 +93,12 @@ public class ChunkHolder {
@ -39,10 +39,10 @@ index e11ec87e8007979a1c6932b414bcd70c10db746c..bc46479fd0622a90fd98ac88f92b2840
// Paper end // Paper end
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 57e13cb9d1460be34fe06f7c7e14330f60f0a51a..7f68b05b4d0789c308b5f90a5d626a633c80191f 100644 index d9358311fde6a0d9040d55cab907e8833d219c3a..95c50a36dc1e03ae8ab8ca89a96d1ea56da8d94c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -156,6 +156,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -159,6 +159,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public final ReferenceOpenHashSet<ChunkHolder> needsChangeBroadcasting = new ReferenceOpenHashSet<>(); public final ReferenceOpenHashSet<ChunkHolder> needsChangeBroadcasting = new ReferenceOpenHashSet<>();
// Paper - rewrite chunk system // Paper - rewrite chunk system
@ -55,7 +55,7 @@ index 57e13cb9d1460be34fe06f7c7e14330f60f0a51a..7f68b05b4d0789c308b5f90a5d626a63
// Paper start - distance maps // Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
@@ -208,6 +214,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -211,6 +217,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
trackMap.add(player, chunkX, chunkZ, Math.min(trackRange, io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(player))); trackMap.add(player, chunkX, chunkZ, Math.min(trackRange, io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(player)));
} }
// Paper end - use distance map to optimise entity tracker // Paper end - use distance map to optimise entity tracker
@ -63,7 +63,7 @@ index 57e13cb9d1460be34fe06f7c7e14330f60f0a51a..7f68b05b4d0789c308b5f90a5d626a63
} }
void removePlayerFromDistanceMaps(ServerPlayer player) { void removePlayerFromDistanceMaps(ServerPlayer player) {
@@ -217,6 +224,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -220,6 +227,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.playerMobSpawnMap.remove(player); this.playerMobSpawnMap.remove(player);
this.playerChunkTickRangeMap.remove(player); this.playerChunkTickRangeMap.remove(player);
// Paper end - optimise ChunkMap#anyPlayerCloseEnoughForSpawning // Paper end - optimise ChunkMap#anyPlayerCloseEnoughForSpawning
@ -71,7 +71,7 @@ index 57e13cb9d1460be34fe06f7c7e14330f60f0a51a..7f68b05b4d0789c308b5f90a5d626a63
// Paper start - per player mob spawning // Paper start - per player mob spawning
if (this.playerMobDistanceMap != null) { if (this.playerMobDistanceMap != null) {
this.playerMobDistanceMap.remove(player); this.playerMobDistanceMap.remove(player);
@@ -248,6 +256,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -251,6 +259,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
trackMap.update(player, chunkX, chunkZ, Math.min(trackRange, io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(player))); trackMap.update(player, chunkX, chunkZ, Math.min(trackRange, io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(player)));
} }
// Paper end - use distance map to optimise entity tracker // Paper end - use distance map to optimise entity tracker
@ -79,7 +79,7 @@ index 57e13cb9d1460be34fe06f7c7e14330f60f0a51a..7f68b05b4d0789c308b5f90a5d626a63
} }
// Paper end // Paper end
// Paper start // Paper start
@@ -405,6 +414,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -408,6 +417,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
}); });
// Paper end - optimise ChunkMap#anyPlayerCloseEnoughForSpawning // Paper end - optimise ChunkMap#anyPlayerCloseEnoughForSpawning
@ -104,10 +104,10 @@ index 57e13cb9d1460be34fe06f7c7e14330f60f0a51a..7f68b05b4d0789c308b5f90a5d626a63
protected ChunkGenerator generator() { protected ChunkGenerator generator() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 915dd3221124756fb94d60624cd552b1ab586ab5..5570ff6fccda19343a5520dca2671045c4fc48b4 100644 index 9523f6acd2c86892b390e14aaab628b40b452bf1..a3e8765e00ca816781441448d8bd4ac3a8364b6d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -444,6 +444,84 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -442,6 +442,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
// Paper end // Paper end
@ -191,7 +191,7 @@ index 915dd3221124756fb94d60624cd552b1ab586ab5..5570ff6fccda19343a5520dca2671045
+ +
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer // Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error
@@ -546,6 +624,14 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -546,6 +624,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
@ -208,10 +208,10 @@ index 915dd3221124756fb94d60624cd552b1ab586ab5..5570ff6fccda19343a5520dca2671045
this.handlingTick = true; this.handlingTick = true;
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 082da4f8eaede9d7f70341c207a2aaa6f07b997e..49b983064ea810382b6112f5dc7f93ba4e5710bd 100644 index 00c6605f06773c52f6f5c5c1f5bcdd6dd67fb5b6..ba1a43758bb29e3204b5f88edf4cb02af2cc07b3 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -826,7 +826,12 @@ public abstract class Mob extends LivingEntity { @@ -855,7 +855,12 @@ public abstract class Mob extends LivingEntity implements Targeting {
if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
this.discard(); this.discard();
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
@ -226,10 +226,10 @@ index 082da4f8eaede9d7f70341c207a2aaa6f07b997e..49b983064ea810382b6112f5dc7f93ba
if (entityhuman != null) { if (entityhuman != null) {
double d0 = entityhuman.distanceToSqr((Entity) this); double d0 = entityhuman.distanceToSqr((Entity) this);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 158046d001cbd71b4cec2717f5e9266cc87cd2d0..9d122994fb0587eab313ba522a2e9933aa2ddc8b 100644 index b8c097c52cdc2af9bc05cfb5cfd646bb3bfb664e..a84f039390afe11d96b24a5c82312e1888311ec9 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -204,6 +204,69 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -208,6 +208,69 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return this.getChunkIfLoaded(chunkX, chunkZ) != null; return this.getChunkIfLoaded(chunkX, chunkZ) != null;
} }
// Paper end // Paper end
@ -300,7 +300,7 @@ index 158046d001cbd71b4cec2717f5e9266cc87cd2d0..9d122994fb0587eab313ba522a2e9933
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 0a49769bfa83d0b9c435e3ab4bba85979d660ff8..01b21f520ef1c834b9bafc3de85c1fa4fcf539d6 100644 index 906def91bba96bab7c7aea9b87d9ec56374e6588..15d266fc97eb73338f4f6fb2cfe25d6861e79810 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -260,7 +260,7 @@ public final class NaturalSpawner { @@ -260,7 +260,7 @@ public final class NaturalSpawner {
@ -322,7 +322,7 @@ index 0a49769bfa83d0b9c435e3ab4bba85979d660ff8..01b21f520ef1c834b9bafc3de85c1fa4
private static Boolean isValidSpawnPostitionForType(ServerLevel world, MobCategory group, StructureManager structureAccessor, ChunkGenerator chunkGenerator, MobSpawnSettings.SpawnerData spawnEntry, BlockPos.MutableBlockPos pos, double squaredDistance) { // Paper private static Boolean isValidSpawnPostitionForType(ServerLevel world, MobCategory group, StructureManager structureAccessor, ChunkGenerator chunkGenerator, MobSpawnSettings.SpawnerData spawnEntry, BlockPos.MutableBlockPos pos, double squaredDistance) { // Paper
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index a3c1bba1c1f795d203207776bab41b4b8f4e69d7..28e4b302284f955a73e75d0f4276d55fb51826f5 100644 index 05b8b37a4b1089b859b399323ecda8f23e9f6e67..206dc04086a218b510930739a6c573f2653ab0fa 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -269,6 +269,98 @@ public class LevelChunk extends ChunkAccess { @@ -269,6 +269,98 @@ public class LevelChunk extends ChunkAccess {

View File

@ -5,21 +5,21 @@ Subject: [PATCH] Use Velocity compression and cipher natives
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index dbaff3f2505f09e87bea314bb179a408eebd2e7c..dc61ebe468740b0b9359bf6e3a6050726136941c 100644 index d98add7d741e47d9ff095a817e0f895b7235a488..1cd32d28475b3130b02ad39b9f53aa7074792556 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -28,6 +28,11 @@ dependencies { @@ -31,6 +31,11 @@ dependencies {
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0")
implementation("commons-lang:commons-lang:2.6") runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
+ // Paper start - Use Velocity cipher + // Paper start - Use Velocity cipher
+ implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") { + implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
+ isTransitive = false + isTransitive = false
+ } + }
+ // Paper end + // Paper end
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
runtimeOnly("mysql:mysql-connector-java:8.0.29") runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
diff --git a/src/main/java/net/minecraft/network/CipherDecoder.java b/src/main/java/net/minecraft/network/CipherDecoder.java diff --git a/src/main/java/net/minecraft/network/CipherDecoder.java b/src/main/java/net/minecraft/network/CipherDecoder.java
index 778beb445eac5769b9e4e07b4d1294c50ae2602b..c712fb8193115e1ab71b5e40fb0ccb9413062b03 100644 index 778beb445eac5769b9e4e07b4d1294c50ae2602b..c712fb8193115e1ab71b5e40fb0ccb9413062b03 100644
--- a/src/main/java/net/minecraft/network/CipherDecoder.java --- a/src/main/java/net/minecraft/network/CipherDecoder.java
@ -268,10 +268,10 @@ index 792883afe53d2b7989c25a81c2f9a639d5e21d20..c04379ca8a4db0f4de46ad2b3b338431
return this.threshold; return this.threshold;
} }
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 1a077353811a0a233f1a7ee7b6afe6c535e49168..38c09c65dfa4a7a0c80d36f726c1fd028cbe05f8 100644 index 398af26a2408916fda3e71e887bbb73994727bc7..fa1d325034dafdb9f1da546a6f9c5e88d2b67749 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -689,11 +689,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -707,11 +707,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
return networkmanager; return networkmanager;
} }
@ -304,7 +304,7 @@ index 1a077353811a0a233f1a7ee7b6afe6c535e49168..38c09c65dfa4a7a0c80d36f726c1fd02
public boolean isEncrypted() { public boolean isEncrypted() {
return this.encrypted; return this.encrypted;
@@ -722,16 +739,17 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -740,16 +757,17 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
public void setupCompression(int compressionThreshold, boolean rejectsBadPackets) { public void setupCompression(int compressionThreshold, boolean rejectsBadPackets) {
if (compressionThreshold >= 0) { if (compressionThreshold >= 0) {
@ -325,10 +325,10 @@ index 1a077353811a0a233f1a7ee7b6afe6c535e49168..38c09c65dfa4a7a0c80d36f726c1fd02
this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper
} else { } else {
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index b80aedd2002959b4026c27ce76b3ed17f0acfb5b..2985271132c9ae822dcb0d7a7e6f0c268d1736cc 100644 index 838244e3680ea6020701e10bafbde7f52976eaa1..e5e2f763d9b4b955df79ea0c4c79565be1fe59f0 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -106,6 +106,11 @@ public class ServerConnectionListener { @@ -103,6 +103,11 @@ public class ServerConnectionListener {
ServerConnectionListener.LOGGER.info("Using default channel type"); ServerConnectionListener.LOGGER.info("Using default channel type");
} }
@ -341,7 +341,7 @@ index b80aedd2002959b4026c27ce76b3ed17f0acfb5b..2985271132c9ae822dcb0d7a7e6f0c26
protected void initChannel(Channel channel) { protected void initChannel(Channel channel) {
try { try {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index fb2502a6ccf421d658a805eacc8b4b3b86ff61df..acde45dcf605d9e2ce85002cd4d0d457c4afce38 100644 index 5ae5c35ee4d058bde6726797abb1472ee0516256..471e21f9e1f3ad6302e647d26a44b521fece223b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -265,12 +265,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -265,12 +265,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Reduce worldgen thread worker count for low core count CPUs
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 439ae035d8b2787916e017e2636115b5455811f1..a54c0a4d0849087229d08ccc89872c3603f2f426 100644 index f4935f7fc3cbd6ba8f079def43bd735364a2ce87..0d61682b91b38500e755ded2226cd30f3a16af5a 100644
--- a/src/main/java/net/minecraft/Util.java --- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java
@@ -146,7 +146,19 @@ public class Util { @@ -146,7 +146,19 @@ public class Util {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5570ff6fccda19343a5520dca2671045c4fc48b4..6b17c008926287f2c9f828ba656c3a77aef0fb2c 100644 index a3e8765e00ca816781441448d8bd4ac3a8364b6d..66b1ef69fe48340b5ccebd845b39f898515ff117 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2588,6 +2588,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2587,6 +2587,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end // Spigot end
// Spigot Start // Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ffd7d7e916a8217e4929f77c0252a6f4e3416cef..d9a44cc361b1e4a307d91e12a90986a2bbca550d 100644 index 96897ccce68ecbff808077a07f213daccc57fa54..bfc9fff1d9b397ea2ef5057bbb6ba897e234dc5c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -835,6 +835,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -837,6 +837,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// Paper end // Paper end
// CraftBukkit end // CraftBukkit end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure valid vehicle status
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 76ab004580f48fefdeec03b727f1589963c4684a..e7d299469652ebc24c2868d447916b5999bd140d 100644 index 7f445787e25f2b0064c51705ffe5a5b92c5c62e4..ee35f2696d73dea748bc30a7b3d8172366159696 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -518,7 +518,7 @@ public class ServerPlayer extends Player { @@ -524,7 +524,7 @@ public class ServerPlayer extends Player {
} }
} }

View File

@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players. This issue only applies to players.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ef515ec320454fd6a54457ca419ddd42d0c3b5c8..7e19fff139c4a0151a2dafd63086362e41d0b098 100644 index 2b3be52e421f21ed4736c9e9093c038d82ded227..47c51e8490abd10f0ff04efabea3681375589c56 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1778,6 +1778,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1783,6 +1783,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F); this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
this.yRotO = this.getYRot(); this.yRotO = this.getYRot();
this.xRotO = this.getXRot(); this.xRotO = this.getXRot();
@ -19,7 +19,7 @@ index ef515ec320454fd6a54457ca419ddd42d0c3b5c8..7e19fff139c4a0151a2dafd63086362e
} }
public void absMoveTo(double x, double y, double z) { public void absMoveTo(double x, double y, double z) {
@@ -1816,6 +1817,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1821,6 +1822,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setXRot(pitch); this.setXRot(pitch);
this.setOldPosAndRot(); this.setOldPosAndRot();
this.reapplyPosition(); this.reapplyPosition();

View File

@ -13,10 +13,10 @@ the material type of the block at that location.
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index e5e10c30fa9020e8dbbad708ef262eb6e1d559a6..9b1e2af71728c1a0842c690cee01161342dc35f1 100644 index 5768ff2c3e15c038d132c7ad391332fb36251871..52a5b7c20dda9ad18cdeb70952e7385b0966b161 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -250,7 +250,7 @@ public abstract class BlockEntity { @@ -248,7 +248,7 @@ public abstract class BlockEntity {
// Paper end // Paper end
if (this.level == null) return null; if (this.level == null) return null;
org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ()); org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());
@ -39,7 +39,7 @@ index 87c25170fbe8b0591d452612496ee1a627138de7..a2894f02ceb7c58f6eafe055e1ff47b1
private final T tileEntity; private final T tileEntity;
private final T snapshot; private final T snapshot;
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456a5200717 100644 index cf76ca2ebead64d194ce03ee024085d32d02077a..1caa329567b50a962c54bb00c79cc98e4f2724c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
@@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity; @@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
@ -50,7 +50,7 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity; import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
import net.minecraft.world.level.block.entity.CampfireBlockEntity; import net.minecraft.world.level.block.entity.CampfireBlockEntity;
import net.minecraft.world.level.block.entity.ChestBlockEntity; import net.minecraft.world.level.block.entity.ChestBlockEntity;
@@ -110,217 +111,59 @@ public final class CraftBlockStates { @@ -112,223 +113,61 @@ public final class CraftBlockStates {
private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) { private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) {
@Override @Override
public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) {
@ -80,6 +80,8 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
- Material.BAMBOO_WALL_SIGN, - Material.BAMBOO_WALL_SIGN,
- Material.BIRCH_SIGN, - Material.BIRCH_SIGN,
- Material.BIRCH_WALL_SIGN, - Material.BIRCH_WALL_SIGN,
- Material.CHERRY_SIGN,
- Material.CHERRY_WALL_SIGN,
- Material.CRIMSON_SIGN, - Material.CRIMSON_SIGN,
- Material.CRIMSON_WALL_SIGN, - Material.CRIMSON_WALL_SIGN,
- Material.DARK_OAK_SIGN, - Material.DARK_OAK_SIGN,
@ -105,6 +107,8 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
- Material.BAMBOO_WALL_HANGING_SIGN, - Material.BAMBOO_WALL_HANGING_SIGN,
- Material.BIRCH_HANGING_SIGN, - Material.BIRCH_HANGING_SIGN,
- Material.BIRCH_WALL_HANGING_SIGN, - Material.BIRCH_WALL_HANGING_SIGN,
- Material.CHERRY_HANGING_SIGN,
- Material.CHERRY_WALL_HANGING_SIGN,
- Material.CRIMSON_HANGING_SIGN, - Material.CRIMSON_HANGING_SIGN,
- Material.CRIMSON_WALL_HANGING_SIGN, - Material.CRIMSON_WALL_HANGING_SIGN,
- Material.DARK_OAK_HANGING_SIGN, - Material.DARK_OAK_HANGING_SIGN,
@ -253,6 +257,7 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
- register(Material.COMPARATOR, CraftComparator.class, CraftComparator::new, ComparatorBlockEntity::new); - register(Material.COMPARATOR, CraftComparator.class, CraftComparator::new, ComparatorBlockEntity::new);
- register(Material.CONDUIT, CraftConduit.class, CraftConduit::new, ConduitBlockEntity::new); - register(Material.CONDUIT, CraftConduit.class, CraftConduit::new, ConduitBlockEntity::new);
- register(Material.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new, DaylightDetectorBlockEntity::new); - register(Material.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new, DaylightDetectorBlockEntity::new);
- register(Material.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new, DecoratedPotBlockEntity::new);
- register(Material.DISPENSER, CraftDispenser.class, CraftDispenser::new, DispenserBlockEntity::new); - register(Material.DISPENSER, CraftDispenser.class, CraftDispenser::new, DispenserBlockEntity::new);
- register(Material.DROPPER, CraftDropper.class, CraftDropper::new, DropperBlockEntity::new); - register(Material.DROPPER, CraftDropper.class, CraftDropper::new, DropperBlockEntity::new);
- register(Material.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new, EnchantmentTableBlockEntity::new); - register(Material.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new, EnchantmentTableBlockEntity::new);
@ -271,6 +276,7 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
- register(Material.SMOKER, CraftSmoker.class, CraftSmoker::new, SmokerBlockEntity::new); - register(Material.SMOKER, CraftSmoker.class, CraftSmoker::new, SmokerBlockEntity::new);
- register(Material.SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new, SpawnerBlockEntity::new); - register(Material.SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new, SpawnerBlockEntity::new);
- register(Material.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new, StructureBlockEntity::new); - register(Material.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new, StructureBlockEntity::new);
- register(Material.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, SuspiciousSandBlockEntity::new);
- register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new); - register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new);
+ // Paper start - simplify + // Paper start - simplify
+ register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new); + register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new);
@ -292,6 +298,7 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
+ register(BlockEntityType.COMPARATOR, CraftComparator.class, CraftComparator::new); + register(BlockEntityType.COMPARATOR, CraftComparator.class, CraftComparator::new);
+ register(BlockEntityType.CONDUIT, CraftConduit.class, CraftConduit::new); + register(BlockEntityType.CONDUIT, CraftConduit.class, CraftConduit::new);
+ register(BlockEntityType.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new); + register(BlockEntityType.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new);
+ register(BlockEntityType.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new);
+ register(BlockEntityType.DISPENSER, CraftDispenser.class, CraftDispenser::new); + register(BlockEntityType.DISPENSER, CraftDispenser.class, CraftDispenser::new);
+ register(BlockEntityType.DROPPER, CraftDropper.class, CraftDropper::new); + register(BlockEntityType.DROPPER, CraftDropper.class, CraftDropper::new);
+ register(BlockEntityType.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new); + register(BlockEntityType.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new);
@ -310,12 +317,13 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
+ register(BlockEntityType.SMOKER, CraftSmoker.class, CraftSmoker::new); + register(BlockEntityType.SMOKER, CraftSmoker.class, CraftSmoker::new);
+ register(BlockEntityType.MOB_SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new); + register(BlockEntityType.MOB_SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new);
+ register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new); + register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new);
+ register(BlockEntityType.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new);
+ register(BlockEntityType.TRAPPED_CHEST, CraftChest.class, CraftChest::new); + register(BlockEntityType.TRAPPED_CHEST, CraftChest.class, CraftChest::new);
+ // Paper end + // Paper end
} }
private static void register(Material blockType, BlockStateFactory<?> factory) { private static void register(Material blockType, BlockStateFactory<?> factory) {
@@ -328,30 +171,33 @@ public final class CraftBlockStates { @@ -336,30 +175,33 @@ public final class CraftBlockStates {
} }
private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register( private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register(
@ -364,7 +372,7 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
public static Class<? extends CraftBlockState> getBlockStateType(Material material) { public static Class<? extends CraftBlockState> getBlockStateType(Material material) {
Preconditions.checkNotNull(material, "material is null"); Preconditions.checkNotNull(material, "material is null");
return CraftBlockStates.getFactory(material).blockStateType; return CraftBlockStates.getFactory(material).blockStateType;
@@ -367,6 +213,13 @@ public final class CraftBlockStates { @@ -375,6 +217,13 @@ public final class CraftBlockStates {
return null; return null;
} }
@ -378,7 +386,7 @@ index 812eb8c75bf5308a3a0771a1faabdb22a3d80c28..d3f66bc8c9fa18322bd025fac2793456
public static BlockState getBlockState(Block block) { public static BlockState getBlockState(Block block) {
// Paper start // Paper start
return CraftBlockStates.getBlockState(block, true); return CraftBlockStates.getBlockState(block, true);
@@ -424,7 +277,7 @@ public final class CraftBlockStates { @@ -432,7 +281,7 @@ public final class CraftBlockStates {
if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) { if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) {
factory = CraftBlockStates.DEFAULT_FACTORY; factory = CraftBlockStates.DEFAULT_FACTORY;
} else { } else {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add config option for logging player ip addresses
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
index d6f3869f5725c7f081efb7f486f74dbb99d4d005..8bc0cb9ad5bb4e76d962ff54305e2c08e279a17b 100644 index aba1069d29389c07012ba9365fa6ae1d88fdf73c..23c81b3a96056f0b755735ad75fc81af9b046475 100644
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java +++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
@@ -51,10 +51,11 @@ public class PacketUtils { @@ -51,10 +51,11 @@ public class PacketUtils {
@ -36,10 +36,10 @@ index 21393ad40095a4049e5b6871169b2db7aa92d13c..e6553b936dac1eb25a310d1a33acb0b1
InetSocketAddress virtualHost = com.destroystokyo.paper.network.PaperNetworkClient.prepareVirtualHost(host, port); InetSocketAddress virtualHost = com.destroystokyo.paper.network.PaperNetworkClient.prepareVirtualHost(host, port);
com.destroystokyo.paper.event.server.PaperServerListPingEvent event = com.destroystokyo.paper.network.PaperLegacyStatusClient.processRequest( com.destroystokyo.paper.event.server.PaperServerListPingEvent event = com.destroystokyo.paper.network.PaperLegacyStatusClient.processRequest(
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 2985271132c9ae822dcb0d7a7e6f0c268d1736cc..cfdbcd024de6ad0f9d4e83b2f912b36ef3299458 100644 index e5e2f763d9b4b955df79ea0c4c79565be1fe59f0..2beddfc0532c3835d50724551e3d46cb0d7d2290 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -206,7 +206,7 @@ public class ServerConnectionListener { @@ -207,7 +207,7 @@ public class ServerConnectionListener {
throw new ReportedException(CrashReport.forThrowable(exception, "Ticking memory connection")); throw new ReportedException(CrashReport.forThrowable(exception, "Ticking memory connection"));
} }
@ -49,7 +49,7 @@ index 2985271132c9ae822dcb0d7a7e6f0c268d1736cc..cfdbcd024de6ad0f9d4e83b2f912b36e
networkmanager.send(new ClientboundDisconnectPacket(ichatmutablecomponent), PacketSendListener.thenRun(() -> { networkmanager.send(new ClientboundDisconnectPacket(ichatmutablecomponent), PacketSendListener.thenRun(() -> {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index acde45dcf605d9e2ce85002cd4d0d457c4afce38..b6dc42aef6458b0c09007bb0e13048b99531f8c0 100644 index 471e21f9e1f3ad6302e647d26a44b521fece223b..69498183a7637cd2dbb859c670e661f8722a090f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -206,7 +206,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -206,7 +206,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@ -65,10 +65,10 @@ index acde45dcf605d9e2ce85002cd4d0d457c4afce38..b6dc42aef6458b0c09007bb0e13048b9
@Override @Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index c646570cfa543d56011733af984345f73dc63cb9..0693667c670bfd3431a9cef18fc1dfe39bcc7f9a 100644 index 399d5c1147b1cdacf571aa3cd5840af6f6e55374..299676157b16ed9e93f5cf9804ab75514b694f49 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -240,7 +240,7 @@ public abstract class PlayerList { @@ -241,7 +241,7 @@ public abstract class PlayerList {
String s1 = "local"; String s1 = "local";
if (connection.getRemoteAddress() != null) { if (connection.getRemoteAddress() != null) {

View File

@ -19,7 +19,7 @@ index 98171f6c8e23f6ef89b897e4b80e3afb2a1950a0..06bff37e4c1fddd3be6343049a66787c
} }
final Object val = config.get(key); final Object val = config.get(key);
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
index aecdbbcc688aad308f81f48d50773a9866ded7b2..9ef0937b7292ec118d2b65e9b098f5538410dbac 100644 index 354d386940b5ee7c92708390b83db51c281660f4..31955f62253feb111239247c4f8c2215b3080c1d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -431,7 +431,14 @@ public abstract class ChunkGenerator { @@ -431,7 +431,14 @@ public abstract class ChunkGenerator {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7e19fff139c4a0151a2dafd63086362e41d0b098..b284a9fd506f30256b8194603c12865086eebdaa 100644 index 47c51e8490abd10f0ff04efabea3681375589c56..73d475788e23d371c79908c792d8d4dd0ba770ab 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -779,7 +779,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -780,7 +780,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// CraftBukkit start // CraftBukkit start
public void postTick() { public void postTick() {
// No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent excessive velocity through repeated crits
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b7cc5fb5798d703124e08afc850c24afb2d6ee69..f833d578009bb470855e7ccdc017567a2df8f580 100644 index f1cb4aa51edd1500b3ddd1f2457b905db8802900..36290f1fa97a543a45fae61a8548c95415abc900 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2672,14 +2672,27 @@ public abstract class LivingEntity extends Entity { @@ -2614,14 +2614,27 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.hasEffect(MobEffects.JUMP) ? (double) (0.1F * (float) (this.getEffect(MobEffects.JUMP).getAmplifier() + 1)) : 0.0D; return this.hasEffect(MobEffects.JUMP) ? (double) (0.1F * (float) (this.getEffect(MobEffects.JUMP).getAmplifier() + 1)) : 0.0D;
} }

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Remove client-side code using deprecated for removal
Fixes warnings on build Fixes warnings on build
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index a54c0a4d0849087229d08ccc89872c3603f2f426..5ef58831a857fd8aa4ac30147762dc17d773a53e 100644 index 0d61682b91b38500e755ded2226cd30f3a16af5a..4c90a6ee734451fe404b2255d21090b669da1aa1 100644
--- a/src/main/java/net/minecraft/Util.java --- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java
@@ -892,17 +892,7 @@ public class Util { @@ -888,17 +888,7 @@ public class Util {
} }
public void openUrl(URL url) { public void openUrl(URL url) {

View File

@ -8,7 +8,7 @@ Chunks not marked as lit will always go through the light engine,
so they should always have their block sources parsed. so they should always have their block sources parsed.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
index 313a3319c630a4f26f9c53255a0ac67f3c15e410..d4c4d37bcef14e392739d9aae9e20b7d69b05c12 100644 index f7c7c351d99890adfa25e0a1368229e5cba37f98..887378de7a0673e929a6dcfb30c87a097d12a402 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -327,16 +327,33 @@ public class ChunkSerializer { @@ -327,16 +327,33 @@ public class ChunkSerializer {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent sending oversized item data in equipment and metadata
diff --git a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java diff --git a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
index 6c8505d5d989a2f528a1311a562cd59f4f16fc6d..c5e82ec453a431486a9aed1d6c2637e8b335d0d6 100644 index 97da8896865ff0bdd4fe8f2155b0830b42051bb1..17d0519ce3c097a38f9867fff3e1c25eb7febb59 100644
--- a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java --- a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
+++ b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java +++ b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
@@ -39,7 +39,7 @@ public class EntityDataSerializers { @@ -42,7 +42,7 @@ public class EntityDataSerializers {
public static final EntityDataSerializer<ItemStack> ITEM_STACK = new EntityDataSerializer<ItemStack>() { public static final EntityDataSerializer<ItemStack> ITEM_STACK = new EntityDataSerializer<ItemStack>() {
@Override @Override
public void write(FriendlyByteBuf buf, ItemStack value) { public void write(FriendlyByteBuf buf, ItemStack value) {
@ -18,10 +18,10 @@ index 6c8505d5d989a2f528a1311a562cd59f4f16fc6d..c5e82ec453a431486a9aed1d6c2637e8
@Override @Override
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 64683e218c9c43cfd30514800cfa8da42e37563e..d2fed123ed56eaf550ac2c7a3fcc1678a127bba3 100644 index 6dddd4eb8de9a08461245e35e65d4106f4e8e729..3e8255898e8afdd1127eea79338d5cc54502be76 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -314,7 +314,10 @@ public class ServerEntity { @@ -344,7 +344,10 @@ public class ServerEntity {
ItemStack itemstack = ((LivingEntity) this.entity).getItemBySlot(enumitemslot); ItemStack itemstack = ((LivingEntity) this.entity).getItemBySlot(enumitemslot);
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
@ -34,10 +34,10 @@ index 64683e218c9c43cfd30514800cfa8da42e37563e..d2fed123ed56eaf550ac2c7a3fcc1678
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index f833d578009bb470855e7ccdc017567a2df8f580..cd053c211c893f9b9c83204eccf9f40d7910ab7f 100644 index 36290f1fa97a543a45fae61a8548c95415abc900..c92db10a6ee95753d71526da2d7e29045de87b85 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3158,7 +3158,10 @@ public abstract class LivingEntity extends Entity { @@ -3126,7 +3126,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
equipmentChanges.forEach((enumitemslot, itemstack) -> { equipmentChanges.forEach((enumitemslot, itemstack) -> {
ItemStack itemstack1 = itemstack.copy(); ItemStack itemstack1 = itemstack.copy();
@ -49,7 +49,7 @@ index f833d578009bb470855e7ccdc017567a2df8f580..cd053c211c893f9b9c83204eccf9f40d
switch (enumitemslot.getType()) { switch (enumitemslot.getType()) {
case HAND: case HAND:
this.setLastHandItem(enumitemslot, itemstack1); this.setLastHandItem(enumitemslot, itemstack1);
@@ -3171,6 +3174,34 @@ public abstract class LivingEntity extends Entity { @@ -3139,6 +3142,34 @@ public abstract class LivingEntity extends Entity implements Attackable {
((ServerLevel) this.level).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list)); ((ServerLevel) this.level).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Hide unnecessary itemmeta from clients
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index d2fed123ed56eaf550ac2c7a3fcc1678a127bba3..77443525e68fab0211ff48af12020ff0399ba6d0 100644 index 3e8255898e8afdd1127eea79338d5cc54502be76..fc187be6b3fb7bc9fa97d1ebcbe92294aa840ecf 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -316,7 +316,7 @@ public class ServerEntity { @@ -346,7 +346,7 @@ public class ServerEntity {
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
// Paper start - prevent oversized data // Paper start - prevent oversized data
final ItemStack sanitized = LivingEntity.sanitizeItemStack(itemstack.copy(), false); final ItemStack sanitized = LivingEntity.sanitizeItemStack(itemstack.copy(), false);
@ -18,10 +18,10 @@ index d2fed123ed56eaf550ac2c7a3fcc1678a127bba3..77443525e68fab0211ff48af12020ff0
} }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d9a44cc361b1e4a307d91e12a90986a2bbca550d..4246d9a24635024ed82fa103852b8337117a6b32 100644 index bfc9fff1d9b397ea2ef5057bbb6ba897e234dc5c..5e34d42ba53d90f35e072c9f6cd6c6d714de5c21 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2683,8 +2683,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2697,8 +2697,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Refresh the current entity metadata // Refresh the current entity metadata
entity.getEntityData().refresh(player); entity.getEntityData().refresh(player);
// SPIGOT-7136 - Allays // SPIGOT-7136 - Allays
@ -33,10 +33,10 @@ index d9a44cc361b1e4a307d91e12a90986a2bbca550d..4246d9a24635024ed82fa103852b8337
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index cd053c211c893f9b9c83204eccf9f40d7910ab7f..c1185c4bd9151b08a9c7707e2eb8517bbeb47919 100644 index c92db10a6ee95753d71526da2d7e29045de87b85..15c00d3dc8cab6968703d0420600aa77b2ffbec5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3160,7 +3160,7 @@ public abstract class LivingEntity extends Entity { @@ -3128,7 +3128,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
// Paper start - prevent oversized data // Paper start - prevent oversized data
ItemStack toSend = sanitizeItemStack(itemstack1, true); ItemStack toSend = sanitizeItemStack(itemstack1, true);
@ -45,7 +45,7 @@ index cd053c211c893f9b9c83204eccf9f40d7910ab7f..c1185c4bd9151b08a9c7707e2eb8517b
// Paper end // Paper end
switch (enumitemslot.getType()) { switch (enumitemslot.getType()) {
case HAND: case HAND:
@@ -3174,6 +3174,70 @@ public abstract class LivingEntity extends Entity { @@ -3142,6 +3142,70 @@ public abstract class LivingEntity extends Entity implements Attackable {
((ServerLevel) this.level).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list)); ((ServerLevel) this.level).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
} }

View File

@ -11,14 +11,14 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
diff --git a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
index fd03fe8d596e7ec05f2a35df0b6587dd2534d5a7..fc76cd43655e0f4b8a8d87f90f0a48a8678ef16c 100644 index 55f2fa02a36f0500b47f9ce377926719557106e5..18b5bce1138d50be32e5da013221be69dc47e21f 100644
--- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java --- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
@@ -48,9 +48,17 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl @@ -47,9 +47,17 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl
@Override @Override
protected BlockState getGrowIntoState(BlockState state, RandomSource random) { protected BlockState getGrowIntoState(BlockState state, RandomSource random) {
- return (BlockState) super.getGrowIntoState(state, random).setValue(CaveVinesBlock.BERRIES, random.nextFloat() < 0.11F); - return super.getGrowIntoState(state, random).setValue(BERRIES, Boolean.valueOf(random.nextFloat() < 0.11F));
+ // Paper start + // Paper start
+ return this.getGrowIntoState(state, random, null); + return this.getGrowIntoState(state, random, null);
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerItemFrameChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index 880ca7cb3ebccc16949e24a0230b1f83887b653f..db60d29b051bad8d115b333e6c72287860a73123 100644 index 70107774f12a996c0f64b46cb4c6af9c5f50aa61..bfe94f6607e35db4df75d6061a88bce2a80b86c8 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -3,6 +3,7 @@ package net.minecraft.world.entity.decoration; @@ -3,6 +3,7 @@ package net.minecraft.world.entity.decoration;
@ -16,7 +16,7 @@ index 880ca7cb3ebccc16949e24a0230b1f83887b653f..db60d29b051bad8d115b333e6c722878
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@@ -188,6 +189,13 @@ public class ItemFrame extends HangingEntity { @@ -190,6 +191,13 @@ public class ItemFrame extends HangingEntity {
return true; return true;
} }
// CraftBukkit end // CraftBukkit end
@ -28,30 +28,33 @@ index 880ca7cb3ebccc16949e24a0230b1f83887b653f..db60d29b051bad8d115b333e6c722878
+ } + }
+ // Paper end + // Paper end
this.dropItem(source.getEntity(), false); this.dropItem(source.getEntity(), false);
this.gameEvent(GameEvent.BLOCK_CHANGE, source.getEntity());
this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F); this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F);
} @@ -457,13 +465,26 @@ public class ItemFrame extends HangingEntity {
@@ -452,13 +460,22 @@ public class ItemFrame extends HangingEntity {
return InteractionResult.FAIL;
} }
} }
-
- this.setItem(itemstack); - this.setItem(itemstack);
+ // Paper start - call PlayerItemFrameChangeEvent + // Paper start - call PlayerItemFrameChangeEvent
+ var event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), itemstack.asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.PLACE); + PlayerItemFrameChangeEvent event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), itemstack.asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.PLACE);
+ if (!event.callEvent()) return InteractionResult.FAIL; + if (!event.callEvent()) {
+ return InteractionResult.FAIL;
+ }
+ this.setItem(ItemStack.fromBukkitCopy(event.getItemStack())); + this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
+ // this.setItem(itemstack);
+ // Paper end + // Paper end
this.gameEvent(GameEvent.BLOCK_CHANGE, player);
if (!player.getAbilities().instabuild) { if (!player.getAbilities().instabuild) {
itemstack.shrink(1); itemstack.shrink(1);
} }
} }
} else { } else {
+ // Paper start - call PlayerItemFrameChangeEvent + // Paper start - call PlayerItemFrameChangeEvent
+ var event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), this.getItem().asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.ROTATE); + PlayerItemFrameChangeEvent event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), this.getItem().asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.ROTATE);
+ if (!event.callEvent()) return InteractionResult.FAIL; + if (!event.callEvent()) {
+ return InteractionResult.FAIL;
+ }
+ setItem(ItemStack.fromBukkitCopy(event.getItemStack()), false, false); + setItem(ItemStack.fromBukkitCopy(event.getItemStack()), false, false);
+ // Paper end + // Paper end
this.playSound(this.getRotateItemSound(), 1.0F, 1.0F); this.playSound(this.getRotateItemSound(), 1.0F, 1.0F);
this.setRotation(this.getRotation() + 1); this.setRotation(this.getRotation() + 1);
} this.gameEvent(GameEvent.BLOCK_CHANGE, player);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add player health update API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index dda1f3e9370110c08ed28fd404c8a246fa468db9..13855196d3c5405116bcd60518e8dd6b4fa0bf3f 100644 index 8f88d8a6f05d0f021608a035a39354ad480150f4..c1c8b73f91655e2a3a6d4706559a31dc5f5fecc3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2266,9 +2266,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2334,9 +2334,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().maxHealthCache = getMaxHealth(); this.getHandle().maxHealthCache = getMaxHealth();
} }
@ -22,7 +22,7 @@ index dda1f3e9370110c08ed28fd404c8a246fa468db9..13855196d3c5405116bcd60518e8dd6b
if (this.getHandle().queueHealthUpdatePacket) { if (this.getHandle().queueHealthUpdatePacket) {
this.getHandle().queuedHealthUpdatePacket = packet; this.getHandle().queuedHealthUpdatePacket = packet;
} else { } else {
@@ -2276,7 +2278,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2344,7 +2346,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a6e5333c6e339a3a1853a6023a2e68c046811a4d..c4d5f3482881376bde77e826009a383804a2203d 100644 index e3aef13c8b432b46690daf3b27e95b8623ae0aca..1e54fc63253a12f2dbc248965d0027e526a3cc86 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2339,6 +2339,90 @@ public final class CraftServer implements Server { @@ -2337,6 +2337,90 @@ public final class CraftServer implements Server {
return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registries.BIOME), world); // Paper - Anti-Xray - Add parameters return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registries.BIOME), world); // Paper - Anti-Xray - Add parameters
} }

View File

@ -1180,10 +1180,10 @@ index 0000000000000000000000000000000000000000..d67a40e7be030142443680c89e1763fc
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index e7d299469652ebc24c2868d447916b5999bd140d..c2b883f47829b7b14d1fdd69d2e9bc563f708e53 100644 index ee35f2696d73dea748bc30a7b3d8172366159696..d4bccae5b83a77af733b5d9466ae24b13323b2ba 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -411,7 +411,7 @@ public class ServerPlayer extends Player { @@ -417,7 +417,7 @@ public class ServerPlayer extends Player {
if (blockposition1 != null) { if (blockposition1 != null) {
this.moveTo(blockposition1, 0.0F, 0.0F); this.moveTo(blockposition1, 0.0F, 0.0F);
@ -1192,7 +1192,7 @@ index e7d299469652ebc24c2868d447916b5999bd140d..c2b883f47829b7b14d1fdd69d2e9bc56
break; break;
} }
} }
@@ -419,7 +419,7 @@ public class ServerPlayer extends Player { @@ -425,7 +425,7 @@ public class ServerPlayer extends Player {
} else { } else {
this.moveTo(blockposition, 0.0F, 0.0F); this.moveTo(blockposition, 0.0F, 0.0F);
@ -1202,10 +1202,10 @@ index e7d299469652ebc24c2868d447916b5999bd140d..c2b883f47829b7b14d1fdd69d2e9bc56
} }
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0693667c670bfd3431a9cef18fc1dfe39bcc7f9a..d396e2cb91aa99d60c898f86e0f33d3ce3f885cd 100644 index 299676157b16ed9e93f5cf9804ab75514b694f49..0f380a7045f89bc383e4eb3d93c1be3885def712 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -874,7 +874,7 @@ public abstract class PlayerList { @@ -881,7 +881,7 @@ public abstract class PlayerList {
// CraftBukkit end // CraftBukkit end
worldserver1.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper worldserver1.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper
@ -1215,10 +1215,10 @@ index 0693667c670bfd3431a9cef18fc1dfe39bcc7f9a..d396e2cb91aa99d60c898f86e0f33d3c
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b284a9fd506f30256b8194603c12865086eebdaa..48606a6d6ee4e1ba9d6cdb1600bbe8e62a16e400 100644 index 73d475788e23d371c79908c792d8d4dd0ba770ab..182e443e4cd114edeb0c0c6be5dda76d49346da3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1160,9 +1160,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1161,9 +1161,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
float f2 = this.getBlockSpeedFactor(); float f2 = this.getBlockSpeedFactor();
this.setDeltaMovement(this.getDeltaMovement().multiply((double) f2, 1.0D, (double) f2)); this.setDeltaMovement(this.getDeltaMovement().multiply((double) f2, 1.0D, (double) f2));
@ -1266,7 +1266,7 @@ index b284a9fd506f30256b8194603c12865086eebdaa..48606a6d6ee4e1ba9d6cdb1600bbe8e6
if (this.remainingFireTicks <= 0) { if (this.remainingFireTicks <= 0) {
this.setRemainingFireTicks(-this.getFireImmuneTicks()); this.setRemainingFireTicks(-this.getFireImmuneTicks());
} }
@@ -1314,32 +1349,78 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1315,32 +1350,78 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
private Vec3 collide(Vec3 movement) { private Vec3 collide(Vec3 movement) {
@ -1278,11 +1278,11 @@ index b284a9fd506f30256b8194603c12865086eebdaa..48606a6d6ee4e1ba9d6cdb1600bbe8e6
- boolean flag2 = movement.z != vec3d1.z; - boolean flag2 = movement.z != vec3d1.z;
- boolean flag3 = this.onGround || flag1 && movement.y < 0.0D; - boolean flag3 = this.onGround || flag1 && movement.y < 0.0D;
- -
- if (this.maxUpStep > 0.0F && flag3 && (flag || flag2)) { - if (this.maxUpStep() > 0.0F && flag3 && (flag || flag2)) {
- Vec3 vec3d2 = Entity.collideBoundingBox(this, new Vec3(movement.x, (double) this.maxUpStep, movement.z), axisalignedbb, this.level, list); - Vec3 vec3d2 = Entity.collideBoundingBox(this, new Vec3(movement.x, (double) this.maxUpStep(), movement.z), axisalignedbb, this.level, list);
- Vec3 vec3d3 = Entity.collideBoundingBox(this, new Vec3(0.0D, (double) this.maxUpStep, 0.0D), axisalignedbb.expandTowards(movement.x, 0.0D, movement.z), this.level, list); - Vec3 vec3d3 = Entity.collideBoundingBox(this, new Vec3(0.0D, (double) this.maxUpStep(), 0.0D), axisalignedbb.expandTowards(movement.x, 0.0D, movement.z), this.level, list);
- -
- if (vec3d3.y < (double) this.maxUpStep) { - if (vec3d3.y < (double) this.maxUpStep()) {
- Vec3 vec3d4 = Entity.collideBoundingBox(this, new Vec3(movement.x, 0.0D, movement.z), axisalignedbb.move(vec3d3), this.level, list).add(vec3d3); - Vec3 vec3d4 = Entity.collideBoundingBox(this, new Vec3(movement.x, 0.0D, movement.z), axisalignedbb.move(vec3d3), this.level, list).add(vec3d3);
- -
- if (vec3d4.horizontalDistanceSqr() > vec3d2.horizontalDistanceSqr()) { - if (vec3d4.horizontalDistanceSqr() > vec3d2.horizontalDistanceSqr()) {
@ -1302,7 +1302,7 @@ index b284a9fd506f30256b8194603c12865086eebdaa..48606a6d6ee4e1ba9d6cdb1600bbe8e6
+ +
+ final List<AABB> potentialCollisions = io.papermc.paper.util.CachedLists.getTempCollisionList(); + final List<AABB> potentialCollisions = io.papermc.paper.util.CachedLists.getTempCollisionList();
+ try { + try {
+ final double stepHeight = (double)this.maxUpStep; + final double stepHeight = (double)this.maxUpStep();
+ final AABB collisionBox; + final AABB collisionBox;
+ +
+ if (movement.x == 0.0 && movement.z == 0.0 && movement.y != 0.0) { + if (movement.x == 0.0 && movement.z == 0.0 && movement.y != 0.0) {
@ -1366,7 +1366,7 @@ index b284a9fd506f30256b8194603c12865086eebdaa..48606a6d6ee4e1ba9d6cdb1600bbe8e6
} }
public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) { public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) {
@@ -2478,11 +2559,30 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2491,11 +2572,30 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
float f = this.dimensions.width * 0.8F; float f = this.dimensions.width * 0.8F;
AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f); AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f);
@ -1493,10 +1493,10 @@ index 66a5783e2a83c75ca46d1fd6f97d9de733c01a09..d860ddae508f53d06f74d8ae0efdfc50
return List.of(); return List.of();
} else { } else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index efbcd2b78d75481793e0f29a7431d3eb76489abc..9ebc53d434737c8cd39073470b2b5fcbad167812 100644 index 61c814a8042d3d4be5ea86ce339c90100bdbe597..cd939384f022609c96b055c25db7e098e4256336 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -762,6 +762,12 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -787,6 +787,12 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.conditionallyFullOpaque; return this.conditionallyFullOpaque;
} }
// Paper end - starlight // Paper end - starlight
@ -1509,7 +1509,7 @@ index efbcd2b78d75481793e0f29a7431d3eb76489abc..9ebc53d434737c8cd39073470b2b5fcb
public void initCache() { public void initCache() {
this.fluidState = ((Block) this.owner).getFluidState(this.asState()); this.fluidState = ((Block) this.owner).getFluidState(this.asState());
@@ -772,6 +778,35 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -797,6 +803,35 @@ public abstract class BlockBehaviour implements FeatureElement {
this.shapeExceedsCube = this.cache == null || this.cache.largeCollisionShape; // Paper - moved from actual method to here this.shapeExceedsCube = this.cache == null || this.cache.largeCollisionShape; // Paper - moved from actual method to here
this.opacityIfCached = this.cache == null || this.isConditionallyFullOpaque() ? -1 : this.cache.lightBlock; // Paper - starlight - cache opacity for light this.opacityIfCached = this.cache == null || this.isConditionallyFullOpaque() ? -1 : this.cache.lightBlock; // Paper - starlight - cache opacity for light
@ -1546,7 +1546,7 @@ index efbcd2b78d75481793e0f29a7431d3eb76489abc..9ebc53d434737c8cd39073470b2b5fcb
public Block getBlock() { public Block getBlock() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index c3f1334b2bb97f0633f3ea43b97ee49adfd8bc0d..b0c9fce9d4e06cac139e341d218d0b6aac1f1943 100644 index c7e2796e136ee8fb7d7e438a7fc59826c05b761b..1b80a91fa36c59a31b57ef7ef4a68eacbb0f17f5 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -46,6 +46,110 @@ public class LevelChunkSection { @@ -46,6 +46,110 @@ public class LevelChunkSection {
@ -1688,7 +1688,7 @@ index c3f1334b2bb97f0633f3ea43b97ee49adfd8bc0d..b0c9fce9d4e06cac139e341d218d0b6a
public PalettedContainer<BlockState> getStates() { public PalettedContainer<BlockState> getStates() {
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
index 120498a39b7ca7aee9763084507508d4a1c425aa..68cc6f2a78a06293a29317fda72ab3ee79b3533a 100644 index f80783dc163997626850189f5647c06f9d15da6c..ffc76354ead6937daf366c3d87bcb51d3e4c47f5 100644
--- a/src/main/java/net/minecraft/world/phys/AABB.java --- a/src/main/java/net/minecraft/world/phys/AABB.java
+++ b/src/main/java/net/minecraft/world/phys/AABB.java +++ b/src/main/java/net/minecraft/world/phys/AABB.java
@@ -25,6 +25,17 @@ public class AABB { @@ -25,6 +25,17 @@ public class AABB {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Optimise collision checking in player move packet handling
Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e1158f1ca83f 100644 index 5e34d42ba53d90f35e072c9f6cd6c6d714de5c21..e18e2ef7846a49e24411adf571b25d37e068c3fe 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -643,7 +643,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -645,7 +645,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return; return;
} }
@ -18,7 +18,7 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above
d7 = d4 - this.vehicleLastGoodY - 1.0E-6D; // Paper - diff on change, used for checking large move vectors above d7 = d4 - this.vehicleLastGoodY - 1.0E-6D; // Paper - diff on change, used for checking large move vectors above
@@ -651,6 +651,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -653,6 +653,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag1 = entity.verticalCollisionBelow; boolean flag1 = entity.verticalCollisionBelow;
entity.move(MoverType.PLAYER, new Vec3(d6, d7, d8)); entity.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
@ -26,7 +26,7 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
double d11 = d7; double d11 = d7;
d6 = d3 - entity.getX(); d6 = d3 - entity.getX();
@@ -664,16 +665,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -666,16 +667,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag2 = false; boolean flag2 = false;
if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
@ -54,7 +54,7 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
entity.absMoveTo(d0, d1, d2, f, f1); entity.absMoveTo(d0, d1, d2, f, f1);
this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
this.connection.send(new ClientboundMoveVehiclePacket(entity)); this.connection.send(new ClientboundMoveVehiclePacket(entity));
@@ -759,7 +768,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -761,7 +770,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
private boolean noBlocksAround(Entity entity) { private boolean noBlocksAround(Entity entity) {
@ -88,7 +88,7 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
} }
@Override @Override
@@ -1339,7 +1373,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1341,7 +1375,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
if (this.awaitingPositionFromClient != null) { if (this.awaitingPositionFromClient != null) {
@ -97,7 +97,7 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
this.awaitingTeleportTime = this.tickCount; this.awaitingTeleportTime = this.tickCount;
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
} }
@@ -1433,7 +1467,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1435,7 +1469,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
} }
@ -106,7 +106,7 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
d7 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above d7 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above
d8 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above d8 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above
@@ -1474,6 +1508,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1476,6 +1510,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag1 = this.player.verticalCollisionBelow; boolean flag1 = this.player.verticalCollisionBelow;
this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9)); this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
@ -114,7 +114,7 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
// Paper start - prevent position desync // Paper start - prevent position desync
if (this.awaitingPositionFromClient != null) { if (this.awaitingPositionFromClient != null) {
@@ -1493,12 +1528,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1495,12 +1530,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag2 = false; boolean flag2 = false;
if (!this.player.isChangingDimension() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot if (!this.player.isChangingDimension() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot
@ -137,10 +137,10 @@ index 4246d9a24635024ed82fa103852b8337117a6b32..a036621f28f42151871c78337290e115
+ } // else: no collision at all detected, why do we care? + } // else: no collision at all detected, why do we care?
+ } + }
+ if (!this.player.noPhysics && !this.player.isSleeping() && teleportBack) { // Paper end - optimise out extra getCubes + if (!this.player.noPhysics && !this.player.isSleeping() && teleportBack) { // Paper end - optimise out extra getCubes
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet(), false); // 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.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // 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.getY() - d6, packet.isOnGround()); this.player.doCheckFallDamage(this.player.getY() - d6, packet.isOnGround());
} else { } else {
@@ -1585,6 +1631,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1587,6 +1633,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add more Campfire API
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
index 0f7e765263a09a3f8b021bbac8d062c72ab3bdc0..01d8f1c985223eec83beb4a84a710d1bf8d70849 100644 index 0cd019dc20ff5b3e7ee663866f98595081e991a3..91feee1e284c929b008bc2df7ab548df898b3ef7 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
@@ -41,6 +41,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { @@ -41,6 +41,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 48606a6d6ee4e1ba9d6cdb1600bbe8e62a16e400..9bbc8e1f15b5dfc62bcb065d6ebb87fa58afb91e 100644 index 182e443e4cd114edeb0c0c6be5dda76d49346da3..bd8e756bf1e74cdc75cc12d2368a6fe702a759ad 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3311,6 +3311,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -3330,6 +3330,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public void restoreFrom(Entity original) { public void restoreFrom(Entity original) {
@ -22,7 +22,7 @@ index 48606a6d6ee4e1ba9d6cdb1600bbe8e62a16e400..9bbc8e1f15b5dfc62bcb065d6ebb87fa
CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag()); CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag());
nbttagcompound.remove("Dimension"); nbttagcompound.remove("Dimension");
@@ -3392,10 +3399,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -3411,10 +3418,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (worldserver.getTypeKey() == LevelStem.END) { // CraftBukkit if (worldserver.getTypeKey() == LevelStem.END) { // CraftBukkit
ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit
} }

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Entity powdered snow API
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 726a4ae7ab928eda3ae1c1e98f3421575af2e065..03b20cec361a2eff27c1187b2a4c5a65d2b4f9b4 100644 index 0c65652866de257d2a9019f910506a6f01757422..7ea5f911046fd05be8a997b07e6f66d69eaa9564 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1342,5 +1342,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1377,5 +1377,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
entity.setRot(location.getYaw(), location.getPitch()); entity.setRot(location.getYaw(), location.getPitch());
return !entity.valid && entity.level.addFreshEntity(entity, reason); return !entity.valid && entity.level.addFreshEntity(entity, reason);
} }

View File

@ -7,7 +7,7 @@ Subject: [PATCH] Add API for item entity health
public net.minecraft.world.entity.item.ItemEntity health public net.minecraft.world.entity.item.ItemEntity health
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 1d90219c3a0e86786a9497d4c078c2d4077ab6cd..fea44ba6a6584b4a510af6a58cab07eecec6b68b 100644 index 27e961653dc66fbe8d5421eef04260b91ca410f4..e9946edf568db010e4ccb9fe7755709ed7b8310f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -102,6 +102,21 @@ public class CraftItem extends CraftEntity implements Item { @@ -102,6 +102,21 @@ public class CraftItem extends CraftEntity implements Item {

View File

@ -35,10 +35,10 @@ index 24172c3b7b1d2faa13b18bedf89ad051267feb6c..7b6b51392b123d34382233adcf4c3d48
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index f2b312367895f121bcf4135c12dfdb354f32dddb..401a87de8fc48b9e69423d547f79e9e356cc20f1 100644 index 01ba9dfaaa07569e1ca4bf40497070f49eae36ce..933d6e67cbcc1bf121005f57b13dd976020985c3 100644
--- a/src/main/java/net/minecraft/commands/Commands.java --- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -464,6 +464,7 @@ public class Commands { @@ -470,6 +470,7 @@ public class Commands {
private void fillUsableCommands(CommandNode<CommandSourceStack> tree, CommandNode<SharedSuggestionProvider> result, CommandSourceStack source, Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> resultNodes) { private void fillUsableCommands(CommandNode<CommandSourceStack> tree, CommandNode<SharedSuggestionProvider> result, CommandSourceStack source, Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> resultNodes) {
Iterator iterator = tree.getChildren().iterator(); Iterator iterator = tree.getChildren().iterator();
@ -46,7 +46,7 @@ index f2b312367895f121bcf4135c12dfdb354f32dddb..401a87de8fc48b9e69423d547f79e9e3
while (iterator.hasNext()) { while (iterator.hasNext()) {
CommandNode<CommandSourceStack> commandnode2 = (CommandNode) iterator.next(); CommandNode<CommandSourceStack> commandnode2 = (CommandNode) iterator.next();
// Paper start // Paper start
@@ -490,6 +491,12 @@ public class Commands { @@ -496,6 +497,12 @@ public class Commands {
if (requiredargumentbuilder.getSuggestionsProvider() != null) { if (requiredargumentbuilder.getSuggestionsProvider() != null) {
requiredargumentbuilder.suggests(SuggestionProviders.safelySwap(requiredargumentbuilder.getSuggestionsProvider())); requiredargumentbuilder.suggests(SuggestionProviders.safelySwap(requiredargumentbuilder.getSuggestionsProvider()));

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Load effect amplifiers greater than 127 correctly
MOJIRA: MC-118857 MOJIRA: MC-118857
diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
index 5ac1aad619a71684a48a2cbd73a8cefc66c587b7..038ba61e4845a4a71bb78ba388ed249d19529b78 100644 index ddb369057bbfeb67c7825f7a93fa68d1c18eb6fc..14fab63346d56c72cd7534a04760efd10eef4295 100644
--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java --- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
+++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java +++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
@@ -264,7 +264,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> { @@ -286,7 +286,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
} }
private static MobEffectInstance loadSpecifiedEffect(MobEffect type, CompoundTag nbt) { private static MobEffectInstance loadSpecifiedEffect(MobEffect type, CompoundTag nbt) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Validate usernames
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index b6dc42aef6458b0c09007bb0e13048b99531f8c0..7e8401a05905775f7209abb1269e24aad409af50 100644 index 69498183a7637cd2dbb859c670e661f8722a090f..5df657555439e07d5fb67db8c82246c15676850d 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -60,6 +60,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -60,6 +60,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@ -56,10 +56,10 @@ index b6dc42aef6458b0c09007bb0e13048b99531f8c0..7e8401a05905775f7209abb1269e24aa
if (gameprofile != null && packet.name().equalsIgnoreCase(gameprofile.getName())) { if (gameprofile != null && packet.name().equalsIgnoreCase(gameprofile.getName())) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index d396e2cb91aa99d60c898f86e0f33d3ce3f885cd..147d955d8be63255ff74457c2c3b92cd22577342 100644 index 0f380a7045f89bc383e4eb3d93c1be3885def712..32c8218048fe61c58d78175d50f3d48413ddda6f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -652,7 +652,7 @@ public abstract class PlayerList { @@ -659,7 +659,7 @@ public abstract class PlayerList {
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
entityplayer = (ServerPlayer) this.players.get(i); entityplayer = (ServerPlayer) this.players.get(i);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Make water animal spawn height configurable
diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
index 522abd880c1e7f7c9026f0ab6457bc649f11802c..18389f46902bb9879ac6d734723e9a720724dc48 100644 index b2b55e65dd5c38b8ee610fc1f3247690115831b2..35cfa366baf6747105faa93f1220bb9cc31a5bd5 100644
--- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java --- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java +++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
@@ -79,6 +79,10 @@ public abstract class WaterAnimal extends PathfinderMob { @@ -78,6 +78,10 @@ public abstract class WaterAnimal extends PathfinderMob {
public static boolean checkSurfaceWaterAnimalSpawnRules(EntityType<? extends WaterAnimal> type, LevelAccessor world, MobSpawnType reason, BlockPos pos, RandomSource random) { public static boolean checkSurfaceWaterAnimalSpawnRules(EntityType<? extends WaterAnimal> type, LevelAccessor world, MobSpawnType reason, BlockPos pos, RandomSource random) {
int i = world.getSeaLevel(); int i = world.getSeaLevel();
int j = i - 13; int j = i - 13;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4fb05a2be3ff06ceddae37e1592db548c727a056..1b1b7560b7ae59c5da7ad0e3dfae32cbcaeedcbd 100644 index 87e5959a495eaccf3e6ec1102fb8a3f3edcc0cfe..b5967ac7772d1bc0768a816820375d80e249bf8f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -561,7 +561,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -563,7 +563,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver));
LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey); LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey);
@ -18,10 +18,10 @@ index 4fb05a2be3ff06ceddae37e1592db548c727a056..1b1b7560b7ae59c5da7ad0e3dfae32cb
biomeProvider = gen.getDefaultBiomeProvider(worldInfo); biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c4d5f3482881376bde77e826009a383804a2203d..759d091593b75419e275e79eaa3afbfbef6aee10 100644 index 1e54fc63253a12f2dbc248965d0027e526a3cc86..39c0300d84e44d499b26ea365fc2e038fda58196 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1222,7 +1222,7 @@ public final class CraftServer implements Server { @@ -1217,7 +1217,7 @@ public final class CraftServer implements Server {
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata)); List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
LevelStem worlddimension = iregistry.get(actualDimension); LevelStem worlddimension = iregistry.get(actualDimension);
@ -31,7 +31,7 @@ index c4d5f3482881376bde77e826009a383804a2203d..759d091593b75419e275e79eaa3afbfb
biomeProvider = generator.getDefaultBiomeProvider(worldInfo); biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 778d7503af4ab00e217c12b314c8ca4ccceae411..08fc562b69f93d6be21124ec4309580a26ad5c85 100644 index 3ec2674a3ebc2540b9832e7bd3c99d5c1373f47d..5086fcbbd908f5759653ce44b8524345b479d2b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -199,6 +199,30 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -199,6 +199,30 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add configurable height for slime spawn
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index 7b05640465a47ea8680b4a0b6648a77ea7a1b404..3da612821708f10f7f53b1c9e70adc649689529e 100644 index eea1124870b0914376ea00a7395b998058061cf8..3f367fb0b2f633024d27dc598738d6651a36f21b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -322,7 +322,11 @@ public class Slime extends Mob implements Enemy { @@ -322,7 +322,11 @@ public class Slime extends Mob implements Enemy {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 7e8401a05905775f7209abb1269e24aad409af50..0bedd9eadbfe1ce290f22d6c648571e25e3ae0e9 100644 index 5df657555439e07d5fb67db8c82246c15676850d..f45b616c4f418298c67903c141c52172b6dd51e0 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -371,7 +371,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -371,7 +371,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

View File

@ -7,10 +7,10 @@ Makes the PlayerKickEvent fire on the main thread for
illegal characters or chat out-of-order errors. illegal characters or chat out-of-order errors.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a036621f28f42151871c78337290e1158f1ca83f..7a274daf2dcc96ce529708293cf0708456067188 100644 index e18e2ef7846a49e24411adf571b25d37e068c3fe..c11e1803ba16a6c380bb0a23408a04d724d92798 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2168,7 +2168,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2160,7 +2160,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// CraftBukkit end // CraftBukkit end
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
@ -20,7 +20,7 @@ index a036621f28f42151871c78337290e1158f1ca83f..7a274daf2dcc96ce529708293cf07084
} else { } else {
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages()); Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages());
@@ -2202,7 +2204,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2194,7 +2196,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleChatCommand(ServerboundChatCommandPacket packet) { public void handleChatCommand(ServerboundChatCommandPacket packet) {
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
@ -30,7 +30,7 @@ index a036621f28f42151871c78337290e1158f1ca83f..7a274daf2dcc96ce529708293cf07084
} else { } else {
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages()); Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
@@ -2282,7 +2286,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2274,7 +2278,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) { if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
@ -38,5 +38,5 @@ index a036621f28f42151871c78337290e1158f1ca83f..7a274daf2dcc96ce529708293cf07084
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca
+ }); // Paper - push to main + }); // Paper - push to main
return Optional.empty(); return Optional.empty();
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else {
this.send(new ClientboundSystemChatPacket(PaperAdventure.asAdventure(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED)), false)); // Paper - Adventure Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Multi Block Change API Implementation
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
index 0d851e197e65ec79386ad1f981f6d1d38b65124a..24c677e80af652952263253409c050641e72e3b5 100644 index c96e75456c2f8564d3bc75993cc6e03ba605597d..7c6a6693760638a07b7c7c330aaeffd9fa454845 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
@@ -63,6 +63,15 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa @@ -63,6 +63,15 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
@ -25,10 +25,10 @@ index 0d851e197e65ec79386ad1f981f6d1d38b65124a..24c677e80af652952263253409c05064
public void write(FriendlyByteBuf buf) { public void write(FriendlyByteBuf buf) {
buf.writeLong(this.sectionPos.asLong()); buf.writeLong(this.sectionPos.asLong());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 13855196d3c5405116bcd60518e8dd6b4fa0bf3f..7034ca7b50c12b000abf33b14fbe216fe8b14a8c 100644 index c1c8b73f91655e2a3a6d4706559a31dc5f5fecc3..63f383fec691d7f6160ec3d8d675c8db0aad1bcd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -943,6 +943,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -944,6 +944,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet); this.getHandle().connection.send(packet);
} }

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Fix NotePlayEvent
public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum; public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum;
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
index 52a174884f416c9e61591e18aba3b4cd0073ea02..df7965c86b9c9e89b07b76c75b638d391ea6cc34 100644 index 1327eb8ff0f044340d6a1c7058dc6d8a191615dc..50ead76879398222a76f26c36e98800d2d1af167 100644
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java --- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
@@ -88,11 +88,12 @@ public class NoteBlock extends Block { @@ -90,11 +90,12 @@ public class NoteBlock extends Block {
private void playNote(@Nullable Entity entity, BlockState state, Level world, BlockPos pos) { private void playNote(@Nullable Entity entity, BlockState state, Level world, BlockPos pos) {
if (!((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).requiresAirAbove() || world.getBlockState(pos.above()).isAir()) { if (!((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).requiresAirAbove() || world.getBlockState(pos.above()).isAir()) {
// CraftBukkit start // CraftBukkit start
@ -27,7 +27,7 @@ index 52a174884f416c9e61591e18aba3b4cd0073ea02..df7965c86b9c9e89b07b76c75b638d39
world.blockEvent(pos, this, 0, 0); world.blockEvent(pos, this, 0, 0);
world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, pos); world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, pos);
} }
@@ -122,11 +123,15 @@ public class NoteBlock extends Block { @@ -132,11 +133,15 @@ public class NoteBlock extends Block {
@Override @Override
public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) { public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) {
@ -44,7 +44,7 @@ index 52a174884f416c9e61591e18aba3b4cd0073ea02..df7965c86b9c9e89b07b76c75b638d39
f = (float) Math.pow(2.0D, (double) (k - 12) / 12.0D); f = (float) Math.pow(2.0D, (double) (k - 12) / 12.0D);
world.addParticle(ParticleTypes.NOTE, (double) pos.getX() + 0.5D, (double) pos.getY() + 1.2D, (double) pos.getZ() + 0.5D, (double) k / 24.0D, 0.0D, 0.0D); world.addParticle(ParticleTypes.NOTE, (double) pos.getX() + 0.5D, (double) pos.getY() + 1.2D, (double) pos.getZ() + 0.5D, (double) k / 24.0D, 0.0D, 0.0D);
@@ -148,7 +153,7 @@ public class NoteBlock extends Block { @@ -158,7 +163,7 @@ public class NoteBlock extends Block {
holder = blockpropertyinstrument.getSoundEvent(); holder = blockpropertyinstrument.getSoundEvent();
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Freeze Tick Lock API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 9bbc8e1f15b5dfc62bcb065d6ebb87fa58afb91e..ac9a612488bf8a3efdfbfbfe9fb1de818dac742b 100644 index bd8e756bf1e74cdc75cc12d2368a6fe702a759ad..25610f1100d64f542506cc6b3d4469a810254dc7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -396,6 +396,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -397,6 +397,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
private org.bukkit.util.Vector origin; private org.bukkit.util.Vector origin;
@javax.annotation.Nullable @javax.annotation.Nullable
private UUID originWorld; private UUID originWorld;
@ -16,7 +16,7 @@ index 9bbc8e1f15b5dfc62bcb065d6ebb87fa58afb91e..ac9a612488bf8a3efdfbfbfe9fb1de81
public void setOrigin(@javax.annotation.Nonnull Location location) { public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector(); this.origin = location.toVector();
@@ -825,7 +826,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -826,7 +827,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setRemainingFireTicks(this.remainingFireTicks - 1); this.setRemainingFireTicks(this.remainingFireTicks - 1);
} }
@ -25,7 +25,7 @@ index 9bbc8e1f15b5dfc62bcb065d6ebb87fa58afb91e..ac9a612488bf8a3efdfbfbfe9fb1de81
this.setTicksFrozen(0); this.setTicksFrozen(0);
this.level.levelEvent((Player) null, 1009, this.blockPosition, 1); this.level.levelEvent((Player) null, 1009, this.blockPosition, 1);
} }
@@ -2285,6 +2286,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2297,6 +2298,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (fromNetherPortal) { if (fromNetherPortal) {
nbt.putBoolean("Paper.FromNetherPortal", true); nbt.putBoolean("Paper.FromNetherPortal", true);
} }
@ -35,7 +35,7 @@ index 9bbc8e1f15b5dfc62bcb065d6ebb87fa58afb91e..ac9a612488bf8a3efdfbfbfe9fb1de81
// Paper end // Paper end
return nbt; return nbt;
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -2449,6 +2453,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2462,6 +2466,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (spawnReason == null) { if (spawnReason == null) {
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
} }
@ -46,23 +46,23 @@ index 9bbc8e1f15b5dfc62bcb065d6ebb87fa58afb91e..ac9a612488bf8a3efdfbfbfe9fb1de81
} catch (Throwable throwable) { } catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index c1185c4bd9151b08a9c7707e2eb8517bbeb47919..13ff58b76d7c1c02921ee3266a67f7c5befef30e 100644 index 15c00d3dc8cab6968703d0420600aa77b2ffbec5..7fed29460309e1f35ee0207b4c07990201807bd1 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3411,7 +3411,7 @@ public abstract class LivingEntity extends Entity { @@ -3375,7 +3375,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES);
int i;
this.level.getProfiler().pop();
this.level.getProfiler().push("freezing");
- if (!this.level.isClientSide && !this.isDeadOrDying()) { - if (!this.level.isClientSide && !this.isDeadOrDying()) {
+ if (!this.level.isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API + if (!this.level.isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API
i = this.getTicksFrozen(); int i = this.getTicksFrozen();
if (this.isInPowderSnow && this.canFreeze()) { if (this.isInPowderSnow && this.canFreeze()) {
this.setTicksFrozen(Math.min(this.getTicksRequiredToFreeze(), i + 1));
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 03b20cec361a2eff27c1187b2a4c5a65d2b4f9b4..32b9816283c8c1de929d5664733553277cf6bf3c 100644 index 7ea5f911046fd05be8a997b07e6f66d69eaa9564..7df1eebce5b62214943e55314e9ec98f056fa330 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -652,6 +652,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -663,6 +663,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return this.getHandle().isFullyFrozen(); return this.getHandle().isFullyFrozen();
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Use a CHM for StructureTemplate.Pallete cache
fixes a CME due to this collection being shared across threads fixes a CME due to this collection being shared across threads
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
index 76666318690368bab672c2302c90dd3abb050299..d1bfb95114b733dde9537c4de6bd1bccb696cd18 100644 index 2ed4453c7744c1c99210d581af8d68bced4659c6..53ef0991be65d18c3f80030992726b462a7bd8a8 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java --- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
@@ -833,7 +833,7 @@ public class StructureTemplate { @@ -836,7 +836,7 @@ public class StructureTemplate {
public static final class Palette { public static final class Palette {
private final List<StructureTemplate.StructureBlockInfo> blocks; private final List<StructureTemplate.StructureBlockInfo> blocks;

View File

@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 759d091593b75419e275e79eaa3afbfbef6aee10..11f133dccb7bb837d369b2b41f96b26875dc6967 100644 index 39c0300d84e44d499b26ea365fc2e038fda58196..aeb0b205a710dc6c638c512f7b5f111aefdea399 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2000,6 +2000,13 @@ public final class CraftServer implements Server { @@ -1999,6 +1999,13 @@ public final class CraftServer implements Server {
return console.console; return console.console;
} }

View File

@ -20,7 +20,7 @@ seeds/salts to the frequency reducer which has a similar effect.
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com> Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
index 9ef0937b7292ec118d2b65e9b098f5538410dbac..130ac7164c63374120ca2cdfbb1f6c3eefb4b7a5 100644 index 31955f62253feb111239247c4f8c2215b3080c1d..42ecfc1237bfc724dc9134a6a8bae3670251449e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -568,7 +568,7 @@ public abstract class ChunkGenerator { @@ -568,7 +568,7 @@ public abstract class ChunkGenerator {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Implement regenerateChunk
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 08fc562b69f93d6be21124ec4309580a26ad5c85..7fc663f4e91fa885a7977638e423b1cce6efce39 100644 index 5086fcbbd908f5759653ce44b8524345b479d2b8..e52008c574d1f8738c02848c98aee12dd5fb30ab 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -138,6 +138,7 @@ import org.bukkit.util.Vector; @@ -138,6 +138,7 @@ import org.bukkit.util.Vector;

View File

@ -20,10 +20,10 @@ index e581dc10f3c805f7f8b6e4c842092609e7e1a0f8..b0204af850ee182773ad458208cccd94
} }
return InteractionResult.FAIL; return InteractionResult.FAIL;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 218065e92c2d0d1141359255f77eb6747dabce35..1d52646d68ff05a597a41495f288471ce60b2d29 100644 index 1bc9cb46e7ceb274bad7ca02b7bc834e96111f56..32e617461d603c3f8e968e82bb1d2e7e14b19aa2 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -345,7 +345,7 @@ public final class ItemStack { @@ -346,7 +346,7 @@ public final class ItemStack {
int oldCount = this.getCount(); int oldCount = this.getCount();
ServerLevel world = (ServerLevel) itemactioncontext.getLevel(); ServerLevel world = (ServerLevel) itemactioncontext.getLevel();
@ -32,7 +32,7 @@ index 218065e92c2d0d1141359255f77eb6747dabce35..1d52646d68ff05a597a41495f288471c
world.captureBlockStates = true; world.captureBlockStates = true;
// special case bonemeal // special case bonemeal
if (this.getItem() == Items.BONE_MEAL) { if (this.getItem() == Items.BONE_MEAL) {
@@ -400,7 +400,7 @@ public final class ItemStack { @@ -401,7 +401,7 @@ public final class ItemStack {
world.capturedBlockStates.clear(); world.capturedBlockStates.clear();
if (blocks.size() > 1) { if (blocks.size() > 1) {
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ()); placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
Copies appropriate checks from CraftWorld#getSpawnLimit Copies appropriate checks from CraftWorld#getSpawnLimit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 11f133dccb7bb837d369b2b41f96b26875dc6967..93f6b4ebf1ad238248b201878cfb3cdeee2515f9 100644 index aeb0b205a710dc6c638c512f7b5f111aefdea399..0f45a37053a1de4ac131d74382ff6e431f3a40b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2174,6 +2174,8 @@ public final class CraftServer implements Server { @@ -2173,6 +2173,8 @@ public final class CraftServer implements Server {
@Override @Override
public int getSpawnLimit(SpawnCategory spawnCategory) { public int getSpawnLimit(SpawnCategory spawnCategory) {
// Paper start // Paper start

View File

@ -46,10 +46,10 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 93f6b4ebf1ad238248b201878cfb3cdeee2515f9..1e38084012b576fcd26c1d432fd8b275d1054d7f 100644 index 0f45a37053a1de4ac131d74382ff6e431f3a40b7..70cbdf557b81f9e7e5d744c31ea6972f96de55a3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2585,6 +2585,15 @@ public final class CraftServer implements Server { @@ -2583,6 +2583,15 @@ public final class CraftServer implements Server {
return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey); return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey);
} }
} }
@ -65,7 +65,7 @@ index 93f6b4ebf1ad238248b201878cfb3cdeee2515f9..1e38084012b576fcd26c1d432fd8b275
default -> throw new IllegalArgumentException(); default -> throw new IllegalArgumentException();
} }
@@ -2617,6 +2626,13 @@ public final class CraftServer implements Server { @@ -2615,6 +2624,13 @@ public final class CraftServer implements Server {
net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE; net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE;
return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList()); return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList());
} }

Some files were not shown because too many files have changed in this diff Show More