[ci skip] Fix typos in Paper comments (#6588)
* //Paper -> // Paper * // Tuiniy -> // Paper
This commit is contained in:
parent
8a2b23a6a4
commit
d060913a61
13 changed files with 30 additions and 30 deletions
|
@ -5,7 +5,7 @@ Subject: [PATCH] add hand to BlockMultiPlaceEvent
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java
|
diff --git a/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java
|
||||||
index fe2ec79dd6084509cb8cbb8155a356f4162466fd..8460aa4f5e211fb0a6ab11f7487d38dba927e1da 100644
|
index fe2ec79dd6084509cb8cbb8155a356f4162466fd..7ca2b1b321447289c50c210a608a88db9c4b4f99 100644
|
||||||
--- a/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java
|
--- a/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java
|
+++ b/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java
|
||||||
@@ -18,9 +18,17 @@ import org.jetbrains.annotations.NotNull;
|
@@ -18,9 +18,17 @@ import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -15,7 +15,7 @@ index fe2ec79dd6084509cb8cbb8155a356f4162466fd..8460aa4f5e211fb0a6ab11f7487d38db
|
||||||
+ @Deprecated // Paper
|
+ @Deprecated // Paper
|
||||||
public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) {
|
public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) {
|
||||||
- super(states.get(0).getBlock(), states.get(0), clicked, itemInHand, thePlayer, canBuild);
|
- super(states.get(0).getBlock(), states.get(0), clicked, itemInHand, thePlayer, canBuild);
|
||||||
+ //Paper start - add hand to BlockMultiPlaceEvent
|
+ // Paper start - add hand to BlockMultiPlaceEvent
|
||||||
+ this(states, clicked, itemInHand, thePlayer, canBuild, org.bukkit.inventory.EquipmentSlot.HAND);
|
+ this(states, clicked, itemInHand, thePlayer, canBuild, org.bukkit.inventory.EquipmentSlot.HAND);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -23,7 +23,7 @@ index fe2ec79dd6084509cb8cbb8155a356f4162466fd..8460aa4f5e211fb0a6ab11f7487d38db
|
||||||
+ public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild, @NotNull org.bukkit.inventory.EquipmentSlot hand) {
|
+ public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild, @NotNull org.bukkit.inventory.EquipmentSlot hand) {
|
||||||
+ super(states.get(0).getBlock(), states.get(0), clicked, itemInHand, thePlayer, canBuild, hand);
|
+ super(states.get(0).getBlock(), states.get(0), clicked, itemInHand, thePlayer, canBuild, hand);
|
||||||
this.states = ImmutableList.copyOf(states);
|
this.states = ImmutableList.copyOf(states);
|
||||||
+ //Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5208,7 +5208,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..bbf2dee8cdd2d8239d9230b1a7fff4f0
|
||||||
|
|
||||||
if (!playerchunk_state1.isOrAfter(playerchunk_state)) {
|
if (!playerchunk_state1.isOrAfter(playerchunk_state)) {
|
||||||
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 e9d2034f0753670c2ce69cc93c7e98e89af65c87..12a9a6fa04867d5695d46bf7973f1542798485be 100644
|
index e9d2034f0753670c2ce69cc93c7e98e89af65c87..f6ed7482fd9c3d536fc8956a80a6ad6f315431e2 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
|
||||||
@@ -55,6 +55,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
|
@@ -55,6 +55,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
|
||||||
|
@ -5271,7 +5271,7 @@ index e9d2034f0753670c2ce69cc93c7e98e89af65c87..12a9a6fa04867d5695d46bf7973f1542
|
||||||
+ public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) {
|
+ public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) {
|
||||||
+ return this.pendingUnloads.get(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
+ return this.pendingUnloads.get(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
||||||
+ }
|
+ }
|
||||||
+ // Tuiniy end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
|
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
|
||||||
super(new File(session.getDimensionPath(world.dimension()), "region"), dataFixer, dsync);
|
super(new File(session.getDimensionPath(world.dimension()), "region"), dataFixer, dsync);
|
||||||
|
@ -5992,7 +5992,7 @@ index c57bde6b2042c0a68cb02f43c28cae0070f38111..a5f704edf4d8afdb088f3a4ac8e3957f
|
||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
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 e01a7a18d026a8b794a575dd2f5dc907c510fda4..2473816c70c05662d75f6b875b46a4e53d7b76fa 100644
|
index 442cded9bbf61f9388d41e0257728460628ebbc9..7ac8bac2f538616de0c4ef59c9ac2ec86aa62b43 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
|
||||||
@@ -259,6 +259,7 @@ public abstract class LivingEntity extends Entity {
|
@@ -259,6 +259,7 @@ public abstract class LivingEntity extends Entity {
|
||||||
|
|
|
@ -19,7 +19,7 @@ index 2c53a400611c78236c5a1c1270d27c02e94251bf..a1d5c0f8fe2adb2ee56f3217e089211e
|
||||||
if (outputStream != null) {
|
if (outputStream != null) {
|
||||||
try {
|
try {
|
||||||
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 5de0b15ee206ad01b1b4522b2d375fae08d2486f..c24c5c39103fd2ae37711b745fef74c44ac18565 100644
|
index 5de0b15ee206ad01b1b4522b2d375fae08d2486f..daad04711adcaac9dc3868f20f7dc3c4a09fbac8 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
|
||||||
@@ -1443,7 +1443,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1443,7 +1443,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -27,7 +27,7 @@ index 5de0b15ee206ad01b1b4522b2d375fae08d2486f..c24c5c39103fd2ae37711b745fef74c4
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
- return "Spigot"; // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
- return "Spigot"; // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||||
+ return "Paper"; //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
+ return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||||
}
|
}
|
||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport details) {
|
public SystemReport fillSystemReport(SystemReport details) {
|
||||||
|
|
|
@ -36,14 +36,14 @@ index 463588bae82ee8448533cfed76ba0e6ac2228cc1..272840d1f463276944cf4aa941f44518
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 3e2a5f83afcc3b9c9fe62748895d489135af03bf..dd61048b3898ef3ea5a2bd2f95e9bd3fc11dc298 100644
|
index 3e2a5f83afcc3b9c9fe62748895d489135af03bf..1f3fe980e71c13b5e7852349cba1cb0e4aa42dcd 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -791,6 +791,15 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -791,6 +791,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
List<ChunkHolder> list = Lists.newArrayList(this.chunkMap.getChunks());
|
List<ChunkHolder> list = Lists.newArrayList(this.chunkMap.getChunks());
|
||||||
|
|
||||||
Collections.shuffle(list);
|
Collections.shuffle(list);
|
||||||
+ //Paper start - call player naturally spawn event
|
+ // Paper start - call player naturally spawn event
|
||||||
+ int chunkRange = level.spigotConfig.mobSpawnRange;
|
+ int chunkRange = level.spigotConfig.mobSpawnRange;
|
||||||
+ chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
|
+ chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
|
||||||
+ chunkRange = Math.min(chunkRange, 8);
|
+ chunkRange = Math.min(chunkRange, 8);
|
||||||
|
|
|
@ -80,14 +80,14 @@ index 10c1f2d8a92f848c3f2be9d1d06fd254978e6dcc..74bfe0d3942259c45702b099efdc4e10
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
||||||
index 0e076173033278587df2b5dfbd01cc9005651eb5..a8a1ecfa349d4cb8daa1d426920988c64b392b14 100644
|
index 0e076173033278587df2b5dfbd01cc9005651eb5..dbd8b9b09b82c1b75e8be9dc7416d9f0863c8c87 100644
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
||||||
@@ -31,6 +31,16 @@ public class ClientboundContainerSetContentPacket implements Packet<ClientGamePa
|
@@ -31,6 +31,16 @@ public class ClientboundContainerSetContentPacket implements Packet<ClientGamePa
|
||||||
this.carriedItem = buf.readItem();
|
this.carriedItem = buf.readItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ //Paper start
|
+ // Paper start
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean packetTooLarge(net.minecraft.network.Connection manager) {
|
+ public boolean packetTooLarge(net.minecraft.network.Connection manager) {
|
||||||
+ for (int i = 0 ; i < this.items.size() ; i++) {
|
+ for (int i = 0 ; i < this.items.size() ; i++) {
|
||||||
|
|
|
@ -145,7 +145,7 @@ index 1ea32090783ac5b885b95ae2009dd61de3063ae0..8d3cdd288eacc91f7c9a624f601284e5
|
||||||
|
|
||||||
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) {
|
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) {
|
||||||
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 292fb6d71ca8bd63ad04d87d04f13b7f4f6f98fc..d2080cfe58f7e241c9612ad0e500240dcb341878 100644
|
index 292fb6d71ca8bd63ad04d87d04f13b7f4f6f98fc..831394e82fd04daf00971019a7d479629e83baaf 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
|
||||||
@@ -127,7 +127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -127,7 +127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
|
@ -302,7 +302,7 @@ index 292fb6d71ca8bd63ad04d87d04f13b7f4f6f98fc..d2080cfe58f7e241c9612ad0e500240d
|
||||||
this.viewDistance = j;
|
this.viewDistance = j;
|
||||||
- this.distanceManager.updatePlayerTickets(this.viewDistance);
|
- this.distanceManager.updatePlayerTickets(this.viewDistance);
|
||||||
- ObjectIterator objectiterator = this.updatingChunkMap.values().iterator();
|
- ObjectIterator objectiterator = this.updatingChunkMap.values().iterator();
|
||||||
+ this.setNoTickViewDistance(this.getRawNoTickViewDistance()); //Paper - no-tick view distance - propagate changes to no-tick, which does the actual chunk loading/sending
|
+ this.setNoTickViewDistance(this.getRawNoTickViewDistance()); // Paper - no-tick view distance - propagate changes to no-tick, which does the actual chunk loading/sending
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
- while (objectiterator.hasNext()) {
|
- while (objectiterator.hasNext()) {
|
||||||
|
|
|
@ -5,14 +5,14 @@ Subject: [PATCH] add hand to BlockMultiPlaceEvent
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index aa652bfcd0e60784afc36a800a0278c3baa32221..794f8cbcf7072b10fa06c26a122739b37fe0430c 100644
|
index aa652bfcd0e60784afc36a800a0278c3baa32221..8063583b8b59534d277d14c28faa607efc1e26ed 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
@@ -343,13 +343,18 @@ public class CraftEventFactory {
|
@@ -343,13 +343,18 @@ public class CraftEventFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
org.bukkit.inventory.ItemStack item;
|
org.bukkit.inventory.ItemStack item;
|
||||||
+ //Paper start - add hand to BlockMultiPlaceEvent
|
+ // Paper start - add hand to BlockMultiPlaceEvent
|
||||||
+ EquipmentSlot equipmentSlot;
|
+ EquipmentSlot equipmentSlot;
|
||||||
if (hand == InteractionHand.MAIN_HAND) {
|
if (hand == InteractionHand.MAIN_HAND) {
|
||||||
item = player.getInventory().getItemInMainHand();
|
item = player.getInventory().getItemInMainHand();
|
||||||
|
@ -24,7 +24,7 @@ index aa652bfcd0e60784afc36a800a0278c3baa32221..794f8cbcf7072b10fa06c26a122739b3
|
||||||
|
|
||||||
- BlockMultiPlaceEvent event = new BlockMultiPlaceEvent(blockStates, blockClicked, item, player, canBuild);
|
- BlockMultiPlaceEvent event = new BlockMultiPlaceEvent(blockStates, blockClicked, item, player, canBuild);
|
||||||
+ BlockMultiPlaceEvent event = new BlockMultiPlaceEvent(blockStates, blockClicked, item, player, canBuild, equipmentSlot);
|
+ BlockMultiPlaceEvent event = new BlockMultiPlaceEvent(blockStates, blockClicked, item, player, canBuild, equipmentSlot);
|
||||||
+ //Paper end
|
+ // Paper end
|
||||||
craftServer.getPluginManager().callEvent(event);
|
craftServer.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
|
|
|
@ -37,7 +37,7 @@ index a3ba56f437fe9e4dac59370463052341eb9b7524..c6c4d2fd3205dfcaff9e0f1a6b92b749
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
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 136b832c1a04042457817b2bf2a4a5d057d1b6ca..035061a3cb18566c296875a250ff6e2aeea0bf8e 100644
|
index 389d6c519ed8091c1d0bf5437d5499b34460da08..d6bd16aa2df0c086449b607428c5ae4324bddb6c 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
|
||||||
@@ -205,6 +205,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -205,6 +205,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
|
@ -291,7 +291,7 @@ index b49d380ef088aed3204ec71abc437c348ef004fa..577b391dcba1db712c1e2c83296e1c87
|
||||||
|
|
||||||
public String getDebugStatus() {
|
public String getDebugStatus() {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index abd814f397a90fcaaf98a76ed83b5f9f76f2948e..0ce86c72cb829b816ec7bfb8f0d19396e1b12eb6 100644
|
index fe9711daa67151187906128c9d07ad967b72e677..0ce86c72cb829b816ec7bfb8f0d19396e1b12eb6 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -892,6 +892,37 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -892,6 +892,37 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
|
@ -336,7 +336,7 @@ index abd814f397a90fcaaf98a76ed83b5f9f76f2948e..0ce86c72cb829b816ec7bfb8f0d19396
|
||||||
List<ChunkHolder> list = Lists.newArrayList(this.chunkMap.getChunks());
|
List<ChunkHolder> list = Lists.newArrayList(this.chunkMap.getChunks());
|
||||||
|
|
||||||
Collections.shuffle(list);
|
Collections.shuffle(list);
|
||||||
- //Paper start - call player naturally spawn event
|
- // Paper start - call player naturally spawn event
|
||||||
- int chunkRange = level.spigotConfig.mobSpawnRange;
|
- int chunkRange = level.spigotConfig.mobSpawnRange;
|
||||||
- chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
|
- chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
|
||||||
- chunkRange = Math.min(chunkRange, 8);
|
- chunkRange = Math.min(chunkRange, 8);
|
||||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Optimize brigadier child sorting performance
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java
|
diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java
|
||||||
index 2dd09c97e00d877f5f3beed9583d3fdabc88e181..74af1b6158394d66fe470f9b7db741871f2bb534 100644
|
index 2dd09c97e00d877f5f3beed9583d3fdabc88e181..2b87c6eb28d4db634dd6d8ee42ff3aa78ed7cb68 100644
|
||||||
--- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java
|
--- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java
|
||||||
+++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java
|
+++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java
|
||||||
@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
|
@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
|
||||||
|
@ -13,7 +13,7 @@ index 2dd09c97e00d877f5f3beed9583d3fdabc88e181..74af1b6158394d66fe470f9b7db74187
|
||||||
|
|
||||||
public abstract class CommandNode<S> implements Comparable<CommandNode<S>> {
|
public abstract class CommandNode<S> implements Comparable<CommandNode<S>> {
|
||||||
- private Map<String, CommandNode<S>> children = Maps.newLinkedHashMap();
|
- private Map<String, CommandNode<S>> children = Maps.newLinkedHashMap();
|
||||||
+ private Map<String, CommandNode<S>> children = Maps.newTreeMap(); //Paper - Switch to tree map for automatic sorting
|
+ private Map<String, CommandNode<S>> children = Maps.newTreeMap(); // Paper - Switch to tree map for automatic sorting
|
||||||
private Map<String, LiteralCommandNode<S>> literals = Maps.newLinkedHashMap();
|
private Map<String, LiteralCommandNode<S>> literals = Maps.newLinkedHashMap();
|
||||||
private Map<String, ArgumentCommandNode<S, ?>> arguments = Maps.newLinkedHashMap();
|
private Map<String, ArgumentCommandNode<S, ?>> arguments = Maps.newLinkedHashMap();
|
||||||
public Predicate<S> requirement;
|
public Predicate<S> requirement;
|
||||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Expose Arrow getItemStack
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
||||||
index 376885c8148da619a3b203145d315ebaf44994fb..88defdc48c72580bbf029910f159dedccf67dc1e 100644
|
index 376885c8148da619a3b203145d315ebaf44994fb..454c8fab2f0b60aa3afd73805ea3586881605450 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
||||||
@@ -102,6 +102,13 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
|
@@ -102,6 +102,13 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
|
||||||
|
@ -17,7 +17,7 @@ index 376885c8148da619a3b203145d315ebaf44994fb..88defdc48c72580bbf029910f159dedc
|
||||||
+ public org.bukkit.craftbukkit.inventory.CraftItemStack getItemStack() {
|
+ public org.bukkit.craftbukkit.inventory.CraftItemStack getItemStack() {
|
||||||
+ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem());
|
+ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem());
|
||||||
+ }
|
+ }
|
||||||
+ //Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void setTicksLived(int value) {
|
public void setTicksLived(int value) {
|
||||||
|
|
|
@ -8,12 +8,12 @@ Sync loading the chunk at this stage would cause it to load
|
||||||
older data, as well as screwing our region state.
|
older data, as well as screwing our region state.
|
||||||
|
|
||||||
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 dd6980326a2ec41a5eb65038ee8283a7cb8195bf..7e750f84b7f7050bd2405ab01a233aa231db62c4 100644
|
index 00e79197d59bcbca0785ff0d651220756cb57c9b..fb647b770ffd7bc7609c98232e74a0bc9b98522b 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
|
||||||
@@ -341,6 +341,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -341,6 +341,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
// Tuiniy end
|
// Paper end
|
||||||
|
|
||||||
+ boolean unloadingPlayerChunk = false; // Paper - do not allow ticket level changes while unloading chunks
|
+ boolean unloadingPlayerChunk = false; // Paper - do not allow ticket level changes while unloading chunks
|
||||||
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
|
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ chunk through it. This should also be OK from a leak prevention/
|
||||||
state desync POV because the TE is getting unloaded anyways.
|
state desync POV because the TE is getting unloaded anyways.
|
||||||
|
|
||||||
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 f8c0574137cab33d0b5efe5d532efb132dcb914a..7000909d2910e3e0e87e05f0a8bda8269f8d7e05 100644
|
index f8c0574137cab33d0b5efe5d532efb132dcb914a..80f59abeb0081fe4784f3c0d027e8dfce752814b 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
|
||||||
@@ -1292,9 +1292,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1292,9 +1292,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
|
@ -23,7 +23,7 @@ index f8c0574137cab33d0b5efe5d532efb132dcb914a..7000909d2910e3e0e87e05f0a8bda826
|
||||||
- h.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper
|
- h.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper
|
||||||
+ ((org.bukkit.craftbukkit.entity.CraftHumanEntity)h).getHandle().closeUnloadedInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper
|
+ ((org.bukkit.craftbukkit.entity.CraftHumanEntity)h).getHandle().closeUnloadedInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper
|
||||||
}
|
}
|
||||||
+ // Tuiniy end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Spigot End
|
// Spigot End
|
||||||
|
|
|
@ -1202,7 +1202,7 @@ index 54822e418e319db551bfea3218d00faf0e043f43..de0c6316c9b75a2ecc7d6abf7bcca24e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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 ff2fbe220da7daf572298a3d65cd11257fcc147c..74a2e70220832257c036c40e0aa8626ab2a4ae7f 100644
|
index 83eb42f4021df19e5c58c2c0ff3d8fea89df8974..74a2e70220832257c036c40e0aa8626ab2a4ae7f 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
|
||||||
@@ -187,22 +187,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -187,22 +187,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
|
@ -1375,7 +1375,7 @@ index ff2fbe220da7daf572298a3d65cd11257fcc147c..74a2e70220832257c036c40e0aa8626a
|
||||||
int k = this.viewDistance;
|
int k = this.viewDistance;
|
||||||
|
|
||||||
this.viewDistance = j;
|
this.viewDistance = j;
|
||||||
- this.setNoTickViewDistance(this.getRawNoTickViewDistance()); //Paper - no-tick view distance - propagate changes to no-tick, which does the actual chunk loading/sending
|
- this.setNoTickViewDistance(this.getRawNoTickViewDistance()); // Paper - no-tick view distance - propagate changes to no-tick, which does the actual chunk loading/sending
|
||||||
+ this.playerChunkManager.setTickDistance(Mth.clamp(viewDistance, 2, 32)); // Paper - replace player loader system
|
+ this.playerChunkManager.setTickDistance(Mth.clamp(viewDistance, 2, 32)); // Paper - replace player loader system
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue