Updated Upstream (Bukkit/CraftBukkit/Spigot)

Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
b850a822 SPIGOT-4526: Add conversion time API for Zombie & subclasses

CraftBukkit Changes:
38cf676e SPIGOT-4534: CreatureSpawnEvent not being called for CHUNK_GEN
b446cb5d SPIGOT-4527: Fix sponges with waterlogged blocks
6ec8ea5c SPIGOT-4526: Add conversion time API for Zombie & subclasses
c64fe508 Mappings Update
a3c2ec03 Fix missing ServerListPingEvent call for legacy pings

Spigot Changes:
1dc156ce Rebuild patches
140f654d Mappings Update
This commit is contained in:
Shane Freeder 2018-12-17 05:18:06 +00:00
parent 84c81146c1
commit 21ae8ff67e
150 changed files with 1096 additions and 1039 deletions

View file

@ -5,14 +5,13 @@ Subject: [PATCH] Add more Zombie API
diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java
index 62923379..a6894903 100644
index 48034198..615dd990 100644
--- a/src/main/java/org/bukkit/entity/Zombie.java
+++ b/src/main/java/org/bukkit/entity/Zombie.java
@@ -0,0 +0,0 @@ public interface Zombie extends Monster {
* @param time new conversion time
*/
@Deprecated
public Villager.Profession getVillagerProfession();
+
void setConversionTime(int time);
+ // Paper start
+ /**
+ * Check if zombie is drowning
@ -25,7 +24,10 @@ index 62923379..a6894903 100644
+ * Make zombie start drowning
+ *
+ * @param drownedConversionTime Amount of time until zombie converts from drowning
+ *
+ * @deprecated See {@link #setConversionTime(int)}
+ */
+ @Deprecated
+ void startDrowning(int drownedConversionTime);
+
+ /**

View file

@ -10,32 +10,19 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
index fd6df39f1..f03aef2fe 100644
index e1ea8da88..f1921e151 100644
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
@@ -0,0 +0,0 @@ public class EnchantmentManager {
return getEnchantmentLevel(Enchantments.F, itemstack) > 0;
return getEnchantmentLevel(Enchantments.CHANNELING, itemstack) > 0;
}
+ public static ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { return b(enchantment, entityliving); } // Paper - OBFHELPER
public static ItemStack b(Enchantment enchantment, EntityLiving entityliving) {
List<ItemStack> list = enchantment.a(entityliving);// Paper - decompile fix
if (list.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java
index 8cfb38b82..44b2d428b 100644
--- a/src/main/java/net/minecraft/server/Enchantments.java
+++ b/src/main/java/net/minecraft/server/Enchantments.java
@@ -0,0 +0,0 @@ public class Enchantments {
public static final Enchantment D = a("impaling");
public static final Enchantment E = a("riptide");
public static final Enchantment F = a("channeling");
- public static final Enchantment G = a("mending");
+ public static final Enchantment G = a("mending");public static final Enchantment MENDING = G; // Paper - OBFHELPER
public static final Enchantment H = a("vanishing_curse");
@Nullable
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
index 73205b2f7..69d4dc9ab 100644
index 4bcae2c21..09d85764b 100644
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
@@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity {

View file

@ -10,7 +10,7 @@ Fixes and adds new Immunities to improve gameplay behavior
Adds water Mobs to activation range config and nerfs fish
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index d81e2dc1c5..7bd51b3578 100644
index c9019260b..e980e31fc 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
@ -22,7 +22,7 @@ index d81e2dc1c5..7bd51b3578 100644
return new BlockPosition(this);
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index e7f9e490bf..68ceee5f08 100644
index 69645d517..9682b0a01 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -34,7 +34,7 @@ index e7f9e490bf..68ceee5f08 100644
if (i != this.aM) {
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
index 20b7c2c6dc..d659c57dbe 100644
index 20b7c2c6d..d659c57db 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent;
@ -46,7 +46,7 @@ index 20b7c2c6dc..d659c57dbe 100644
private float b;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index c87304d477..41a4962e94 100644
index ac250182b..06bb8cf1f 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
@ -68,7 +68,7 @@ index c87304d477..41a4962e94 100644
return this.moveController;
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 334580a8b7..b2b575d0e8 100644
index 95af2d529..162de836e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
@ -77,11 +77,11 @@ index 334580a8b7..b2b575d0e8 100644
public EntityHuman killer;
- protected int lastDamageByPlayerTime;
+ public int lastDamageByPlayerTime; // Paper - public
protected boolean aX;
protected boolean killed;
protected int ticksFarFromPlayer;
protected float aZ;
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
index c66d8b68f0..774e4d6414 100644
index 9c48bb3c9..22cea8552 100644
--- a/src/main/java/net/minecraft/server/EntityLlama.java
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
@@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
@ -93,7 +93,7 @@ index c66d8b68f0..774e4d6414 100644
return this.bQ != null;
}
diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java
index acc099e955..339c78eec9 100644
index acc099e95..339c78eec 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoal.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoal.java
@@ -0,0 +0,0 @@ public abstract class PathfinderGoal {
@ -107,7 +107,7 @@ index acc099e955..339c78eec9 100644
public void e() {
}
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
index 9a75cb63ba..cf10605aaa 100644
index 9a75cb63b..cf10605aa 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
@@ -0,0 +0,0 @@
@ -148,7 +148,7 @@ index 9a75cb63ba..cf10605aaa 100644
}
}
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
index be3a3c82ee..1404b629d5 100644
index ae21eb84d..8f35f71f8 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@ -187,7 +187,7 @@ index be3a3c82ee..1404b629d5 100644
Iterator iterator = this.b.iterator();
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 09df00e94b..d08ef3fe10 100644
index 09df00e94..d08ef3fe1 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -0,0 +0,0 @@ package org.spigotmc;
@ -385,7 +385,7 @@ index 09df00e94b..d08ef3fe10 100644
{
isActive = false;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 87bc8e2d9c..06d84a0b66 100644
index 87bc8e2d9..06d84a0b6 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class SpigotWorldConfig

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
Add -Ddebug.entities=true to your JVM flags to gain more information
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 173712659..a402f71a9 100644
index 9f1610326..1581edc4a 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -18,7 +18,7 @@ index 173712659..a402f71a9 100644
if (bukkitEntity == null) {
bukkitEntity = CraftEntity.getEntity(world.getServer(), this);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 980f373b1..29c3a24f2 100644
index 7711b2eff..67ef109a5 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -30,7 +30,7 @@ index 980f373b1..29c3a24f2 100644
public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a07077397..0bb903aab 100644
index 45851cd0c..f37e85eb0 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityZapEvent
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
index d299e1efb..30306256a 100644
index 7ef67350a..9dc2d8be2 100644
--- a/src/main/java/net/minecraft/server/EntityPig.java
+++ b/src/main/java/net/minecraft/server/EntityPig.java
@@ -0,0 +0,0 @@ public class EntityPig extends EntityAnimal {
@ -22,7 +22,7 @@ index d299e1efb..30306256a 100644
if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) {
return;
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 36ca76bc8..928c5eb41 100644
index d2572b3e1..ddf170180 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
@ -39,7 +39,7 @@ index 36ca76bc8..928c5eb41 100644
entitywitch.prepare(this.world.getDamageScaler(new BlockPosition(entitywitch)), (GroupDataEntity) null, (NBTTagCompound) null);
entitywitch.setNoAI(this.isNoAI());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c2b24f99f..1b82f22f8 100644
index 35992c4ba..075e6f04e 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
index 3c5785733..8332d5cc8 100644
index 60cb6f583..7a48719c9 100644
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster {

View file

@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent
is undefined.
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 4df31c828..78ea9ad18 100644
index 95d34fbfe..d20545bad 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
@ -50,7 +50,7 @@ index 4df31c828..78ea9ad18 100644
private SecretKey loginKey;
private EntityPlayer l;
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 2f887932b..1e5dfd3f7 100644
index 065bede4c..21e92b921 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -0,0 +0,0 @@ import io.netty.handler.timeout.TimeoutException;
@ -64,14 +64,14 @@ index 2f887932b..1e5dfd3f7 100644
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0]));
}
this.i.clear(); // Free up packet queue.
this.packetQueue.clear(); // Free up packet queue.
+ // Paper start - Add PlayerConnectionCloseEvent
+ final PacketListener packetListener = this.i();
+ if (packetListener instanceof PlayerConnection) {
+ /* Player was logged in */
+ final PlayerConnection playerConnection = (PlayerConnection) packetListener;
+ new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(playerConnection.player.uniqueID,
+ playerConnection.player.getName(), ((java.net.InetSocketAddress)l).getAddress(), false).callEvent();
+ playerConnection.player.getName(), ((java.net.InetSocketAddress)socketAddress).getAddress(), false).callEvent();
+ } else if (packetListener instanceof LoginListener) {
+ /* Player is login stage */
+ final LoginListener loginListener = (LoginListener) packetListener;
@ -81,7 +81,7 @@ index 2f887932b..1e5dfd3f7 100644
+ case ACCEPTED:
+ final com.mojang.authlib.GameProfile profile = loginListener.getGameProfile(); /* Should be non-null at this stage */
+ new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(profile.getId(), profile.getName(),
+ ((java.net.InetSocketAddress)l).getAddress(), false).callEvent();
+ ((java.net.InetSocketAddress)socketAddress).getAddress(), false).callEvent();
+ }
+ }
+ // Paper end

View file

@ -46,7 +46,7 @@ index 3e3619d79..58cc4824c 100644
this.a(movingobjectposition);
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index ddd77583c..84a9375db 100644
index cffb40efb..45a326779 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
@ -87,7 +87,7 @@ index 11638221b..431afaf2f 100644
if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.getBlockPosition()).getBlock() == Blocks.NETHER_PORTAL) {
this.e(movingobjectposition.getBlockPosition());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index af61d99bc..8d12155c3 100644
index 2a06cbf85..464c5cfc9 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

View file

@ -127,7 +127,7 @@ index 000000000..fdd8708f9
+ }
+}
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 58a2f3d28..4df31c828 100644
index 64d2b8aec..95d34fbfe 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
@ -203,18 +203,18 @@ index 58a2f3d28..4df31c828 100644
}
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index b2afec5e4..97a9dffe6 100644
index e5cc77c6d..120416b30 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
private final Queue<NetworkManager.QueuedPacket> packetQueue = Queues.newConcurrentLinkedQueue(); private final Queue<NetworkManager.QueuedPacket> getPacketQueue() { return this.packetQueue; } // Paper - OBFHELPER
private final ReentrantReadWriteLock j = new ReentrantReadWriteLock();
public Channel channel;
// Spigot Start // PAIL
- public SocketAddress l;
+ public SocketAddress l; public void setSpoofedRemoteAddress(SocketAddress address) { this.l = address; } // Paper - OBFHELPER
- public SocketAddress socketAddress;
+ public SocketAddress socketAddress; public void setSpoofedRemoteAddress(SocketAddress address) { this.socketAddress = address; } // Paper - OBFHELPER
// Spigot Start
public java.util.UUID spoofedUUID;
public com.mojang.authlib.properties.Property[] spoofedProfile;
public boolean preparing = true;
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
index b95836d44..621aad150 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 37bea8dbe..eca041265 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.a(blockposition, i, this.world.o().g());
}
diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index f5c56de0c..9b972e65d 100644
--- a/src/main/java/net/minecraft/server/IWorldReader.java
+++ b/src/main/java/net/minecraft/server/IWorldReader.java
@@ -0,0 +0,0 @@ public interface IWorldReader extends IBlockAccess {
@ -54,7 +54,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
};
Stream stream = StreamSupport.stream(BlockPosition.MutableBlockPosition.b(i, k, i1, j - 1, l - 1, j1 - 1).spliterator(), false).map((blockposition$mutableblockposition) -> {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 0e70a3d68..4093d3486 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc

View file

@ -24,7 +24,7 @@ index 973ea8bca..7c7d5595a 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
index af6c744ad..7bea86f52 100644
index 1100073f3..598621fbb 100644
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
@@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce {
@ -35,18 +35,18 @@ index af6c744ad..7bea86f52 100644
if ((random.nextInt(3) == 0 || this.a(world, blockposition, 4)) && world.getLightLevel(blockposition) > 11 - iblockdata.get(a) - iblockdata.b(world, blockposition) && this.c(iblockdata, world, blockposition)) {
try (BlockPosition.b blockposition$b = BlockPosition.b.r()) {
for(EnumDirection enumdirection : EnumDirection.values()) {
blockposition$b.j(blockposition).d(enumdirection);
blockposition$b.g(blockposition).c(enumdirection);
IBlockData iblockdata1 = world.getType(blockposition$b);
if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition$b)) {
- world.J().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40));
+ world.J().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
- world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40));
+ world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
}
}
}
} else {
- world.J().a(blockposition, this, MathHelper.nextInt(random, 20, 40));
+ world.J().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
- world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, 20, 40));
+ world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
}
}

View file

@ -20,7 +20,7 @@ index 9f8b43d2a..3f59e060b 100644
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 5ec283f5d..ba702591a 100644
index 84c0a14ec..457dec91a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -49,7 +49,7 @@ index 000000000..f699ce18c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index bc7ffbf8a..64342f54c 100644
index c5d562dca..37bea8dbe 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@
@ -119,7 +119,7 @@ index 6a9b9fa2a..557aa5180 100644
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 399eb231d..6a59e798d 100644
index 95120be5d..5977d3b48 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -0,0 +0,0 @@
@ -146,7 +146,7 @@ index 399eb231d..6a59e798d 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index f991fddf7..e888c9bdb 100644
index 66fe6ff86..06417b9ec 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@
@ -165,7 +165,7 @@ index f991fddf7..e888c9bdb 100644
}
@@ -0,0 +0,0 @@ public class RegionFile {
this.b(i, j, (int)(SystemUtils.d() / 1000L));
this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L));
} catch (IOException ioexception) {
ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception); // Paper
@ -173,7 +173,7 @@ index f991fddf7..e888c9bdb 100644
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index d18921271..e5115863e 100644
index c5ca89691..e507a996f 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -0,0 +0,0 @@
@ -240,7 +240,7 @@ index e649d662a..560edb523 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3ecddf0fd..20ab0d420 100644
index a9239ee7b..0e70a3d68 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@
@ -265,7 +265,7 @@ index 3ecddf0fd..20ab0d420 100644
continue;
// Paper end
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.e();
this.methodProfiler.exit();
} catch (Throwable throwable2) {
// Paper start - Prevent tile entity and entity crashes
- System.err.println("TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ());
@ -277,16 +277,16 @@ index 3ecddf0fd..20ab0d420 100644
this.tileEntityListTick.remove(tileTickPosition--);
continue;
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index b21f7073f..882b8fe4f 100644
index f0a826cd1..2dee02669 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -0,0 +0,0 @@ public class WorldPersistentData {
nbttagcompound = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i);
} catch (Throwable throwable1) {
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable1); // Paper
throwable = throwable1;
throw throwable1;
int j = nbttagcompound.hasKeyOfType("DataVersion", 99) ? nbttagcompound.getInt("DataVersion") : 1343;
nbttagcompound1 = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound, j, i);
} catch (Throwable throwable2) {
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable2); // Paper
throwable = throwable2;
throw throwable2;
} finally {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 311c4f5ca..e76882b8e 100644

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
index 72d841af06..6aabdc2974 100644
index 8f2289f4e..93ca93b64 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {
@ -29,7 +29,7 @@ index 72d841af06..6aabdc2974 100644
+ }
+
+ packethandshakinginsetprotocol.hostname = event.getServerHostname();
+ this.b.l = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort());
+ this.b.socketAddress = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort());
+ this.b.spoofedUUID = event.getUniqueId();
+ this.b.spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class);
+ handledByEvent = true; // Hooray, we did it!

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index 896388c41..7361d4c05 100644
index f334ad88d..e3c77839b 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -0,0 +0,0 @@
@ -75,7 +75,7 @@ index 896388c41..7361d4c05 100644
}
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
super.k();
super.movementTick();
}
+ // Paper start

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add more Zombie API
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 2d87dca68..4c0ef6e28 100644
index f25bcfd8f..72ea3ba76 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
@ -13,9 +13,9 @@ index 2d87dca68..4c0ef6e28 100644
private static final DataWatcherObject<Boolean> bC = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Integer> bD = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
- private static final DataWatcherObject<Boolean> bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
- private static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
- public static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); // PAIL
+ private static final DataWatcherObject<Boolean> bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> armsRaised = bE; // Paper - OBFHELPER
+ private static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> drowning = bF; // Paper - OBFHELPER
+ public static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> drowning = bF; // Paper - OBFHELPER
private final PathfinderGoalBreakDoor bG;
private boolean bH;
private int bI;
@ -51,11 +51,11 @@ index 2d87dca68..4c0ef6e28 100644
return this.bH;
}
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
super.k();
super.movementTick();
}
+ public void startDrowning(int drownedConversionTime) { a(drownedConversionTime); } // Paper - OBFHELPER
private void a(int i) {
public void a(int i) { // PAIL
this.drownedConversionTime = i;
this.getDataWatcher().set(EntityZombie.bF, true);
}
@ -111,12 +111,12 @@ index 2d87dca68..4c0ef6e28 100644
public void b(EntityLiving entityliving) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
index d2c3dbe48..43d4470d9 100644
index 7af4ea9f8..4d4c50212 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
@@ -0,0 +0,0 @@ public class CraftZombie extends CraftMonster implements Zombie {
public Villager.Profession getVillagerProfession() {
return null;
getHandle().a(time);
}
}
+
+ // Paper start

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add player view distance API
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 6b58f632bd..d245502286 100644
index 1aec6d7c3..1185769ca 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
@ -25,7 +25,7 @@ index 6b58f632bd..d245502286 100644
// CraftBukkit start
public boolean fauxSleeping;
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index 70c9b1f50c..0ea6392284 100644
index d7f33bd53..63e22bd9a 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -0,0 +0,0 @@ public class EntityTracker {
@ -37,7 +37,7 @@ index 70c9b1f50c..0ea6392284 100644
Iterator iterator = this.c.iterator();
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 8478a81f5c..5dbd493f41 100644
index 6a622f72e..4272d2036 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
@ -50,7 +50,7 @@ index 8478a81f5c..5dbd493f41 100644
return d0 >= (double) (-i) && d0 <= (double) i && d1 >= (double) (-i) && d1 <= (double) i && this.tracker.a(entityplayer);
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 12a8fec29a..7ca85a56ca 100644
index 29e24940f..653031af4 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
@ -221,7 +221,7 @@ index 12a8fec29a..7ca85a56ca 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 601d4c62d4..b919226bbf 100644
index ff564508f..4233b94a1 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
@ -234,7 +234,7 @@ index 601d4c62d4..b919226bbf 100644
for (int i1 = -b0; i1 <= b0; ++i1) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6635f1a4a3..d2ff18cf77 100644
index 6635f1a4a..d2ff18cf7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -255,7 +255,7 @@ index 6635f1a4a3..d2ff18cf77 100644
@Override
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index a95f93eb76..09df00e94b 100644
index a95f93eb7..09df00e94 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -0,0 +0,0 @@ public class ActivationRange

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add setting for proxy online mode status
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index c4d12c315..1c1ef2dc2 100644
index e10055b7d..2ae623e7d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -0,0 +0,0 @@ import org.bukkit.configuration.InvalidConfigurationException;
@ -31,7 +31,7 @@ index c4d12c315..1c1ef2dc2 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 58d971cf2..658f7be0d 100644
index 5977d3b48..c3f3ae03a 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -0,0 +0,0 @@ public class NameReferencingFileConverter {
@ -45,7 +45,7 @@ index 58d971cf2..658f7be0d 100644
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b79f75bb0..b9eaaae29 100644
index c655d51ac..f90b708e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -9,13 +9,13 @@ This should hopefully avoid duplicate entities ever being created
if the entity was to end up in 2 different chunk slices
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 382e46adb..a62d7196b 100644
index f7990fbdb..4f01140e7 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
entity.ae = this.locX;
entity.af = k;
entity.ag = this.locZ;
entity.chunkX = this.locX;
entity.chunkY = k;
entity.chunkZ = this.locZ;
- this.entitySlices[k].add(entity);
+
// Paper start
@ -73,7 +73,7 @@ index 382e46adb..a62d7196b 100644
// Do not pass along players, as doing so can get them stuck outside of time.
// (which for example disables inventory icon updates and prevents block breaking)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f13fa7fff..715ab15e3 100644
index fe0590dea..469dce5df 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
index e0a38b32a..2f6fd88ca 100644
index 808d1a120..3030dd9c3 100644
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
@@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity {
@ -18,7 +18,7 @@ index e0a38b32a..2f6fd88ca 100644
this.die();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 1b82f22f8..af61d99bc 100644
index 075e6f04e..2a06cbf85 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ import org.bukkit.entity.Player;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b9eaaae29..67dd3b908 100644
index f90b708e4..84c0a14ec 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index bbd8969db..90177b72c 100644
index bcd8ba4ad..70c3cde24 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -8,7 +8,7 @@ which can keep them in the chunk when they shouldnt be if done
during entity ticking.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 811311e9e..1d7188b2e 100644
index 78e85aacf..f5f1452b7 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -17,8 +17,8 @@ index 811311e9e..1d7188b2e 100644
- if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking
+ // if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - move down
int i = entity.ae;
int j = entity.ag;
int i = entity.chunkX;
int j = entity.chunkZ;
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.getChunkAt(i, j).b(entity);

View file

@ -1049,7 +1049,7 @@ index 000000000..37093419c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 836aea6c3..44d59d253 100644
index 57e35564a..890715ff8 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -1071,7 +1071,7 @@ index 836aea6c3..44d59d253 100644
this.initLighting();
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index f734b85e0..26a3f28cb 100644
index 41a7103ef..c12db3cfa 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@ -1271,7 +1271,7 @@ index 6e7454b13..71a3636be 100644
int jx = along.length * 64 / 4096;
if (this.h == this.b) {
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index f8facddb4..b2afec5e4 100644
index e75b1a76e..e5cc77c6d 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
@ -1296,15 +1296,15 @@ index f8facddb4..b2afec5e4 100644
+ private boolean o() { // void -> boolean
if (this.channel != null && this.channel.isOpen()) {
- this.j.readLock().lock();
+ if (this.i.isEmpty()) { // return if the packet queue is empty so that the write lock by Anti-Xray doesn't affect the vanilla performance at all
+ if (this.packetQueue.isEmpty()) { // return if the packet queue is empty so that the write lock by Anti-Xray doesn't affect the vanilla performance at all
+ return true;
+ }
+
+ this.j.writeLock().lock(); // readLock -> writeLock (because of race condition between peek and poll)
try {
while (!this.i.isEmpty()) {
- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.i.poll();
while (!this.packetQueue.isEmpty()) {
- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.packetQueue.poll();
-
- this.b(networkmanager_queuedpacket.a, networkmanager_queuedpacket.b);
+ NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.getPacketQueue().peek(); // poll -> peek
@ -1418,7 +1418,7 @@ index 22a262bb6..40ec398ee 100644
if (flag) {
packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes());
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 4383abccd..068d203c8 100644
index db43a8a9a..b58683e6f 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -0,0 +0,0 @@ public class PlayerChunk {
@ -1435,7 +1435,7 @@ index 4383abccd..068d203c8 100644
public void sendChunk(EntityPlayer entityplayer) {
if (this.done) {
+ this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, '\uffff', true); // Paper - Anti-Xray - Load nearby chunks if necessary
entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, '\uffff'));
entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, 65535));
this.playerChunkMap.getWorld().getTracker().a(entityplayer, this.chunk);
}
@@ -0,0 +0,0 @@ public class PlayerChunk {
@ -1445,9 +1445,9 @@ index 4383abccd..068d203c8 100644
+ // Paper - Anti-Xray - Loading chunks here could cause a ConcurrentModificationException #1104
+ // Paper - Anti-Xray - TODO: Check if this is still the case for 1.13
+ //this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, this.h, true); // Paper - Anti-Xray - Load nearby chunks if necessary
this.a((Packet) (new PacketPlayOutMapChunk(this.chunk, this.h)));
this.a(new PacketPlayOutMapChunk(this.chunk, this.h));
} else {
this.a((Packet) (new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk)));
this.a(new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk));
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index 23223e89d..23fc4d8e1 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
@ -1462,7 +1462,7 @@ index 23223e89d..23fc4d8e1 100644
public void a(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
index b88d41d67..025160679 100644
index faaad0f41..9fd966dfb 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
@@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess {
@ -1510,7 +1510,7 @@ index b88d41d67..025160679 100644
if (enumskyblock == EnumSkyBlock.SKY) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0d401bf1d..de591d912 100644
index 780c0a7e8..67b20c056 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@

View file

@ -458,7 +458,7 @@ index 000000000..8f18c2869
+
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 44d59d253..0bd975b6d 100644
index 890715ff8..654cf763b 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -470,13 +470,13 @@ index 44d59d253..0bd975b6d 100644
Iterator iterator = protochunk.s().iterator();
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
index e14ae2b42..1662e4eba 100644
index 2021c0d02..154ab09e0 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
}
public Chunk a(long i, Chunk chunk) {
public Chunk put(long i, Chunk chunk) {
+ org.spigotmc.AsyncCatcher.catchOp("Async Chunk put"); // Paper
chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper
lastChunkByPos = chunk; // Paper
@ -507,12 +507,12 @@ index e14ae2b42..1662e4eba 100644
@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
}
public Chunk a(Long olong, Chunk chunk) {
- return this.a(olong, chunk);
+ return MCUtil.ensureMain("Chunk Put", () -> this.a(olong.longValue(), chunk)); // Paper
public Chunk put(Long olong, Chunk chunk) {
- return this.put(olong, chunk);
+ return MCUtil.ensureMain("Chunk Put", () -> this.put(olong.longValue(), chunk)); // Paper
}
public Chunk a(long i) {
public Chunk remove(long i) {
- Chunk chunk = (Chunk) super.remove(i);
+ // Paper start
+ org.spigotmc.AsyncCatcher.catchOp("Async Chunk remove");
@ -555,28 +555,14 @@ index e14ae2b42..1662e4eba 100644
}
// Paper end
public Chunk a(Object object) {
- return this.a((Long) object);
+ return MCUtil.ensureMain("Chunk Remove", () -> this.a(((Long) object).longValue())); // Paper
public Chunk remove(Object object) {
- return this.remove((Long) object);
+ return MCUtil.ensureMain("Chunk Remove", () -> this.remove(((Long) object).longValue())); // Paper
}
public void putAll(Map<? extends Long, ? extends Chunk> map) {
@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
// CraftBukkit start - decompile errors
public Chunk remove(long i) {
- return this.a(i);
+ return MCUtil.ensureMain("Chunk Remove", () -> this.a(i)); // Paper
}
public Chunk put(long i, Chunk object) {
- return this.a(i, (Chunk) object);
+ return MCUtil.ensureMain("Chunk Put", () -> this.a(i, (Chunk) object)); // Paper
}
public Chunk remove(Object object) {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index dcc6e9762..87a1bddd0 100644
index b9f8a86aa..4fe173cfb 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@ -726,7 +712,7 @@ index dcc6e9762..87a1bddd0 100644
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 26a3f28cb..5ce57a6d4 100644
index c12db3cfa..6cacacb0b 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@ -944,7 +930,7 @@ index 271dc41d4..bd15534c2 100644
private final MinecraftServer d;
private final java.nio.file.Path e;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 522af3d53..ee878191a 100644
index ef5a21505..93171edb4 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -982,7 +968,7 @@ index 49fba0979..9ad646f8d 100644
fx = fx % 360.0F;
if (fx >= 180.0F) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c73a61d94..17ae26cb8 100644
index 63b5cdd41..32aee07d1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -998,7 +984,7 @@ index c73a61d94..17ae26cb8 100644
BlockPosition blockposition = worldserver.getSpawn();
- ArrayList arraylist = Lists.newArrayList();
+ List<ChunkCoordIntPair> arraylist = worldserver.getChunkProviderServer().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper
+ List<ChunkCoordIntPair> arraylist = worldserver.getChunkProvider().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper
Set set = Sets.newConcurrentHashSet();
- // Paper start
@ -1014,8 +1000,8 @@ index c73a61d94..17ae26cb8 100644
int expected = arraylist.size(); // Paper
- CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> {
+ CompletableFuture completablefuture = worldserver.getChunkProviderServer().loadAllChunks(arraylist, (chunk) -> { // Paper
- CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> {
+ CompletableFuture completablefuture = worldserver.getChunkProvider().loadAllChunks((Iterable) arraylist, (chunk) -> { // Paper
set.add(chunk.getPos());
- if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper
+ if (waitForChunks && (set.size() == expected || (set.size() < expected && set.size() % (set.size() / 10) == 0))) {
@ -1061,14 +1047,14 @@ index c73a61d94..17ae26cb8 100644
+ PaperAsyncChunkProvider.processMainThreadQueue(this); // Paper
MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper
this.methodProfiler.c("commandFunctions");
this.methodProfiler.exitEnter("commandFunctions");
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
// CraftBukkit - dropTickTime
for (Iterator iterator = this.getWorlds().iterator(); iterator.hasNext();) {
WorldServer worldserver = (WorldServer) iterator.next();
+ PaperAsyncChunkProvider.processMainThreadQueue(worldserver); // Paper
TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
i = SystemUtils.c();
i = SystemUtils.getMonotonicNanos();
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java b/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java
new file mode 100644
@ -1732,20 +1718,15 @@ index 000000000..e9a38f9d9
+
+}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 068d203c8..cbff0d946 100644
index b58683e6f..e61538b3c 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -0,0 +0,0 @@ public class PlayerChunk {
// You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse
// All may seem good at first, but there's deeper issues if you play for a bit
private long i;
private boolean done;
boolean chunkExists; // Paper
- private boolean loadInProgress = false;
- private Runnable loadedRunnable = new Runnable() {
- public void run() {
- loadInProgress = false;
- PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true);
+ PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest;
+ // Paper start
+ PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest;
+ private java.util.function.Consumer<Chunk> chunkLoadedConsumer = chunk -> {
+ chunkRequest = null;
+ PlayerChunk pChunk = PlayerChunk.this;
@ -1766,18 +1747,17 @@ index 068d203c8..cbff0d946 100644
+ }
+
+ markedHigh = true;
+ playerChunkMap.getWorld().getChunkProviderServer().bumpPriority(location);
+ playerChunkMap.getWorld().getChunkProvider().bumpPriority(location);
+ if (chunkRequest == null) {
+ requestChunkIfNeeded(PlayerChunkMap.CAN_GEN_CHUNKS.test(player));
+ }
+ }
+ private void requestChunkIfNeeded(boolean flag) {
+ if (chunkRequest == null) {
+ chunkRequest = this.playerChunkMap.getWorld().getChunkProviderServer().requestChunk(this.location.x, this.location.z, flag, markedHigh, chunkLoadedConsumer);
+ chunkRequest = this.playerChunkMap.getWorld().getChunkProvider().requestChunk(this.location.x, this.location.z, flag, markedHigh, chunkLoadedConsumer);
+ this.chunk = chunkRequest.getChunk(); // Paper)
markChunkUsed(); // Paper - delay chunk unloads
}
- };
+ markChunkUsed(); // Paper - delay chunk unloads
+ }
+ }
+ private double getDistance(EntityPlayer player, int inFront) {
+ final float yaw = MathHelper.normalizeYaw(player.yaw);
@ -1791,8 +1771,20 @@ index 068d203c8..cbff0d946 100644
+ final double z = location.z - ((int)Math.floor(blockZ) >> 4);
+ return Math.sqrt((x * x) + (z * z));
+ }
+ // Paper end
// Paper start - delay chunk unloads
public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) {
this.playerChunkMap = playerchunkmap;
this.location = new ChunkCoordIntPair(ix, j);
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider();
chunkproviderserver.a(ix, j);
- this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false);
- this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper
+ this.chunk = chunkproviderserver.getChunkAt(ix, j, false, false); // Paper
+ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(ix, j); // Paper
markChunkUsed(); // Paper - delay chunk unloads
}
// Paper start
private void markChunkUsed() {
+ if (!chunkHasPlayers && chunkRequest != null) {
+ chunkRequest.cancel();
@ -1802,18 +1794,7 @@ index 068d203c8..cbff0d946 100644
return;
}
@@ -0,0 +0,0 @@ public class PlayerChunk {
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProviderServer();
chunkproviderserver.a(i, j);
- this.chunk = chunkproviderserver.getChunkAt(i, j, true, false);
- this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper
+ this.chunk = chunkproviderserver.getChunkAt(i, j, false, false); // Paper
+ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(i, j); // Paper
markChunkUsed(); // Paper - delay chunk unloads
}
@@ -0,0 +0,0 @@ public class PlayerChunk {
this.c.add(entityplayer);
this.players.add(entityplayer);
if (this.done) {
this.sendChunk(entityplayer);
- }
@ -1825,7 +1806,7 @@ index 068d203c8..cbff0d946 100644
if (this.chunk != null) {
return true;
} else {
- this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag);
- this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag);
- markChunkUsed(); // Paper - delay chunk unloads
+ // Paper start - async chunks
+ requestChunkIfNeeded(flag);
@ -1834,7 +1815,7 @@ index 068d203c8..cbff0d946 100644
}
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 39e5b2484..a92557fd2 100644
index 27343174d..77b36ff89 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
@ -1894,7 +1875,7 @@ index 39e5b2484..a92557fd2 100644
private void e() {
diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
index 38f3afb48..ddd7b91a9 100644
index d0b3e43c0..eb7f03898 100644
--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
+++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccess {
@ -1962,7 +1943,7 @@ index d868149d1..0d45d933e 100644
}
}
diff --git a/src/main/java/net/minecraft/server/StructurePiece.java b/src/main/java/net/minecraft/server/StructurePiece.java
index d444eb30f..d8c96b5c3 100644
index 510543db4..ce9e5d4e0 100644
--- a/src/main/java/net/minecraft/server/StructurePiece.java
+++ b/src/main/java/net/minecraft/server/StructurePiece.java
@@ -0,0 +0,0 @@ public abstract class StructurePiece {
@ -2038,7 +2019,7 @@ index 1926c902a..1117e4ae2 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index eabf50e24..f8afa6f72 100644
index 72bb3f862..d736ac63d 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@ -2132,8 +2113,8 @@ index eabf50e24..f8afa6f72 100644
+ }
+ // Paper end
org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot
if (entity == null) return false;
if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java
index fa99fe014..4f49786aa 100644
--- a/src/main/java/net/minecraft/server/WorldGenStronghold.java
@ -2282,7 +2263,7 @@ index fa99fe014..4f49786aa 100644
}
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index bab0c0e0f..af68074c1 100644
index b355c3f53..27c8a97be 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@ -2295,7 +2276,7 @@ index bab0c0e0f..af68074c1 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 07f6580fd..c79baa922 100644
index a0f255ff1..eb4b3c7a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
@ -2305,7 +2286,7 @@ index 07f6580fd..c79baa922 100644
- for (int j = -short1; j <= short1; j += 16) {
- for (int k = -short1; k <= short1; k += 16) {
+ // Paper start
+ for (ChunkCoordIntPair coords : internal.getChunkProviderServer().getSpiralOutChunks(internal.getSpawn(), short1 >> 4)) {{
+ for (ChunkCoordIntPair coords : internal.getChunkProvider().getSpiralOutChunks(internal.getSpawn(), short1 >> 4)) {{
+ int j = coords.x;
+ int k = coords.z;
+ // Paper end
@ -2317,13 +2298,13 @@ index 07f6580fd..c79baa922 100644
}
BlockPosition chunkcoordinates = internal.getSpawn();
- internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true);
+ internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true, c -> {}); // Paper
- internal.getChunkProvider().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true);
+ internal.getChunkProvider().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true, c -> {}); // Paper
}
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 7e6a7b0e9..ef5a7bc38 100644
index 5552b64fb..c6d033928 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
@ -2333,7 +2314,7 @@ index 7e6a7b0e9..ef5a7bc38 100644
+ // Paper start - Async chunk load API
+ @Override
+ public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final int x, final int z, final boolean gen) {
+ final ChunkProviderServer cps = this.world.getChunkProviderServer();
+ final ChunkProviderServer cps = this.world.getChunkProvider();
+ java.util.concurrent.CompletableFuture<Chunk> future = new java.util.concurrent.CompletableFuture<>();
+ cps.getChunkAt(x, z, true, gen, chunk -> future.complete(chunk != null ? chunk.bukkitChunk : null));
+ return future;
@ -2341,7 +2322,7 @@ index 7e6a7b0e9..ef5a7bc38 100644
+ // Paper end
+
public Chunk getChunkAt(int x, int z) {
return this.world.getChunkProviderServer().getChunkAt(x, z, true, true).bukkitChunk;
return this.world.getChunkProvider().getChunkAt(x, z, true, true).bukkitChunk;
}
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
int chunkCoordZ = chunkcoordinates.getZ() >> 4;
@ -2350,7 +2331,7 @@ index 7e6a7b0e9..ef5a7bc38 100644
- for (int x = -radius; x <= radius; x++) { // Paper
- for (int z = -radius; z <= radius; z++) { // Paper
+ // Paper start
+ for (ChunkCoordIntPair coords : world.getChunkProviderServer().getSpiralOutChunks(world.getSpawn(), radius)) {{
+ for (ChunkCoordIntPair coords : world.getChunkProvider().getSpiralOutChunks(world.getSpawn(), radius)) {{
+ int x = coords.x;
+ int z = coords.z;
+ // Paper end
@ -2361,7 +2342,7 @@ index 7e6a7b0e9..ef5a7bc38 100644
if (isChunkLoaded(chunkCoordX + x, chunkCoordZ + z)) {
unloadChunk(chunkCoordX + x, chunkCoordZ + z);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4a0a456a0..4068b8072 100644
index f87d2bed7..603f43b7e 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {
@ -2423,7 +2404,7 @@ index 4a0a456a0..4068b8072 100644
if (!event.isCancelled()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
index 04e29f58c..5fae0c6ad 100644
index 9c917370a..a299092a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
@@ -0,0 +0,0 @@ public class CustomChunkGenerator extends InternalChunkGenerator<GeneratorSettin

View file

@ -14,7 +14,7 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 870b59ce1..371513042 100644
index 921e1ec9e..f74e642b8 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -68,7 +68,7 @@ index 870b59ce1..371513042 100644
public void a(PacketPlayInSetCommandBlock packetplayinsetcommandblock) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 72da1fe81..07364554a 100644
index b5d0886df..054d3f3dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -64,7 +64,7 @@ index d8f258105..47bfb5b62 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 2a9bfd7af..2af8a582b 100644
index 86bdd6e7f..1a8317256 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -109,7 +109,7 @@ index 516a583a8..27bed54d2 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 3e4c80e0f..8506fad6f 100644
index 77c23884f..52dc6d83b 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -121,7 +121,7 @@ index 3e4c80e0f..8506fad6f 100644
public final MinecraftServer server;
public final PlayerInteractManager playerInteractManager;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index bdf4aed1a..acdfb0e1e 100644
index edf72fbec..dacb372a5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -137,8 +137,8 @@ index bdf4aed1a..acdfb0e1e 100644
}
- if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
this.methodProfiler.a("save");
- this.s.savePlayers();
this.methodProfiler.enter("save");
- this.playerList.savePlayers();
+
+ serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper
+ int playerSaveInterval = com.destroystokyo.paper.PaperConfig.playerAutoSaveRate;
@ -146,7 +146,7 @@ index bdf4aed1a..acdfb0e1e 100644
+ playerSaveInterval = autosavePeriod;
+ }
+ if (playerSaveInterval > 0) { // CraftBukkit // Paper
+ this.s.savePlayers(playerSaveInterval);
+ this.playerList.savePlayers(playerSaveInterval);
// Spigot Start
+ } // Paper - Incremental Auto Saving
+
@ -161,14 +161,14 @@ index bdf4aed1a..acdfb0e1e 100644
server.playerCommandState = false;
// this.saveChunks(true);
// Spigot End
this.methodProfiler.e();
this.methodProfiler.exit();
- }
+ //} // Paper - Incremental Auto Saving
this.methodProfiler.a("snooper");
if (getSnooperEnabled() && !this.i.d() && this.ticks > 100) { // Spigot
this.methodProfiler.enter("snooper");
if (getSnooperEnabled() && !this.snooper.d() && this.ticks > 100) { // Spigot
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 143c7c1be..1259ec9d6 100644
index 3e4ca288d..e28485f18 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {
@ -207,11 +207,11 @@ index 143c7c1be..1259ec9d6 100644
public WhiteList getWhitelist() {
return this.whitelist;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b37b284a5..6a5a7d1e0 100644
index b5983957b..7a765cb7b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
ChunkProviderServer chunkproviderserver = this.getChunkProviderServer();
ChunkProviderServer chunkproviderserver = this.getChunkProvider();
if (chunkproviderserver.d()) {
- org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit

View file

@ -10,7 +10,7 @@ to the object directly on the Entity/TileEntity object we can directly grab.
Use that local value instead to reduce lookups in many hot places.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index aedf31a07..8ff542c88 100644
index 9b88a4190..6c9d7df20 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -19,10 +19,10 @@ index aedf31a07..8ff542c88 100644
+ public void removeEntity(Entity entity) { b(entity); } // Paper - OBFHELPER
public void b(Entity entity) {
this.a(entity, entity.af);
this.a(entity, entity.chunkY);
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a14518ba6..980f373b1 100644
index 0ca1816cb..7711b2eff 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -43,13 +43,13 @@ index a14518ba6..980f373b1 100644
for (Entity e : this.g) {
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.e();
this.methodProfiler.a("remove");
this.methodProfiler.exit();
this.methodProfiler.enter("remove");
if (entity.dead) {
+ // Paper start
+ /*
j = entity.ae;
int l = entity.ag;
j = entity.chunkX;
int l = entity.chunkZ;
if (entity.inChunk && this.isChunkLoaded(j, l, true)) {
this.getChunkAt(j, l).b(entity);

View file

@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
Combined, this adds up a lot.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 87ec4d1a2..c5d562dca 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -29,7 +29,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public boolean areNeighborsLoaded(final int radius) {
switch (radius) {
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
entity.ag = this.locZ;
entity.chunkZ = this.locZ;
this.entitySlices[k].add(entity);
// Paper start
+ if (entity instanceof EntityItem) {
@ -88,7 +88,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 7b7fd6b9b..eb08a1caa 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -0,0 +0,0 @@ public final class IEntitySelector {

View file

@ -429,7 +429,7 @@ index e1af5c488..0ef5ad116 100644
* Calculates distance between 2 entities
* @param e1
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ce1805062..34ba382a4 100644
index 9c95661a7..906bd973d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -450,7 +450,7 @@ index ce1805062..34ba382a4 100644
return this.V;
}
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index a47a51a41..4c476f757 100644
index 7d9edb9a6..355875a98 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -0,0 +0,0 @@ public class UserCache {
@ -486,7 +486,7 @@ index a47a51a41..4c476f757 100644
private UserCacheEntry(GameProfile gameprofile, Date date) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 873170864..72da1fe81 100644
index e08da05d4..b5d0886df 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ import org.bukkit.event.server.ServerLoadEvent;

View file

@ -5,13 +5,13 @@ Subject: [PATCH] Block player logins during server shutdown
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index bb08200e7..90d1096e5 100644
index 9f6b73d80..af5c699fe 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
}
public void Y_() {
public void tick() {
+ // Paper start - Do not allow logins while the server is shutting down
+ if (!MinecraftServer.getServer().isRunning()) {
+ this.disconnect(new ChatMessage(org.spigotmc.SpigotConfig.restartMessage));

View file

@ -45,7 +45,7 @@ index f0b87972d..a92914576 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e204dbe21..8e436c7f4 100644
index 16d8a56b1..f2f977fff 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -57,7 +57,7 @@ index e204dbe21..8e436c7f4 100644
private int j;
private final IntHashMap<Short> k = new IntHashMap();
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
this.minecraftServer.methodProfiler.e();
this.minecraftServer.methodProfiler.exit();
// CraftBukkit start
for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ;
+ if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable

View file

@ -133,7 +133,7 @@ index 000000000..a10a5bc13
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index b284524be..80d384dfe 100644
index e9543c06c..c083b2dd3 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -171,7 +171,7 @@ index 72cd9ba58..35205561b 100644
if (l1 <= k) {
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 72e74c59f..e8891d078 100644
index bd6f64e52..67a903a62 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc

View file

@ -84,53 +84,55 @@ index 000000000..74c012fd4
+
+}
diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java
index aafca9c9c..860076fc2 100644
index 976888b66..48e7ae2d5 100644
--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java
+++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java
@@ -0,0 +0,0 @@ import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import com.destroystokyo.paper.network.PaperLegacyStatusClient; // Paper
@@ -0,0 +0,0 @@
package net.minecraft.server;
public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
private static final Logger a = LogManager.getLogger();
+import com.destroystokyo.paper.network.PaperLegacyStatusClient;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFutureListener;
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
InetSocketAddress inetsocketaddress = (InetSocketAddress)channelhandlercontext.channel().remoteAddress();
MinecraftServer minecraftserver = this.b.d();
int i = bytebuf.readableBytes();
+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper
switch(i) {
case 0:
a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- String s2 = String.format("%s\u00a7%d\u00a7%d", minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z());
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null);
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ String s2 = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers());
+ // Paper end
this.a(channelhandlercontext, this.a(s2));
break;
case 1:
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
}
MinecraftServer minecraftserver = this.b.d();
int i = bytebuf.readableBytes();
String s;
- org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit
+ //org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit // Paper
+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper
a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z());
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null);
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
+ // Paper end
this.a(channelhandlercontext, this.a(s));
break;
default:
switch (i) {
case 0:
LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null);
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers());
this.a(channelhandlercontext, this.a(s));
break;
case 1:
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
}
LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit
+ // Paper start - Call PaperServerListPingEvent and use results
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 127, null); // Paper
+ if (event == null) {
+ channelhandlercontext.close();
+ break;
+ }
+ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { event.getProtocolVersion(), minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit
+ // Paper end
this.a(channelhandlercontext, this.a(s));
break;
default:
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
a.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress());
@ -146,7 +148,7 @@ index aafca9c9c..860076fc2 100644
+ }
+
+ String response = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(),
+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
this.a(ctx, this.a(response));
}

View file

@ -5,20 +5,20 @@ Subject: [PATCH] Call player spectator target events
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index d429e552e..6105a4e14 100644
index b5d48e7bf..2679c2358 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private EntityHuman.EnumChatVisibility cs;
private boolean ct = true;
private long cu = SystemUtils.b();
- private Entity cv;
+ private Entity cv; private void setSpectatorTargetField(Entity e) { this.cv = e; } // Paper - OBFHELPER
private long cu = SystemUtils.getMonotonicMillis();
- private Entity spectatedEntity;
+ private Entity spectatedEntity; private void setSpectatorTargetField(Entity e) { this.spectatedEntity = e; } // Paper - OBFHELPER
public boolean worldChangeInvuln;
private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER
private final RecipeBookServer cy;
private final RecipeBookServer recipeBook;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return (Entity) (this.cv == null ? this : this.cv);
return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity);
}
- public void setSpectatorTarget(Entity entity) {
@ -26,10 +26,10 @@ index d429e552e..6105a4e14 100644
+ // Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event
Entity entity1 = this.getSpecatorTarget();
- this.cv = (Entity) (entity == null ? this : entity);
- if (entity1 != this.cv) {
- this.playerConnection.sendPacket(new PacketPlayOutCamera(this.cv));
- this.playerConnection.a(this.cv.locX, this.cv.locY, this.cv.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
- this.spectatedEntity = (Entity) (entity == null ? this : entity);
- if (entity1 != this.spectatedEntity) {
- this.playerConnection.sendPacket(new PacketPlayOutCamera(this.spectatedEntity));
- this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
+ if (newSpectatorTarget == null) {
+ newSpectatorTarget = this;
}
@ -53,9 +53,8 @@ index d429e552e..6105a4e14 100644
+ setSpectatorTargetField(newSpectatorTarget);
+
+ this.playerConnection.sendPacket(new PacketPlayOutCamera(newSpectatorTarget));
+ this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
+ // Paper end
+
+ this.playerConnection.a(this.cv.locX, this.cv.locY, this.cv.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
}
protected void E() {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Catch Async PlayerChunkMap operations
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index fb593529e1..a69d510dd1 100644
index 653031af4..3d17ad646 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Change implementation of (tile)entity removal list
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 352a7f25a7..65e84b666f 100644
index 214adec9b..a9239ee7b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -33,9 +33,9 @@ index 352a7f25a7..65e84b666f 100644
- for (i = 0; i < this.g.size(); ++i) {
- entity = (Entity) this.g.get(i);
- int k = entity.ae;
- int k = entity.chunkX;
-
- j = entity.ag;
- j = entity.chunkZ;
- if (entity.inChunk && this.isChunkLoaded(k, j, true)) {
- this.getChunkAt(k, j).b(entity);
+ if (e.inChunk && this.isChunkLoaded(k, j, true)) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config
diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java
index b4500eead..512c22df9 100644
index 852b9e184..e34b54dc0 100644
--- a/src/main/java/net/minecraft/server/EntityDrowned.java
+++ b/src/main/java/net/minecraft/server/EntityDrowned.java
@@ -0,0 +0,0 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
@ -23,12 +23,9 @@ index b4500eead..512c22df9 100644
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
- return this.a((EntityHuman)object);
+ // Paper start - decompile error
+ public boolean test(@Nullable EntityHuman entityhuman) {
+ return this.a(entityhuman);
+ // Paper end
}
- return this.test((EntityHuman)object);
- }
}
static class c extends PathfinderGoalGotoTarget {
--

View file

@ -6,12 +6,12 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index e888c9bdba..f4405be395 100644
index 06417b9ec..e1c0921ea 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile {
this.b(i, j, (int)(SystemUtils.d() / 1000L));
this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L));
} catch (IOException ioexception) {
- ioexception.printStackTrace();
- ServerInternalException.reportInternalException(ioexception); // Paper
@ -20,7 +20,7 @@ index e888c9bdba..f4405be395 100644
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index e5115863ec..2217adf99c 100644
index e507a996f..5dbd1d517 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -0,0 +0,0 @@ public class RegionFileCache {

View file

@ -8,7 +8,7 @@ Adds a command line flag to enable stats on how chunk saves are processing.
Stats on current queue, how many was processed and how many were queued.
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 917f57ced..570ddc1a8 100644
index 9990cdbcd..b1c4eb4ae 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@ -25,7 +25,7 @@ index 917f57ced..570ddc1a8 100644
private final ChunkTaskScheduler chunkScheduler;
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
// Paper start
final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader;
final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProvider().chunkLoader;
final int queueSize = chunkLoader.getQueueSize();
+
+ final long now = System.currentTimeMillis();
@ -54,7 +54,7 @@ index 917f57ced..570ddc1a8 100644
return false;
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index a2c3c066b..34ddf655e 100644
index f17869d4d..8eecdbd33 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {

View file

@ -8,7 +8,7 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr
Keep them consistent
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a81c7dfa2e..3740cdf95d 100644
index 0d04b14cf..b17a8d60c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -19,5 +19,5 @@ index a81c7dfa2e..3740cdf95d 100644
+ j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior
int k = MathHelper.floor(entity.locZ / 16.0D);
if (!entity.inChunk || entity.ae != i || entity.af != j || entity.ag != k) {
if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) {
--

View file

@ -28,7 +28,7 @@ index 03b7410f5..5c50c62e5 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 928c5eb41..ac81a8d76 100644
index ddf170180..bd799d0c6 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {

View file

@ -30,7 +30,7 @@ index deb4ec254..d2559f7c4 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 6a23b1ec2..d065d88f7 100644
index 66520842d..f470eba29 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {

View file

@ -26,7 +26,7 @@ index b6764c7ec..29cb718fb 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 9d971a9c5..a696be750 100644
index 5935bae58..b1ece38b2 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {

View file

@ -21,7 +21,7 @@ index 058cd8cc8..276dd98fd 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 051608e38..7793626b5 100644
index eef8d2b5a..cc98b745b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -42,7 +42,7 @@ index 051608e38..7793626b5 100644
+ int expected = arraylist.size(); // Paper
+
CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> {
CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> {
set.add(chunk.getPos());
+ if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper
});
@ -63,7 +63,7 @@ index 051608e38..7793626b5 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 481a462f8..e64a95ece 100644
index ceb4102af..02a62d6d7 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -78,7 +78,7 @@ index 481a462f8..e64a95ece 100644
public LongSet ag() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 082e86963..b89c5f4ab 100644
index acd54067e..c655d51ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
@ -91,7 +91,7 @@ index 082e86963..b89c5f4ab 100644
for (int j = -short1; j <= short1; j += 16) {
for (int k = -short1; k <= short1; k += 16) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index a784bf6f6..24e504c27 100644
index 1676fcc85..b19eef1b1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {

View file

@ -33,27 +33,27 @@ index 29cb718fb..695bdf2e6 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 7cb1327a8..4383abccd 100644
index 5497a458d..db43a8a9a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -0,0 +0,0 @@ public class PlayerChunk {
// CraftBukkit start - add fields
// You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse
// All may seem good at first, but there's deeper issues if you play for a bit
private int h;
private long i;
private boolean done;
+ boolean chunkExists; // Paper
private boolean loadInProgress = false;
private Runnable loadedRunnable = new Runnable() {
public void run() {
@@ -0,0 +0,0 @@ public class PlayerChunk {
chunkproviderserver.a(i, j);
this.chunk = chunkproviderserver.getChunkAt(i, j, true, false);
+ this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper
public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) {
this.playerChunkMap = playerchunkmap;
@@ -0,0 +0,0 @@ public class PlayerChunk {
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider();
chunkproviderserver.a(ix, j);
this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false);
+ this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper
markChunkUsed(); // Paper - delay chunk unloads
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index a696be750..39e5b2484 100644
index b1ece38b2..27343174d 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Player Collision
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index b4dba7247..1d32b93c8 100644
index 0778f53e2..30fcf4a72 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -0,0 +0,0 @@ public class PaperConfig {
@ -19,7 +19,7 @@ index b4dba7247..1d32b93c8 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7793626b5..bdd2c4b85 100644
index cc98b745b..d146cc79c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -56,7 +56,7 @@ index f7a9b9d88..7befd80cf 100644
packetdataserializer.a(this.c);
packetdataserializer.a(this.d);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 2cb5869ae..143c7c1be 100644
index 7edca4284..3e4ca288d 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {
@ -74,7 +74,7 @@ index 2cb5869ae..143c7c1be 100644
+ // Paper start - Add to collideRule team if needed
+ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
+ final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName);
+ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getTeam() == null) {
+ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getScoreboardTeam() == null) {
+ scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam);
+ }
+ // Paper end
@ -89,7 +89,7 @@ index 2cb5869ae..143c7c1be 100644
+ if (this.collideRuleTeamName != null) {
+ final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
+ final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName);
+ if (entityplayer.getTeam() == team && team != null) {
+ if (entityplayer.getScoreboardTeam() == team && team != null) {
+ scoreBoard.removePlayerFromTeam(entityplayer.getName(), team);
+ }
+ }

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable end credits
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8f6f0288be..5aee23dceb 100644
index 8f6f0288b..5aee23dce 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -20,16 +20,16 @@ index 8f6f0288be..5aee23dceb 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index e0215bcdb8..cdf89cfed3 100644
index d0d93b1eb..2804bfc0a 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private long cu = SystemUtils.b();
private Entity cv;
private long cu = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
public boolean worldChangeInvuln;
- private boolean cx;
+ private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER
private final RecipeBookServer cy;
private final RecipeBookServer recipeBook;
private Vec3D cz;
private int cA;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {

View file

@ -22,15 +22,15 @@ index 2220a18d9..94c544714 100644
SAFE_REGEN, DELETE, NOTHING, WARN
}
diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java
index 56f26da41..ddf2fc67e 100644
index 80a49900e..f0d5316b6 100644
--- a/src/main/java/net/minecraft/server/BlockFluids.java
+++ b/src/main/java/net/minecraft/server/BlockFluids.java
@@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource {
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) {
if (this.a(world, blockposition, iblockdata)) {
- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
+ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
}
}
@ -53,13 +53,13 @@ index 56f26da41..ddf2fc67e 100644
+
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
if (iblockdata.s().d() || iblockdata1.s().d()) {
generatoraccess.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess));
generatoraccess.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess));
@@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource {
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) {
if (this.a(world, blockposition, iblockdata)) {
- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world));
+ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper
}
}

View file

@ -20,7 +20,7 @@ index 1ed58f4bb..39d565db1 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index c7db9db95..12fe12e04 100644
index cc6ae6634..99716419e 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -40,7 +40,7 @@ index c7db9db95..12fe12e04 100644
if (!this.world.isClientSide) {
this.setFlag(0, this.fireTicks > 0);
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.world.methodProfiler.e();
this.world.methodProfiler.exit();
}
+ // Paper start
@ -63,7 +63,7 @@ index c7db9db95..12fe12e04 100644
this.die();
}
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
index 5bee194fa..b52bc659e 100644
index a2f334968..e741c7f83 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
@@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT

View file

@ -43,7 +43,7 @@ index 42d951554..d8f258105 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d065d88f7..2a9bfd7af 100644
index f470eba29..86bdd6e7f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -55,7 +55,7 @@ index d065d88f7..2a9bfd7af 100644
public final int locZ;
private boolean l;
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
index 2ebb2d834..e14ae2b42 100644
index 8b3738c8f..2021c0d02 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
@ -67,7 +67,7 @@ index 2ebb2d834..e14ae2b42 100644
+ if (chunk.world.paperConfig.delayChunkUnloadsBy > 0) {
+ chunk.scheduledForUnload = System.currentTimeMillis();
+ } else {
+ ((WorldServer) chunk.world).getChunkProviderServer().unload(chunk);
+ ((WorldServer) chunk.world).getChunkProvider().unload(chunk);
+ }
+ }
+ // Paper end
@ -99,17 +99,17 @@ index 1d08ec37f..516a583a8 100644
this.chunkScheduler.a(booleansupplier);
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index c7ea17e25..7cb1327a8 100644
index 1d672eaa1..5497a458d 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -0,0 +0,0 @@ public class PlayerChunk {
public void run() {
loadInProgress = false;
PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true);
+ markChunkUsed(); // Paper - delay chunk unloads
}
};
+ // Paper start - delay chunk unloads
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider();
chunkproviderserver.a(ix, j);
this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false);
+ markChunkUsed(); // Paper - delay chunk unloads
}
+ // Paper start
+ private void markChunkUsed() {
+ if (chunk == null) {
+ return;
@ -122,30 +122,23 @@ index c7ea17e25..7cb1327a8 100644
+ }
+ private boolean chunkHasPlayers = false;
+ // Paper end
// CraftBukkit end
public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) {
@@ -0,0 +0,0 @@ public class PlayerChunk {
chunkproviderserver.a(i, j);
this.chunk = chunkproviderserver.getChunkAt(i, j, true, false);
+ markChunkUsed(); // Paper - delay chunk unloads
}
+
public ChunkCoordIntPair a() {
return this.location;
}
@@ -0,0 +0,0 @@ public class PlayerChunk {
} else {
if (this.c.isEmpty()) {
if (this.players.isEmpty()) {
this.i = this.playerChunkMap.getWorld().getTime();
+ chunkHasPlayers = true; // Paper - delay chunk unloads
+ markChunkUsed(); // Paper - delay chunk unloads
}
this.c.add(entityplayer);
this.players.add(entityplayer);
@@ -0,0 +0,0 @@ public class PlayerChunk {
this.c.remove(entityplayer);
if (this.c.isEmpty()) {
this.players.remove(entityplayer);
if (this.players.isEmpty()) {
+ chunkHasPlayers = false; // Paper - delay chunk unloads
+ markChunkUsed(); // Paper - delay chunk unloads
this.playerChunkMap.b(this);
@ -154,23 +147,23 @@ index c7ea17e25..7cb1327a8 100644
@@ -0,0 +0,0 @@ public class PlayerChunk {
return true;
} else {
this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag);
this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag);
+ markChunkUsed(); // Paper - delay chunk unloads
return this.chunk != null;
}
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index b8d8fc779..e5605c309 100644
index 3d17ad646..c3ac66d35 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
Chunk chunk = playerchunk.f();
if (chunk != null) {
- this.getWorld().getChunkProviderServer().unload(chunk);
- this.getWorld().getChunkProvider().unload(chunk);
+ // Paper start - delay chunk unloads
+ if (world.paperConfig.delayChunkUnloadsBy <= 0) {
+ this.getWorld().getChunkProviderServer().unload(chunk);
+ this.getWorld().getChunkProvider().unload(chunk);
+ } else {
+ chunk.scheduledForUnload = System.currentTimeMillis();
+ }
@ -179,7 +172,7 @@ index b8d8fc779..e5605c309 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 49432f2eb..288152775 100644
index 5d7370029..6f672aa22 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -198,11 +191,11 @@ index 49432f2eb..288152775 100644
this.methodProfiler.a(() -> {
return String.valueOf(TileEntityTypes.a(tileentity.C()));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 24e504c27..f0e974dff 100644
index b19eef1b1..f1320f5ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
ChunkProviderServer cps = world.getChunkProviderServer();
ChunkProviderServer cps = world.getChunkProvider();
for (net.minecraft.server.Chunk chunk : cps.chunks.values()) {
// If in use, skip it
- if (isChunkInUse(chunk.locX, chunk.locZ)) {

View file

@ -11,7 +11,7 @@ So avoid looking up scoreboards and short circuit to the "not on a team"
logic which is most likely to be true.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 50837d767f..898068a817 100644
index 50837d767..898068a81 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -25,19 +25,19 @@ index 50837d767f..898068a817 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 6b413833da..43ceb2fb18 100644
index 99716419e..caeb5eae0 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@Nullable
public ScoreboardTeamBase be() {
public ScoreboardTeamBase getScoreboardTeam() {
+ if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper
return this.world.getScoreboard().getPlayerTeam(this.getName());
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 961da5bf97..91baaa5062 100644
index da105b41c..6f8ac61d8 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Disable Vanilla Chunk GC
Bukkit has its own system for this.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ca2e027cda..f9b4f314ce 100644
index 7a765cb7b..a8675b8c6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Disable ice and snow
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 13253f6e9c..cde9c11f4d 100644
index 13253f6e9..cde9c11f4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -19,13 +19,13 @@ index 13253f6e9c..cde9c11f4d 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f39ce330f6..2341ce3f93 100644
index 73e9ff1b3..2558a20f6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
this.methodProfiler.c("iceandsnow");
this.methodProfiler.exitEnter("iceandsnow");
- if (this.random.nextInt(16) == 0) {
+ if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
this.m = this.m * 3 + 1013904223;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9a7da83b82..4a457e3302 100644
index 00880d54f..214adec9b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Do not load chunks for Pathfinding
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 546c79cd8..25caf7ef9 100644
--- a/src/main/java/net/minecraft/server/ChunkCache.java
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
@@ -0,0 +0,0 @@ public class ChunkCache implements IIBlockAccess {
@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 53f1c25d2..26156d6cf 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
@ -47,7 +47,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
if (this.m) {
this.l();
diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index a12fdceac..1881dea66 100644
--- a/src/main/java/net/minecraft/server/Pathfinder.java
+++ b/src/main/java/net/minecraft/server/Pathfinder.java
@@ -0,0 +0,0 @@ public class Pathfinder {
@ -60,7 +60,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public Pathfinder(PathfinderAbstract pathfinderabstract) {
this.d = pathfinderabstract;
diff --git a/src/main/java/net/minecraft/server/PathfinderAbstract.java b/src/main/java/net/minecraft/server/PathfinderAbstract.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index ba7fe359f..671628014 100644
--- a/src/main/java/net/minecraft/server/PathfinderAbstract.java
+++ b/src/main/java/net/minecraft/server/PathfinderAbstract.java
@@ -0,0 +0,0 @@ package net.minecraft.server;
@ -80,7 +80,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.c.c();
this.d = MathHelper.d(entityinsentient.width + 1.0F);
diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 2e82c7c48..34b29652b 100644
--- a/src/main/java/net/minecraft/server/PathfinderNormal.java
+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java
@@ -0,0 +0,0 @@ public class PathfinderNormal extends PathfinderAbstract {
@ -115,9 +115,9 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
for(int l = -1; l <= 1; ++l) {
for(int i1 = -1; i1 <= 1; ++i1) {
if (l != 0 || i1 != 0) {
- Block block = iblockaccess.getType(blockposition$b.f(l + i, jx, i1 + k)).getBlock();
- Block block = iblockaccess.getType(blockposition$b.c(l + i, jx, i1 + k)).getBlock();
- if (block == Blocks.CACTUS) {
+ Block block = world.getBlockIfLoaded(blockposition$b.f(l + i, jx, i1 + k)); // Paper
+ Block block = world.getBlockIfLoaded(blockposition$b.c(l + i, jx, i1 + k)); // Paper
+ if (block == null) pathtype = PathType.BLOCKED; // Paper
+ else if (block == Blocks.CACTUS) { // Paper
pathtype = PathType.DANGER_CACTUS;

View file

@ -16,7 +16,7 @@ be having data corruption issues anyways.
This provides a small boost to all setType calls.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 603ad2393..5d0ecb114 100644
index 516656f8f..aa7f01f19 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {

View file

@ -7,28 +7,28 @@ Mojang was sleeping even if we had no more requests to go after
the current one finished, resulting in 100ms lost per profile lookup
diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
index 71e48e87b..23f1447cf 100644
index 26a743722..6ed3199c3 100644
--- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
+++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
@@ -0,0 +0,0 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
}
final int page = 0;
}
final int page = 0;
+ boolean hasRequested = false; // Paper
for (final List<String> request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) {
int failCount = 0;
for (final List<String> request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) {
int failCount = 0;
@@ -0,0 +0,0 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
LOGGER.debug("Couldn't find profile {}", name);
callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile"));
}
LOGGER.debug("Couldn't find profile {}", name);
callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile"));
}
+ // Paper start
+ if (!hasRequested) {
+ hasRequested = true;
+ continue;
+ }
+ // Paper end
try {
Thread.sleep(DELAY_BETWEEN_PAGES);
try {
Thread.sleep(DELAY_BETWEEN_PAGES);
--

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Don't spam reload spawn chunks in nether/end
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 64482393d..1a1b40ac0 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -17,7 +17,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX();
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index bd9c76ee8..ef5c7b1f6 100644
--- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -0,0 +0,0 @@ public abstract class WorldProvider {

View file

@ -81,7 +81,7 @@ index 92acfa6fb..05509e4fd 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 8ff542c88..bb76f56da 100644
index 6c9d7df20..55cb7b88e 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@
@ -112,9 +112,9 @@ index 8ff542c88..bb76f56da 100644
int k = MathHelper.floor(entity.locY / 16.0D);
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
for (int j = 0; j < i; ++j) {
List entityslice = aentityslice[j]; // Spigot
// CraftBukkit start
List<Entity> entityslice = aentityslice[j]; // Spigot
+ // Paper start
+ DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode;
+ if (mode == DuplicateUUIDMode.WARN || mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.SAFE_REGEN) {
@ -160,10 +160,10 @@ index 8ff542c88..bb76f56da 100644
+ }
+ // Paper end
List<Entity> toRemove = new LinkedList<>();
this.world.a(entityslice.stream().filter((entity) -> {
return !(entity instanceof EntityHuman);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index a402f71a9..6c427e9aa 100644
index 1581edc4a..07cd5aa28 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -175,7 +175,7 @@ index a402f71a9..6c427e9aa 100644
this.uniqueID = uuid;
this.au = this.uniqueID.toString();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 29c3a24f2..5557e9409 100644
index 67ef109a5..66d2026d0 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -188,7 +188,7 @@ index 29c3a24f2..5557e9409 100644
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
private final List<TileEntity> c = Lists.newArrayList();
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 0bb903aab..572c54c9c 100644
index f37e85eb0..af9cdd9dc 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {

View file

@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index bcfe4c1da..3a30349f4 100644
index f1a162420..5d0e81731 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
@ -15,13 +15,13 @@ index bcfe4c1da..3a30349f4 100644
private boolean unloadChunk0(int x, int z, boolean save) {
+ Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async
net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false);
net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false);
if (chunk == null) {
return true;
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
// If chunk had previously been queued to save, must do save to avoid loss of that data
return world.getChunkProviderServer().unloadChunk(chunk, chunk.mustSave || save);
return world.getChunkProvider().unloadChunk(chunk, chunk.mustSave || save);
+ }); return result != null ? result : false; // Paper - Ensure never async
}

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 22f0673743..207f53a9c3 100644
index e614ac33a..608f72f0f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 792240f2e..65ba3fe66 100644
index 7c2a8c5c8..cc6ae6634 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -51,7 +51,7 @@ index 792240f2e..65ba3fe66 100644
NBTTagList nbttaglist = new NBTTagList();
double[] adouble1 = adouble;
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 25960cff2..1fb912eb0 100644
index dc173e14f..596ac18a7 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
@ -70,7 +70,7 @@ index 25960cff2..1fb912eb0 100644
public void a(boolean flag) {
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 5ceb3f206..87f3205f8 100644
index 5dc52b6b8..2c28633c4 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
@ -89,7 +89,7 @@ index 5ceb3f206..87f3205f8 100644
@Nullable
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index 769d599c5..e37da10e0 100644
index 1b72df8cd..ae8be435c 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -0,0 +0,0 @@ public class NBTTagList extends NBTList<NBTBase> {
@ -101,7 +101,7 @@ index 769d599c5..e37da10e0 100644
if (i >= 0 && i < this.list.size()) {
NBTBase nbtbase = (NBTBase)this.list.get(i);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 739e19bb1..21c9bb325 100644
index 73c47c517..ab74b1add 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc

View file

@ -14,7 +14,7 @@ Fix this by differing entity add to world for all entities at the same time
the original entity is dead, overwrite it as the logic does for unloaod queued entities.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index a62d7196b..836aea6c3 100644
index 4f01140e7..57e35564a 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -24,25 +24,31 @@ index a62d7196b..836aea6c3 100644
+ List<Entity> toAdd = new java.util.ArrayList<>(32); // Paper
for (int j = 0; j < i; ++j) {
List entityslice = aentityslice[j]; // Spigot
// CraftBukkit start
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
thisChunk.put(entity.uniqueID, entity);
}
}
- // Paper end
// Paper end
-
- List<Entity> toRemove = new LinkedList<>();
- this.world.a(entityslice.stream().filter((entity) -> {
- if (!CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
- toRemove.add(entity);
- return false;
- }
- return !(entity instanceof EntityHuman);
- }));
+ toAdd.addAll(entityslice);
+ // Paper end
- entityslice.removeAll(toRemove);
// CraftBukkit end
}
+ this.world.addChunkEntities(toAdd.stream().filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen)
+ this.world.addChunkEntities(toAdd.stream() // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen)
+ .filter((entity) -> CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) // Paper - Inline into stream
+ .filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen)
// CraftBukkit start
org.bukkit.Server server = this.world.getServer();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 12379f755..72e74c59f 100644
index 5e61826f6..bd6f64e52 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -68,7 +74,7 @@ index 12379f755..72e74c59f 100644
this.b(entity);
});
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 572c54c9c..0545336b4 100644
index af9cdd9dc..10630ac96 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent
Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 5d6f726d05..a8b070ed32 100644
index 0600fe23a..53f1c25d2 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -0,0 +0,0 @@ package net.minecraft.server;
@ -25,7 +25,7 @@ index 5d6f726d05..a8b070ed32 100644
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper
this.q = blockposition;
float fx = this.j();
this.b.methodProfiler.a("pathfind");
this.b.methodProfiler.enter("pathfind");
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
return this.c;
@ -33,5 +33,5 @@ index 5d6f726d05..a8b070ed32 100644
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper
this.q = blockposition;
float fx = this.j();
this.b.methodProfiler.a("pathfind");
this.b.methodProfiler.enter("pathfind");
--

View file

@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle.
This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b80315bc5..a30d92ce7 100644
index 5f386ff04..55e45dbb1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@ -34,7 +34,7 @@ index b80315bc5..a30d92ce7 100644
if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e1c09452b..84bde3ef2 100644
index 8c4b7aee6..c844c4579 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {

View file

@ -7,16 +7,16 @@ Fired when the server is about to merge 2 experience orbs
Plugins can cancel this if they want to ensure experience orbs do not lose important
metadata such as spawn reason, or conditionally move data from source to target.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 2ddc3f050..a14518ba6 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 14df8e80b..9578e9d2e 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {
if (e instanceof EntityExperienceOrb) {
EntityExperienceOrb loopItem = (EntityExperienceOrb) e;
// Paper start
- if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue)) {
+ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) {
+ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) { // Paper
long newTotal = (long)xp.value + (long)loopItem.value;
if ((int) newTotal < 0) continue; // Overflow
if (maxValue > 0 && newTotal > (long)maxValue) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2bc16fb1a..cd17cdcf3 100644
index 6700ce84c..71bd5bc71 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -5,12 +5,12 @@ Subject: [PATCH] Fire EntityCombustEvent for phantoms
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
index 8332d5cc8..dd7dcfbf1 100644
index 7a48719c9..d7be396ee 100644
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
@@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster {
public void k() {
public void movementTick() {
if (this.dq()) {
- this.setOnFire(8);
+ // Paper start - fire EntityCombustEvent
@ -21,5 +21,5 @@ index 8332d5cc8..dd7dcfbf1 100644
+ // Paper end
}
super.k();
super.movementTick();
--

View file

@ -8,7 +8,7 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added.
Also add debug if something else tries to, and abort before world gets bad state
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 4a0f3989e6..695044b1b1 100644
index 3b39b5472..6093ae408 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@ -21,15 +21,15 @@ index 4a0f3989e6..695044b1b1 100644
Iterator iterator = entity.bP().iterator();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d31101861c..a81c7dfa2e 100644
index 6f672aa22..0d04b14cf 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot
if (entity == null) return false;
+ if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
org.bukkit.event.Cancellable event = null;
if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) {
if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
return false;
}
--

View file

@ -5,11 +5,11 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c92df00e8..44ed34174 100644
index 65973edfc..cb62af425 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.methodProfiler.c("blockEntities");
this.methodProfiler.exitEnter("blockEntities");
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
- this.tileEntityListTick.removeAll(this.tileEntityListUnload);

View file

@ -14,7 +14,7 @@ This fix always sends chunks to the client, and simply updates
the client anytime post processing is triggered with the new chunk data.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 5d0ecb114..d36c79732 100644
index aa7f01f19..e3d97757f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -41,7 +41,7 @@ index 5d0ecb114..d36c79732 100644
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index cbff0d946..3ac09b91f 100644
index e61538b3c..f5d971bbe 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -0,0 +0,0 @@ public class PlayerChunk {
@ -50,9 +50,9 @@ index cbff0d946..3ac09b91f 100644
private long i;
- private boolean done;
+ boolean done; // Paper - package-private
// CraftBukkit start - add fields
// You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse
boolean chunkExists; // Paper
// Paper start
PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest;
@@ -0,0 +0,0 @@ public class PlayerChunk {
}
}

View file

@ -6,22 +6,27 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling
Only process drops when the block is actually going to be removed
diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java
index afd3f32d0..2aa9b68b8 100644
index 9c508caa9..4b762a92c 100644
--- a/src/main/java/net/minecraft/server/BlockSponge.java
+++ b/src/main/java/net/minecraft/server/BlockSponge.java
@@ -0,0 +0,0 @@ public class BlockSponge extends Block {
Material material = iblockdata.getMaterial();
if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
- iblockdata.a(world, blockposition2, 0);
+ // Paper start
+ if (block.getHandle().getMaterial() == Material.AIR) {
+ iblockdata.dropNaturally(world, blockposition2, 0);
+ }
+ // Paper end
} else if (iblockdata.getBlock() instanceof BlockFluids) {
// NOP
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
- iblockdata.a(world, blockposition2, 0);
+ // Paper start
+ if (block.getHandle().getMaterial() == Material.AIR) {
+ iblockdata.dropNaturally(world, blockposition2, 0);
+ }
+ // Paper end
}
}
world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());
@@ -0,0 +0,0 @@ public class BlockSponge extends Block {
return i > 0;
}
}
+
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
index 2d855aae6..bc345a2c3 100644
--- a/src/main/java/net/minecraft/server/IBlockData.java

View file

@ -18,7 +18,7 @@ This change ensures the chunks are always loaded when entities are
added to the world, or a valid entity moves between chunks.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3c99ae7cd..2b9da597a 100644
index 4421be836..d084787f1 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -31,7 +31,7 @@ index 3c99ae7cd..2b9da597a 100644
// Paper start - Set origin location when the entity is being added to the world
if (entity.origin == null) {
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.getChunkAt(entity.ae, entity.ag).a(entity, entity.af);
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
}
- if (!entity.bN() && !this.isChunkLoaded(i, k, true)) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Fix lag from explosions processing dead entities
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index e5ba6eddd..c7d11cf62 100644
index d564aaf60..92e3a49e2 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion {
@ -25,7 +25,7 @@ index e5ba6eddd..c7d11cf62 100644
for (int l1 = 0; l1 < list.size(); ++l1) {
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 30f8ec519..b1d05220b 100644
index 2e2fb85cf..7b7fd6b9b 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -0,0 +0,0 @@ public final class IEntitySelector {
@ -42,8 +42,8 @@ index 30f8ec519..b1d05220b 100644
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable Entity object) { // Paper - decompile error
return this.a((Entity)object);
}
- return this.test((Entity)object);
- }
}
}
--

View file

@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8a6589d95..9df2296dd 100644
index ffda9d793..4acb908ec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -36,8 +36,8 @@ index 8a6589d95..9df2296dd 100644
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
private boolean aT() {
- return SystemUtils.b() < this.aa;
private boolean canSleepForTick() {
- return SystemUtils.getMonotonicMillis() < this.nextTick;
+ return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own
}
@ -157,11 +157,11 @@ index 8a6589d95..9df2296dd 100644
- MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
+ //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
this.a(this::aT);
this.aa += 50L;
this.a(this::canSleepForTick);
this.nextTick += 50L;
// Spigot end
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 29b016e17..cf1db412e 100644
index ed0221f0d..212e3cd4a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -9,7 +9,7 @@ This behavior causes a save to occur even though saving was supposed to be turne
It's triggered when Hell/End worlds are empty of players.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index e5605c309..9d971a9c5 100644
index c3ac66d35..5935bae58 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
@ -18,7 +18,7 @@ index e5605c309..9d971a9c5 100644
- if (!worldprovider.canRespawn()) {
+ if (!worldprovider.canRespawn() && !this.world.savingDisabled) { // Paper - respect saving disabled setting
this.world.getChunkProviderServer().b();
this.world.getChunkProvider().b();
}
} // Paper timing
--

View file

@ -7,7 +7,7 @@ If a players inventory is too big to send in a single packet,
split the inventory set into multiple packets instead.
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 97a9dffe6..2f887932b 100644
index 120416b30..065bede4c 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
@ -44,7 +44,7 @@ index 2e42c268b..0a9bfb07a 100644
return false;
}
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
index c20911c96..c22c3eebc 100644
index 3448f6c53..484131e65 100644
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@ -64,10 +64,12 @@ index c20911c96..c22c3eebc 100644
+ // Paper start
+ private static int MAX_PACKET_SIZE = 2097152;
+
+ public static class PacketTooLargeException extends RuntimeException {
+ private final Packet<?> packet;
+
+ PacketTooLargeException(Packet<?> packet, int packetLength) {
+ super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength +". Max is " + MAX_PACKET_SIZE);
+ super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength + ". Max is " + MAX_PACKET_SIZE);
+ this.packet = packet;
+ }
+
@ -76,10 +78,7 @@ index c20911c96..c22c3eebc 100644
+ }
+ }
+ // Paper end
+
// $FF: synthetic method
protected void encode(ChannelHandlerContext channelhandlercontext, Packet<?> object, ByteBuf bytebuf) throws Exception { // Paper - decompiler fix
this.a(channelhandlercontext, (Packet)object, bytebuf);
}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 40ec398ee..ca6bcd22f 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java

View file

@ -23,7 +23,7 @@ index 56700fc59..9b9c8361e 100644
MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ());
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 715ab15e3..df23b5c4f 100644
index 469dce5df..f1abcadcc 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -35,7 +35,7 @@ index 715ab15e3..df23b5c4f 100644
public float length;
public float J;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1d7188b2e..ccdb1ba01 100644
index f5f1452b7..762ae7366 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -71,7 +71,7 @@ index 1d7188b2e..ccdb1ba01 100644
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index a05320c90..2acd8a4b3 100644
index a41716fd4..20fb157fa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {

View file

@ -177,7 +177,7 @@ index 000000000..26e3031d2
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 34ba382a4..c3efb5e1b 100644
index 906bd973d..9b823d4ca 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@
@ -191,25 +191,12 @@ index 34ba382a4..c3efb5e1b 100644
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
if (i - this.Y >= 5000000000L) {
this.Y = i;
this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.z(), this.y()));
- GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), 12)];
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
int j = MathHelper.nextInt(this.n, 0, this.y() - agameprofile.length);
this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount()));
- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)];
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
int j = MathHelper.nextInt(this.n, 0, this.getPlayerCount() - agameprofile.length);
for (int k = 0; k < agameprofile.length; ++k) {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
return "1.13.2";
}
+ public int getPlayerCount() { return y(); } // Paper - OBFHELPER
public int y() {
return this.s.getPlayerCount();
}
+ public int getMaxPlayers() { return z(); } // Paper - OBFHELPER
public int z() {
return this.s.getMaxPlayers();
}
diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java
index c9edd289a..8aa121e2f 100644
--- a/src/main/java/net/minecraft/server/PacketStatusListener.java
@ -234,7 +221,7 @@ index c9edd289a..8aa121e2f 100644
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java
index 615aa2cd0..408aad098 100644
index c338d09bf..087f5fe0d 100644
--- a/src/main/java/net/minecraft/server/ServerPing.java
+++ b/src/main/java/net/minecraft/server/ServerPing.java
@@ -0,0 +0,0 @@ public class ServerPing {

View file

@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index d245502286..816854dc2f 100644
index 1185769ca..443a089d8 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
@ -30,7 +30,7 @@ index d245502286..816854dc2f 100644
ItemStack itemstack1 = this.a(entityitem);
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index c5bfe6630d..4f2d7db378 100644
index 08d923563..6d9c80489 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
@ -43,7 +43,7 @@ index c5bfe6630d..4f2d7db378 100644
ItemStack itemstack = entityitemframe.getItem();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 264dc740cb..8aa4138a2e 100644
index 9c5f520f1..5d7370029 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
@ -55,7 +55,7 @@ index 264dc740cb..8aa4138a2e 100644
}
}
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
index bf7963b421..338d753500 100644
index 5c09085a6..a819d6037 100644
--- a/src/main/java/net/minecraft/server/WorldMap.java
+++ b/src/main/java/net/minecraft/server/WorldMap.java
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
@ -88,7 +88,7 @@ index bf7963b421..338d753500 100644
+ public void updateSeenPlayers(EntityHuman entityhuman, ItemStack itemstack) { a(entityhuman, itemstack); } // Paper - OBFHELPER
public void a(EntityHuman entityhuman, ItemStack itemstack) {
if (!this.j.containsKey(entityhuman)) {
if (!this.humans.containsKey(entityhuman)) {
WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman);
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
@ -127,7 +127,7 @@ index bf7963b421..338d753500 100644
for ( org.bukkit.map.MapCursor cursor : render.cursors) {
diff --git a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
index 256a131781..5768cd512e 100644
index 256a13178..5768cd512 100644
--- a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
+++ b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
@@ -0,0 +0,0 @@ import org.bukkit.map.MapCursor;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 3f17fbd37..dfedd4c30 100644
index 7061075b5..0dd52f859 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

View file

@ -27,7 +27,7 @@ index 9a74601b0..6e60d15cc 100644
int i = this.f ? 300 : 100;
if (this.g && (!this.b.isAlive() || this.b.ticksLived - this.c > i)) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index da0e9b0a3..ab8490ff9 100644
index 67ea54987..7fc56cadc 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -69,15 +69,15 @@ index c5bddb1da..0a9666541 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 5ea5d4b78..46a4e37a2 100644
index 3ef68fec7..716f0e67f 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
public float aU;
public EntityHuman killer;
public int lastDamageByPlayerTime; // Paper - public
- protected boolean aX;
+ protected boolean aX; protected void setDying(boolean dying) { this.aX = dying; } protected boolean isDying() { return this.aX; } // Paper - OBFHELPER
- protected boolean killed;
+ protected boolean killed; protected void setDying(boolean dying) { this.killed = dying; } protected boolean isDying() { return this.killed; } // Paper - OBFHELPER
protected int ticksFarFromPlayer;
protected float aZ;
protected float ba;
@ -138,9 +138,8 @@ index 5ea5d4b78..46a4e37a2 100644
+ // entity.b(this);
+ //}
- this.aX = true;
this.killed = true;
- this.getCombatTracker().g();
+ this.aX = true; // Paper - Always set at start, unset later if cancelled - GH-1432
+ //this.getCombatTracker().g();
+
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = null;
@ -207,7 +206,7 @@ index 5ea5d4b78..46a4e37a2 100644
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 6933d8876..d429e552e 100644
index bf842a0a9..b5d48e7bf 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -306,7 +305,7 @@ index 8be0a47ba..f56ef6f71 100644
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index cd6ae3b8e..4a0a456a0 100644
index c6cd2f3be..f87d2bed7 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

View file

@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 9430bccf6..aedf31a07 100644
index 9d3234c1c..9b88a4190 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -29,7 +29,7 @@ index 9430bccf6..aedf31a07 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 2bab2ab92..20a46e2af 100644
index 82e85a035..752848323 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
@ -56,7 +56,7 @@ index 2bab2ab92..20a46e2af 100644
this.activeContainer = this.defaultContainer;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index a615d7867..6933d8876 100644
index 5bd65ddbb..bf842a0a9 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -110,7 +110,7 @@ index a615d7867..6933d8876 100644
this.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 871dea68f..30d5c1734 100644
index 159a30e0e..a66f8ab2c 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -123,7 +123,7 @@ index 871dea68f..30d5c1734 100644
this.player.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 64a86b699..e6ee5042c 100644
index 08bbd86d1..6311c9f87 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {
@ -168,7 +168,7 @@ index 8699cc72f..0f1d700c7 100644
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index dfedd4c30..b220895c2 100644
index 0dd52f859..dcd628104 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Lighting Queue
This provides option to queue lighting updates to ensure they do not cause the server lag
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 145cb274b..eff9dcf54 100644
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +0,0 @@ public class WorldTimingsHandler {
@ -28,7 +28,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public static Timing getTickList(WorldServer worldserver, String timingsType) {
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index fe148495b..cc69ff3a4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -0,0 +0,0 @@ public class PaperConfig {
@ -46,7 +46,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
boolean timings = getBoolean("timings.enabled", true);
boolean verboseTimings = getBoolean("timings.verbose", true);
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 39d565db1..8f6f0288b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -63,7 +63,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index da2548603..87ec4d1a2 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -77,7 +77,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
private void g(boolean flag) {
this.world.methodProfiler.a("recheckGaps");
this.world.methodProfiler.enter("recheckGaps");
- if (this.world.areChunksLoaded(new BlockPosition(this.locX * 16 + 8, 0, this.locZ * 16 + 8), 16)) {
+ if (this.areNeighborsLoaded(1)) { // Paper
for (int i = 0; i < 16; ++i) {
@ -126,7 +126,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
IMMEDIATE, QUEUED, CHECK;
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 60abc5f28..6a9b9fa2a 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@ -138,21 +138,21 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// Update neighbor counts
for (int x = -2; x < 3; x++) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 4acb908ec..194f8441e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
protected void a(BooleanSupplier booleansupplier) {
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
this.slackActivityAccountant.tickStarted(); // Spigot
- long i = SystemUtils.c();
+ long i = SystemUtils.c(); long startTime = i; // Paper
- long i = SystemUtils.getMonotonicNanos();
+ long i = SystemUtils.getMonotonicNanos(); long startTime = i; // Paper
++this.ticks;
if (this.S) {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.methodProfiler.e();
this.methodProfiler.e();
this.methodProfiler.exit();
this.methodProfiler.exit();
org.spigotmc.WatchdogThread.tick(); // Spigot
+ PaperLightingQueue.processQueue(startTime); // Paper
this.slackActivityAccountant.tickEnded(l); // Spigot
@ -160,7 +160,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java
new file mode 100644
index 7ac07ac07ac0..7ac07ac07ac0
index 000000000..9783f3a0d
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PaperLightingQueue.java
@@ -0,0 +0,0 @@
@ -189,7 +189,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ continue;
+ }
+
+ ObjectCollection<Chunk> loadedChunks = ((WorldServer) world).getChunkProviderServer().chunks.values();
+ ObjectCollection<Chunk> loadedChunks = ((WorldServer) world).getChunkProvider().chunks.values();
+ for (Chunk chunk : loadedChunks.toArray(new Chunk[0])) {
+ if (chunk.lightingQueue.processQueue(startTime, maxTickTime)) {
+ break START;
@ -263,16 +263,16 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ }
+}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 5d5a9f0bb..69f55d0dd 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) {
this.methodProfiler.a("checkLight");
this.methodProfiler.enter("checkLight");
- this.r(blockposition);
+ chunk.runOrQueueLightUpdate(() -> this.r(blockposition)); // Paper - Queue light update
this.methodProfiler.e();
this.methodProfiler.exit();
}
--

View file

@ -69,7 +69,7 @@ index afbe43dd3..d732be52e 100644
--this.lifeTicks;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index af68074c1..899c7f5f7 100644
index 27c8a97be..63c802d02 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {

View file

@ -46,7 +46,7 @@ index bf538684a..19819b134 100644
public AxisAlignedBB(double d0, double d1, double d2, double d3, double d4, double d5) {
this.minX = Math.min(d0, d3);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 80d384dfe..da0e9b0a3 100644
index c083b2dd3..67ea54987 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke

View file

@ -5,31 +5,33 @@ Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index a553fb747..4048937c6 100644
index 25a1edc45..f1ad18511 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
}
// $FF: synthetic method
- // $FF: synthetic method
- public int compareTo(Object object) {
+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix
return this.l((BaseBlockPosition)object);
}
- return this.compareTo((BaseBlockPosition)object);
- }
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 7f8802b2e..6ffc53514 100644
index 66c38df1f..50e29464b 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
}
}
// $FF: synthetic method
- // $FF: synthetic method
- protected Object computeNext() {
+ protected BlockPosition computeNext() { // Paper - decompile fix
return this.a();
}
- return this.computeNext();
- }
};
};
}
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
if (this.g.b < l) {
++this.g.b;
@ -43,14 +45,70 @@ index 7f8802b2e..6ffc53514 100644
}
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
}
}
// $FF: synthetic method
- // $FF: synthetic method
- protected Object computeNext() {
+ protected BlockPosition.MutableBlockPosition computeNext() { // Paper - decompile fix
return this.a();
}
- return this.computeNext();
- }
};
};
}
- // $FF: synthetic method
- public BaseBlockPosition d(BaseBlockPosition baseblockposition) {
- return this.d(baseblockposition);
- }
public static class MutableBlockPosition extends BlockPosition {
protected int b;
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
return new BlockPosition(this);
}
- // $FF: synthetic method
- public BaseBlockPosition d(BaseBlockPosition baseblockposition) {
- return super.d(baseblockposition);
- }
}
public static final class b extends BlockPosition.MutableBlockPosition implements AutoCloseable {
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
}
}
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition d(int i, int j, int k) {
- return this.d(i, j, k);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) {
- return this.c(enumdirection, i);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection) {
- return this.c(enumdirection);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition g(BaseBlockPosition baseblockposition) {
- return this.g(baseblockposition);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) {
- return this.c(d0, d1, d2);
- }
-
- // $FF: synthetic method
- public BlockPosition.MutableBlockPosition c(int i, int j, int k) {
- return this.c(i, j, k);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 3bd0c56d4..304e47bf2 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
@ -139,7 +197,7 @@ index 8bfa218a6..e2e60d3ed 100644
arraylist.add(definedstructure$a);
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
index 5c2d50f97..fd6df39f1 100644
index 6695f8d77..e1ea8da88 100644
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
@@ -0,0 +0,0 @@ public class EnchantmentManager {
@ -200,76 +258,101 @@ index 04cff50cb..e746a6a0d 100644
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX, this.locY, this.locZ);
entityareaeffectcloud.setSource(this.shooter);
entityareaeffectcloud.setParticle(Particles.j);
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
index 4dee04581..9c48bb3c9 100644
--- a/src/main/java/net/minecraft/server/EntityLlama.java
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
@@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
public void s(boolean var1) {
}
- // $FF: synthetic method
- public EntityAgeable createChild(EntityAgeable entityageable) {
- return this.createChild(entityageable);
- }
-
static class a extends PathfinderGoalNearestAttackableTarget<EntityWolf> {
public a(EntityLlama entityllama) {
super(entityllama, EntityWolf.class, 16, false, true, (Predicate)null);
diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java
index 38c85f4ab..c0853f0fc 100644
index 23ca6fc50..44c91ba26 100644
--- a/src/main/java/net/minecraft/server/EnumDirection.java
+++ b/src/main/java/net/minecraft/server/EnumDirection.java
@@ -0,0 +0,0 @@ public enum EnumDirection implements INamable {
return d0;
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return super.a((EnumDirection)object);
}
- return super.test((EnumDirection)object);
- }
},
Y("y") {
public int a(int var1, int i, int var3) {
@@ -0,0 +0,0 @@ public enum EnumDirection implements INamable {
return d0;
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return super.a((EnumDirection)object);
}
- return super.test((EnumDirection)object);
- }
},
Z("z") {
public int a(int var1, int var2, int i) {
@@ -0,0 +0,0 @@ public enum EnumDirection implements INamable {
return d0;
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return super.a((EnumDirection)object);
}
- return super.test((EnumDirection)object);
- }
};
private static final Map<String, EnumDirection.EnumAxis> d = (Map)Arrays.stream(values()).collect(Collectors.toMap(EnumDirection.EnumAxis::a, (enumdirection$enumaxis) -> {
@@ -0,0 +0,0 @@ public enum EnumDirection implements INamable {
public abstract double a(double var1, double var3, double var5);
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return this.a((EnumDirection)object);
}
- return this.test((EnumDirection)object);
- }
}
public static enum EnumAxisDirection {
@@ -0,0 +0,0 @@ public enum EnumDirection implements INamable {
return Iterators.forArray(this.c);
}
// $FF: synthetic method
- // $FF: synthetic method
- public boolean test(@Nullable Object object) {
+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix
return this.a((EnumDirection)object);
}
- return this.test((EnumDirection)object);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
index 3f5d6c323..286c1b14f 100644
index 0e0571a6c..8fc45c697 100644
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
}
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(IChatBaseComponent object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix
return this.a((IChatBaseComponent)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((IChatBaseComponent)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public IChatBaseComponent deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java
index 0c9249cd8..0648c76a0 100644
index 4157fcea3..ba03b9dcc 100644
--- a/src/main/java/net/minecraft/server/LocaleLanguage.java
+++ b/src/main/java/net/minecraft/server/LocaleLanguage.java
@@ -0,0 +0,0 @@ public class LocaleLanguage {
@ -282,24 +365,24 @@ index 0c9249cd8..0648c76a0 100644
this.d.put(entry.getKey(), s);
}
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
index 9d01b70c7..8daccdd6e 100644
index 252b0f3ed..86df2b969 100644
--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java
+++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java
@@ -0,0 +0,0 @@ public abstract class LootSelectorEntry {
return jsonobject;
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(LootSelectorEntry object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((LootSelectorEntry)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((LootSelectorEntry)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public LootSelectorEntry deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
index 48d04b540..de9168a9c 100644
--- a/src/main/java/net/minecraft/server/NBTBase.java
@ -337,7 +420,7 @@ index 456b5f492..54f2935c0 100644
+ // Paper end- Decompile fix
}
diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java
index 86881a22d..81ff1fd69 100644
index 973f28cc5..21a6f488a 100644
--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
@@ -0,0 +0,0 @@ public class NBTTagByteArray extends NBTList<NBTTagByte> {
@ -350,21 +433,8 @@ index 86881a22d..81ff1fd69 100644
byte[] abyte = new byte[this.data.length];
System.arraycopy(this.data, 0, abyte, 0, this.data.length);
diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java
index 40f6179cd..ebc44ec9e 100644
--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java
@@ -0,0 +0,0 @@ public class NBTTagIntArray extends NBTList<NBTTagInt> {
return this.a(i);
}
- public NBTBase clone() {
+ public NBTTagIntArray clone() { // Paper - decompile fix
return this.c();
}
}
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index 24a66f95a..2e7c96056 100644
index 8e6cce15f..1b72df8cd 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@ -377,9 +447,14 @@ index 24a66f95a..2e7c96056 100644
public NBTTagList() {
@@ -0,0 +0,0 @@ public class NBTTagList extends NBTList<NBTBase> {
return this.c();
return this.type;
}
- // $FF: synthetic method
- public NBTBase clone() {
- return this.clone();
- }
-
+ /* // Paper start - Decompile fix
// $FF: synthetic method
public Object remove(int i) {
@ -391,17 +466,36 @@ index 24a66f95a..2e7c96056 100644
+ */ // Paper end - Decompile fix
}
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
index 113e8780a..8e312c761 100644
index a717ad95f..ff7e20dfc 100644
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
}
}
// $FF: synthetic method
- // $FF: synthetic method
- protected void encode(ChannelHandlerContext channelhandlercontext, Object object, ByteBuf bytebuf) throws Exception {
+ protected void encode(ChannelHandlerContext channelhandlercontext, Packet<?> object, ByteBuf bytebuf) throws Exception { // Paper - decompiler fix
this.a(channelhandlercontext, (Packet)object, bytebuf);
- this.encode(channelhandlercontext, (Packet)object, bytebuf);
- }
}
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
index 8bc7c0ccd..faaad0f41 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
@@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess {
public void b(boolean flag) {
this.u = flag;
}
-
- // $FF: synthetic method
- public TickList l() {
- return this.l();
- }
-
- // $FF: synthetic method
- public TickList k() {
- return this.k();
- }
}
diff --git a/src/main/java/net/minecraft/server/Registry.java b/src/main/java/net/minecraft/server/Registry.java
index 5be9f0ff2..9efec49d6 100644
@ -444,65 +538,91 @@ index 03c603362..d03ac0e70 100644
this.b = (K[])(new Object[i]);
this.c = new int[i];
diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java
index 7b8a8064b..615aa2cd0 100644
index 364dadfbd..c338d09bf 100644
--- a/src/main/java/net/minecraft/server/ServerPing.java
+++ b/src/main/java/net/minecraft/server/ServerPing.java
@@ -0,0 +0,0 @@ public class ServerPing {
return jsonobject;
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(ServerPing object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((ServerPing)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((ServerPing)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
public static class ServerData {
@@ -0,0 +0,0 @@ public class ServerPing {
return jsonobject;
}
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
- return this.serialize((ServerPing.ServerData)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
@@ -0,0 +0,0 @@ public class ServerPing {
return jsonobject;
}
// $FF: synthetic method
- // $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(ServerPing.ServerData object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((ServerPing.ServerData)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- return this.serialize((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext);
- }
-
- // $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
}
@@ -0,0 +0,0 @@ public class ServerPing {
}
// $FF: synthetic method
- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
+ public JsonElement serialize(ServerPing.ServerPingPlayerSample object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix
return this.a((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext);
}
// $FF: synthetic method
- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
+ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix
return this.a(jsonelement, type, jsondeserializationcontext);
}
- return this.deserialize(jsonelement, type, jsondeserializationcontext);
- }
}
}
}
diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java
index ef9d8e06f..0c9910d9a 100644
index 475bf35fa..78234cbdd 100644
--- a/src/main/java/net/minecraft/server/ShapeDetector.java
+++ b/src/main/java/net/minecraft/server/ShapeDetector.java
@@ -0,0 +0,0 @@ public class ShapeDetector {
return new ShapeDetectorBlock(this.a, blockposition, this.b);
}
// $FF: synthetic method
- // $FF: synthetic method
- public Object load(Object object) throws Exception {
+ public ShapeDetectorBlock load(BlockPosition object) throws Exception {// Paper - Decompile fix
return this.a((BlockPosition)object);
}
- return this.load((BlockPosition)object);
- }
}
public static class ShapeDetectorCollection {
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index c1bbacfc1..f0a826cd1 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -0,0 +0,0 @@ import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
import java.io.DataInputStream;
+import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -0,0 +0,0 @@ public class WorldPersistentData {
}
DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1));
- NBTCompressedStreamTools.a(nbttagcompound, dataoutputstream);
+ NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); // Paper - decompile fix
dataoutputstream.close();
}
} catch (Exception exception) {
--

View file

@ -5,7 +5,7 @@ Subject: [PATCH] MC Utils
diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 1c1a6a37a..0929e0189 100644
--- a/src/main/java/net/minecraft/server/AttributeInstance.java
+++ b/src/main/java/net/minecraft/server/AttributeInstance.java
@@ -0,0 +0,0 @@ public interface AttributeInstance {
@ -20,7 +20,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
void b(UUID var1);
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 50e29464b..880ce16b1 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@ -65,10 +65,10 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 773a8c52d..5dd08018c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ import com.google.common.collect.Lists; // CraftBukkit
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
public class Chunk implements IChunkAccess {
private static final Logger d = LogManager.getLogger();
@ -86,7 +86,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 744762b8b..d9608121b 100644
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
@@ -0,0 +0,0 @@ public class ChunkCoordIntPair {
@ -99,7 +99,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return (long)i & 4294967295L | ((long)j & 4294967295L) << 32;
}
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 3919c1fba..772382144 100644
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@ -112,7 +112,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private final IChunkLoader e;
private final IAsyncTaskHandler f;
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 95ca5f6d8..0dc948a37 100644
--- a/src/main/java/net/minecraft/server/DataBits.java
+++ b/src/main/java/net/minecraft/server/DataBits.java
@@ -0,0 +0,0 @@ public class DataBits {
@ -124,7 +124,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.a;
}
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 7f905b1e0..fa5b9262b 100644
--- a/src/main/java/net/minecraft/server/DataPalette.java
+++ b/src/main/java/net/minecraft/server/DataPalette.java
@@ -0,0 +0,0 @@ package net.minecraft.server;
@ -142,7 +142,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
void b(PacketDataSerializer var1);
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 304e47bf2..6e7454b13 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -0,0 +0,0 @@ import java.util.function.Function;
@ -184,7 +184,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.b();
packetdataserializer.writeByte(this.i);
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 372afbe94..20b7c2c6d 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent;
@ -196,7 +196,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private float b;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 550c7a355..b039ff1b5 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
@ -208,7 +208,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// CraftBukkit start - fire event
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 341af9c16..14c481220 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
@ -220,7 +220,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index c9e596367..70830bbf4 100644
--- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
@@ -0,0 +0,0 @@
@ -239,7 +239,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return SoundCategory.HOSTILE;
}
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index bcdc790ba..339abdc01 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -0,0 +0,0 @@ package net.minecraft.server;
@ -290,7 +290,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// Paper end
}
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index ac081d230..faae6d09d 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -0,0 +0,0 @@ import org.bukkit.TreeType;
@ -321,7 +321,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644
index 7ac07ac07ac0..7ac07ac07ac0
index 000000000..c97e116aa
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +0,0 @@
@ -642,7 +642,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ }
+}
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 447b56323..db4e4b859 100644
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@ -687,18 +687,18 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
}
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index db52ffad4..d5bbc5f8e 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
return new DefaultEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Client IO #%d").setDaemon(true).build());
});
private final EnumProtocolDirection h;
- private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue();
+ private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue(); private final Queue<NetworkManager.QueuedPacket> getPacketQueue() { return this.i; } // Paper - OBFHELPER
- private final Queue<NetworkManager.QueuedPacket> packetQueue = Queues.newConcurrentLinkedQueue();
+ private final Queue<NetworkManager.QueuedPacket> packetQueue = Queues.newConcurrentLinkedQueue(); private final Queue<NetworkManager.QueuedPacket> getPacketQueue() { return this.packetQueue; } // Paper - OBFHELPER
private final ReentrantReadWriteLock j = new ReentrantReadWriteLock();
public Channel channel;
// Spigot Start // PAIL
public SocketAddress socketAddress;
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
}
@ -728,7 +728,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
this.a = packet;
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 7582151ae..d05f1e02c 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
@ -740,7 +740,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
for (int j = 1; j < 5; ++j) {
if ((i & -1 << j * 7) == 0) {
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index ff7e20dfc..3448f6c53 100644
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@ -752,7 +752,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
throw new SkipEncodeException(throwable);
} else {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 12d6c99cf..af382815f 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@ -773,24 +773,24 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
int j = 0;
ChunkSection[] achunksection = chunk.getSections();
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index bbc8c0007..2b6c797ce 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
private final MinecraftServer minecraftServer;
public EntityPlayer player;
private int e;
- private long f;
- private boolean g;
- private long lastKeepAlive;
- private boolean awaitingKeepAlive;
- private long h;
+ private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER
+ private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER
+ private long lastKeepAlive; private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER
+ private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER
+ private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER
// CraftBukkit start - multithreaded fields
private volatile int chatThrottle;
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 8fce3b022..58ac6eafc 100644
--- a/src/main/java/net/minecraft/server/PotionUtil.java
+++ b/src/main/java/net/minecraft/server/PotionUtil.java
@@ -0,0 +0,0 @@ public class PotionUtil {
@ -802,7 +802,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
if (potionregistry == Potions.EMPTY) {
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index a21006290..6c6f006f3 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -0,0 +0,0 @@ public class RegistryBlockID<T> implements Registry<T> {
@ -814,7 +814,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.b.size();
}
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
index 25d4907b3..1f6de76a7 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -0,0 +0,0 @@ public class SystemUtils {
@ -831,17 +831,12 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
@@ -0,0 +0,0 @@ public class SystemUtils {
}
public static long b() {
- return c() / 1000000L;
+ return System.nanoTime() / 1000000L; // Paper
}
public static long c() {
public static long getMonotonicNanos() {
- return a.getAsLong();
+ return System.nanoTime(); // Paper
}
public static long d() {
public static long getTimeMillis() {
@@ -0,0 +0,0 @@ public class SystemUtils {
futuretask.run();
return (V)futuretask.get();

View file

@ -6,15 +6,15 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 4b8b66352..7e6a7b0e9 100644
index 91404cc5a..5552b64fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
public boolean loadChunk(int x, int z, boolean generate) {
org.spigotmc.AsyncCatcher.catchOp( "chunk load"); // Spigot
chunkLoadCount++;
- return world.getChunkProviderServer().getChunkAt(x, z, true, generate) != null;
+ return world.getChunkProviderServer().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper
- return world.getChunkProvider().getChunkAt(x, z, true, generate) != null;
+ return world.getChunkProvider().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper
}
public boolean isChunkLoaded(Chunk chunk) {

View file

@ -28,11 +28,11 @@ respond to the request.
[2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13
diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java
index 5691d0aea..aafca9c9c 100644
index cb2b9c368..976888b66 100644
--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java
+++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
private static final Logger a = LogManager.getLogger();
private final ServerConnection b;
+ private ByteBuf buf; // Paper
@ -40,9 +40,9 @@ index 5691d0aea..aafca9c9c 100644
public LegacyPingHandler(ServerConnection serverconnection) {
this.b = serverconnection;
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
public void channelRead(ChannelHandlerContext channelhandlercontext, Object object) throws Exception {
ByteBuf bytebuf = (ByteBuf)object;
ByteBuf bytebuf = (ByteBuf) object;
+ // Paper start - Make legacy ping handler more reliable
+ if (this.buf != null) {
+ try {
@ -57,24 +57,24 @@ index 5691d0aea..aafca9c9c 100644
boolean flag = true;
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
this.a(channelhandlercontext, this.a(s));
break;
default:
+ // Paper start - Replace with improved version below
+ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return;
+ readLegacy1_6(channelhandlercontext, bytebuf);
+ /*
boolean flag1 = bytebuf.readUnsignedByte() == 1;
flag1 = flag1 & bytebuf.readUnsignedByte() == 250;
flag1 = flag1 & "MC|PingHost".equals(new String(bytebuf.readBytes(bytebuf.readShort() * 2).array(), StandardCharsets.UTF_16BE));
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
} finally {
bytebuf1.release();
}
+ */ // Paper end- end commenting out
}
this.a(channelhandlercontext, this.a(s));
break;
default:
+ // Paper start - Replace with improved version below
+ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return;
+ readLegacy1_6(channelhandlercontext, bytebuf);
+ /*
boolean flag1 = bytebuf.readUnsignedByte() == 1;
bytebuf.release();
flag1 &= bytebuf.readUnsignedByte() == 250;
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
} finally {
bytebuf1.release();
}
+ */ // Paper end - Replace with improved version below
}
bytebuf.release();
@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
}

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Make portal teleportation adjustment math more accurate
diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java
index c0853f0fc..7aa940672 100644
index 44c91ba26..c6933c1a3 100644
--- a/src/main/java/net/minecraft/server/EnumDirection.java
+++ b/src/main/java/net/minecraft/server/EnumDirection.java
@@ -0,0 +0,0 @@ public enum EnumDirection implements INamable {
@ -45,7 +45,7 @@ index d53d0c242..49fba0979 100644
if (d0 < d1) {
return d1;
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
index 7e858bab4..eba6eaf37 100644
index a24bd02d5..d30a8a6bd 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -0,0 +0,0 @@ public class PortalTravelAgent {
@ -79,7 +79,7 @@ index 7e858bab4..eba6eaf37 100644
float f1 = 0.0F;
float f2 = 0.0F;
diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java
index 0c9910d9a..446cdb86d 100644
index 78234cbdd..daeb3f83e 100644
--- a/src/main/java/net/minecraft/server/ShapeDetector.java
+++ b/src/main/java/net/minecraft/server/ShapeDetector.java
@@ -0,0 +0,0 @@ public class ShapeDetector {

View file

@ -29,7 +29,7 @@ index 468aff713..241992f59 100644
private static void savePlayerData() {
savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c79baa922..352f86967 100644
index eb4b3c7a2..7c344ffa2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {

View file

@ -6,11 +6,11 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index bb76f56da..382e46adb 100644
index 55cb7b88e..f7990fbdb 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
entity.ag = this.locZ;
entity.chunkZ = this.locZ;
this.entitySlices[k].add(entity);
// Paper start
+ this.markDirty();

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Optimise removeQueue
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 9929e2a73..c2957ad2e 100644
index 13c538043..c07332e1b 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ import com.mojang.authlib.GameProfile;
@ -53,8 +53,8 @@ index 9929e2a73..c2957ad2e 100644
}
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.lastHealthSent = -1.0F;
this.co = -1;
// this.cy.a((RecipeBook) entityplayer.cy); // CraftBukkit
this.lastFoodSent = -1;
// this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit
- this.removeQueue.addAll(entityplayer.removeQueue);
+ // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only
+ // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting"

View file

@ -9,12 +9,12 @@ getChunkAt is called for the same chunk multiple times in a row, often from getT
Optimize this look up by using a Last Access cache.
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
index ca18901df..2ebb2d834 100644
index 732c8793e..8b3738c8f 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
public Chunk a(long i, Chunk chunk) {
public Chunk put(long i, Chunk chunk) {
chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper
+ lastChunkByPos = chunk; // Paper
Chunk chunk1 = (Chunk) super.put(i, chunk);
@ -68,8 +68,8 @@ index ca18901df..2ebb2d834 100644
+ }
+ // Paper end
public Chunk a(Object object) {
return this.a((Long) object);
public Chunk remove(Object object) {
return this.remove((Long) object);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 557aa5180..1d08ec37f 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java

View file

@ -31,7 +31,7 @@ index 10efe6b3d..6feea98b6 100644
private void disableSprintInterruptionOnAttack() {
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 36c8644e2..eea6d9419 100644
index 7afcac499..cf1ca505f 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -0,0 +0,0 @@ public final class ItemStack {
@ -47,7 +47,7 @@ index 36c8644e2..eea6d9419 100644
itemstack.d(this.B());
if (this.tag != null) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ca72e6ad1..49a06f395 100644
index 928dbf032..aaefb98c0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -57,7 +57,7 @@ index ca72e6ad1..49a06f395 100644
- WorldServer worldserver = (WorldServer) iterator.next();
+ WorldServer worldserver = (WorldServer) iterator.next();
+ TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
i = SystemUtils.c();
i = SystemUtils.getMonotonicNanos();
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
this.methodProfiler.a(() -> {
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
@ -81,7 +81,7 @@ index 29fe031d8..d67fd92d9 100644
this.world.b(this.position, this);
if (!this.f.isAir()) {
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index 4bb650fa3..cdc576058 100644
index 15e4a37fb..5291c1836 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi

View file

@ -14,7 +14,7 @@ Also optimizes to not repeatedly look up the same chunk for
light lookups.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 0bd975b6d..603ad2393 100644
index 654cf763b..516656f8f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
@ -36,7 +36,7 @@ index 0bd975b6d..603ad2393 100644
int i1 = iblockdata.b(this.world, blockposition);
int j1 = iblockdata1.b(this.world, blockposition);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f8afa6f72..3c99ae7cd 100644
index d736ac63d..4421be836 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc

View file

@ -217,7 +217,7 @@ index 000000000..af9e4455c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ef49fc258..c73a61d94 100644
index 175198818..63b5cdd41 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -226,7 +226,7 @@ index ef49fc258..c73a61d94 100644
private int q = -1;
- public final Map<DimensionManager, WorldServer> worldServer = Maps.newIdentityHashMap();
+ public final Map<DimensionManager, WorldServer> worldServer = new com.destroystokyo.paper.PaperWorldMap(); // Paper
private PlayerList s;
private PlayerList playerList;
private boolean isRunning = true;
private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati

View file

@ -10,7 +10,7 @@ Additionally, move Saving of the User cache to be done async, incase
the user never changed the default setting for Spigot's save on stop only.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index eb6ada935f..04d8c108b4 100644
index 1c09dded9..edf72fbec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -23,7 +23,7 @@ index eb6ada935f..04d8c108b4 100644
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index 0e168ad349..f8b7d695c6 100644
index d1197b959..51c2c5dd7 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -0,0 +0,0 @@ public class UserCache {
@ -37,7 +37,7 @@ index 0e168ad349..f8b7d695c6 100644
if (date == null) {
@@ -0,0 +0,0 @@ public class UserCache {
UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date, null);
UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date); // CraftBukkit - decompile error
- if (this.e.containsKey(uuid)) {
+ //if (this.e.containsKey(uuid)) { // Paper

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