Compile fixes (#2732)

This commit is contained in:
MiniDigger 2019-12-12 19:45:00 +01:00 committed by Shane Freeder
parent 44d032f1e9
commit d8a0622602
28 changed files with 155 additions and 136 deletions

View file

@ -1,4 +1,4 @@
From 11a54b9c272c9a901085423070c007850d6358d5 Mon Sep 17 00:00:00 2001
From 76350e71db13e90ec5c7bea7f2953edd181e825f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
@ -473,7 +473,7 @@ index 06360cf7c..8e8fab497 100644
// CraftBukkit end
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 000000000..c96f3ed17
index 000000000..628b73a12
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +1,316 @@
@ -660,7 +660,7 @@ index 000000000..c96f3ed17
+ * @return
+ */
+ public static double distanceSq(Entity e1, Entity e2) {
+ return distanceSq(e1.locX,e1.locY,e1.locZ, e2.locX,e2.locY,e2.locZ);
+ return distanceSq(e1.locX(),e1.locY(),e1.locZ(), e2.locX(),e2.locY(),e2.locZ());
+ }
+
+ /**
@ -715,7 +715,7 @@ index 000000000..c96f3ed17
+ * @return
+ */
+ public static Location toLocation(Entity entity) {
+ return new Location(entity.getWorld().getWorld(), entity.locX, entity.locY, entity.locZ);
+ return new Location(entity.getWorld().getWorld(), entity.locX(), entity.locY(), entity.locZ());
+ }
+
+ public static org.bukkit.block.Block toBukkitBlock(World world, BlockPosition pos) {
@ -1136,5 +1136,5 @@ index d8358a0f0..d0b813008 100644
+ // Paper end
}
--
2.24.0
2.24.1

View file

@ -1,4 +1,4 @@
From b458fdb658f363161232e689d2ec1ebf3fcbf8b5 Mon Sep 17 00:00:00 2001
From f4a32cb8e79a1b96763a49698efb4c47fbb8ee4f Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 13:02:51 -0600
Subject: [PATCH] Configurable cactus and reed natural growth heights
@ -23,7 +23,7 @@ index a73865739..098bd3fba 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 1e1d02dc7..4c82fe335 100644
index 1e1d02dc7..e0974e256 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -30,7 +30,7 @@ public class BlockCactus extends Block {
@ -31,12 +31,12 @@ index 1e1d02dc7..4c82fe335 100644
}
- if (i < 3) {
+ if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height
+ if (i < worldserver.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height
int j = (Integer) iblockdata.get(BlockCactus.AGE);
if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index 2106b0b49..baa2ed2b6 100644
index 2106b0b49..55b07444e 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -29,7 +29,7 @@ public class BlockReed extends Block {
@ -44,10 +44,10 @@ index 2106b0b49..baa2ed2b6 100644
}
- if (i < 3) {
+ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height
+ if (i < worldserver.paperConfig.reedMaxHeight) { // Paper - Configurable growth height
int j = (Integer) iblockdata.get(BlockReed.AGE);
if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot
--
2.24.0
2.17.1

View file

@ -1,4 +1,4 @@
From f96e4e8a051a837672fd544b7d4919fa87b9ab94 Mon Sep 17 00:00:00 2001
From 1c8294dac08d73849157f0321d30fe5eaca25e06 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 14:14:15 -0600
Subject: [PATCH] Drop falling block and tnt entities at the specified height
@ -36,7 +36,7 @@ index bf059dc86..2c36fc71c 100644
public EntityItem a(ItemStack itemstack, float f) {
if (itemstack.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 20cb7dbaf..d835b9f85 100644
index 20cb7dbaf..0342c873a 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -85,6 +85,16 @@ public class EntityFallingBlock extends Entity {
@ -45,7 +45,7 @@ index 20cb7dbaf..d835b9f85 100644
this.move(EnumMoveType.SELF, this.getMot());
+
+ // Paper start - Configurable EntityFallingBlock height nerf
+ if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperConfig.fallingBlockHeightNerf) {
+ if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY() > this.world.paperConfig.fallingBlockHeightNerf) {
+ if (this.dropItem && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
+ this.a(block);
+ }
@ -57,7 +57,7 @@ index 20cb7dbaf..d835b9f85 100644
blockposition = new BlockPosition(this);
boolean flag = this.block.getBlock() instanceof BlockConcretePowder;
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index d04212436..b92c8c47f 100644
index d04212436..33c51dced 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -54,6 +54,11 @@ public class EntityTNTPrimed extends Entity {
@ -65,13 +65,26 @@ index d04212436..b92c8c47f 100644
this.move(EnumMoveType.SELF, this.getMot());
+ // Paper start - Configurable TNT entity height nerf
+ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY > this.world.paperConfig.entityTNTHeightNerf) {
+ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY() > this.world.paperConfig.entityTNTHeightNerf) {
+ this.die();
+ }
+ // Paper end
this.setMot(this.getMot().a(0.98D));
if (this.onGround) {
this.setMot(this.getMot().d(0.7D, -0.5D, 0.7D));
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b26dff0a7..8d803dc68 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -830,7 +830,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setStatistic(Statistic statistic, EntityType entityType, int newValue) {
- Validate.notNull(statistic, "Statistic cannot be null");
+ Validate.notNull(statistic, "TNStatistic cannot be null");
Validate.notNull(entityType, "EntityType cannot be null");
Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0");
Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter");
--
2.24.0
2.17.1

View file

@ -1,4 +1,4 @@
From 54b3a7993832da083470c8918749a25d2ce762fb Mon Sep 17 00:00:00 2001
From 0fca532bd3ecf3a33d32ae4740192ea70fda6067 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 17 Apr 2016 17:27:09 -0400
Subject: [PATCH] Prevent Fire from loading chunks
@ -7,14 +7,14 @@ This causes the nether to spam unload/reload chunks, plus overall
bad behavior.
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
index 2909f78f8..9cf7d0b9e 100644
index 2909f78f8..0ece78d4d 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -163,6 +163,7 @@ public class BlockFire extends Block {
}
blockposition_mutableblockposition.g(blockposition).e(l, j1, i1);
+ if (!world.isLoaded(blockposition_mutableblockposition)) continue; // Paper
+ if (!worldserver.isLoaded(blockposition_mutableblockposition)) continue; // Paper
int l1 = this.a((IWorldReader) worldserver, (BlockPosition) blockposition_mutableblockposition);
if (l1 > 0) {
@ -53,5 +53,5 @@ index 2909f78f8..9cf7d0b9e 100644
}
--
2.24.0
2.17.1

View file

@ -1,4 +1,4 @@
From 446ab7ff2aba9834e4775dd86f62429fac2ef20d Mon Sep 17 00:00:00 2001
From 1eafa5490facbe5bf35b93d62c88f1fd38e0939a Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 22 May 2016 20:20:55 -0500
Subject: [PATCH] Optional TNT doesn't move in water
@ -49,7 +49,7 @@ index 2e56c7f57..e04b3f4e2 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 7625dca00..75193e87d 100644
index 346315acb..d3b2075f2 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -79,7 +79,27 @@ public class EntityTNTPrimed extends Entity {
@ -70,7 +70,7 @@ index 7625dca00..75193e87d 100644
+ PacketPlayOutEntityTeleport positionPacket = new PacketPlayOutEntityTeleport(this);
+
+ ete.trackedPlayers.stream()
+ .filter(viewer -> (viewer.locX - this.locX) * (viewer.locY - this.locY) * (viewer.locZ - this.locZ) < 16 * 16)
+ .filter(viewer -> (viewer.locX() - this.locX()) * (viewer.locY() - this.locY()) * (viewer.locZ() - this.locZ()) < 16 * 16)
+ .forEach(viewer -> {
+ viewer.playerConnection.sendPacket(velocityPacket);
+ viewer.playerConnection.sendPacket(positionPacket);

View file

@ -1,17 +1,17 @@
From 8071a5ef7c8dcdde949b15fef8891a6ec1fbf14e Mon Sep 17 00:00:00 2001
From 688be37d8d0128f2297bc067a3d06e713c2f3b6a Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 31 Jul 2016 16:33:03 -0500
Subject: [PATCH] Re-track players that dismount from other players
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 6595dca86..a9827322c 100644
index 6595dca86..ab8af05e7 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -979,6 +979,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (!this.isSpectator()) {
super.b(blockposition);
@@ -964,6 +964,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.playerConnection.a(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
}
+ // Paper start - "Fixes" an issue in which the vehicle player would not be notified that the passenger dismounted
+ if (entity instanceof EntityPlayer) {
+ // TODO verify this solution
@ -20,9 +20,17 @@ index 6595dca86..a9827322c 100644
+ worldServer.getChunkProvider().playerChunkMap.addEntity(this);
+ }
+ // Paper end
}
@Override
@@ -979,7 +987,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (!this.isSpectator()) {
super.b(blockposition);
}
-
}
public void a(double d0, boolean flag) {
--
2.17.1

View file

@ -1,4 +1,4 @@
From 33e34cbc44e672162a56cbb8daae4bf5028d5d59 Mon Sep 17 00:00:00 2001
From f54ca60d7f124a6a1628f7824a08050818fda2e2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 21 Sep 2016 23:48:39 -0400
Subject: [PATCH] Auto fix bad Y levels on player login
@ -6,14 +6,14 @@ Subject: [PATCH] Auto fix bad Y levels on player login
Bring down to a saner Y level if super high, as this can cause the server to crash
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index a9827322c..3e958eaf8 100644
index a9827322c..2582f76d3 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -193,6 +193,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
+ if (this.locY > 300) this.locY = 257; // Paper - bring down to a saner Y level if out of world
+ if (this.locY() > 300) this.setPositionRaw(locX(), 257, locZ()); // Paper - bring down to a saner Y level if out of world
if (nbttagcompound.hasKeyOfType("playerGameType", 99)) {
if (this.getMinecraftServer().getForceGamemode()) {
this.playerInteractManager.setGameMode(this.getMinecraftServer().getGamemode());

View file

@ -1,11 +1,11 @@
From aa46a8f287929842c58b58a76698f21363033112 Mon Sep 17 00:00:00 2001
From 0883f87742c431b54b81989cff832711eb2ef851 Mon Sep 17 00:00:00 2001
From: vemacs <d@nkmem.es>
Date: Wed, 23 Nov 2016 08:31:45 -0500
Subject: [PATCH] Cache user authenticator threads
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 3e958eaf8..bf74db31e 100644
index 2943918e4..caca40a0c 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
@ -50,7 +50,7 @@ index 3e958eaf8..bf74db31e 100644
this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(aint));
}
@@ -1299,7 +1308,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1298,7 +1307,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.lastHealthSent = -1.0F;
this.lastFoodSent = -1;
// this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit

View file

@ -1,4 +1,4 @@
From d53b09c688a512f440207e31541029476496d469 Mon Sep 17 00:00:00 2001
From d79301aeed703c330dcfac1c59d54135974ab30f Mon Sep 17 00:00:00 2001
From: Alfie Cleveland <alfeh@me.com>
Date: Tue, 27 Dec 2016 01:57:57 +0000
Subject: [PATCH] Properly fix item duplication bug
@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug
Credit to prplz for figuring out the real issue
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index bf74db31e..4e6601617 100644
index caca40a0c..6443e68f4 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1767,7 +1767,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1766,7 +1766,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
protected boolean isFrozen() {

View file

@ -1,4 +1,4 @@
From 72ec0195082095bf3f6043846e3450dd66f06963 Mon Sep 17 00:00:00 2001
From c9388d6d8ed70955b2c0765e9dae6ffa6a9650fc Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 20 Dec 2017 17:36:49 -0500
Subject: [PATCH] Ability to apply mending to XP API
@ -43,10 +43,10 @@ index b3edb69a9..87c6b77ce 100644
return i * 2;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index cade504af..c82de14eb 100644
index d47b982e7..6bdee24f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1047,8 +1047,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1047,8 +1047,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId());
}
@ -62,9 +62,7 @@ index cade504af..c82de14eb 100644
+ net.minecraft.server.EntityExperienceOrb orb = net.minecraft.server.EntityTypes.EXPERIENCE_ORB.create(handle.world);
+ orb.value = amount;
+ orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM;
+ orb.locX = handle.locX;
+ orb.locY = handle.locY;
+ orb.locZ = handle.locZ;
+ orb.setPositionRaw(handle.locX(), handle.locY(), handle.locZ());
+
+ int i = Math.min(orb.xpToDur(amount), itemstack.getDamage());
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, i);

View file

@ -1,4 +1,4 @@
From 77f5f5b6b827dea777daf452900e3aea606e3cbd Mon Sep 17 00:00:00 2001
From 092a93451181da9283c1131567c817f0177ed7ec Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 14 Jan 2018 17:01:31 -0500
Subject: [PATCH] PreCreatureSpawnEvent
@ -47,7 +47,7 @@ index 258e96ba5..fe8bc7f75 100644
entity1.setPositionRotation(d3, d4, d5, entity1.yaw, entity1.pitch);
return entity1;
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 02157d051..487114367 100644
index 02157d051..224443e03 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -38,7 +38,7 @@ public final class SpawnerCreature {
@ -69,7 +69,7 @@ index 02157d051..487114367 100644
+ org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityTypes.getName(cls).getKey());
+ if (type != null) {
+ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
+ MCUtil.toLocation(world, blockposition_mutableblockposition),
+ MCUtil.toLocation(worldserver, blockposition_mutableblockposition),
+ type, SpawnReason.NATURAL
+ );
+ if (!event.callEvent()) {

View file

@ -1,4 +1,4 @@
From f17990de6b39edf58fb96266d16b4492b731aa34 Mon Sep 17 00:00:00 2001
From 32e97804d1443bf400e5f0e28293bd5901044fd4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 18 Mar 2018 12:29:48 -0400
Subject: [PATCH] Player.setPlayerProfile API
@ -48,7 +48,7 @@ index 0614976b8..a985ae7ba 100644
uniqueId = i.getId();
// Paper end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c82de14eb..87b715d69 100644
index 6bdee24f8..e786641cc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,6 +1,8 @@
@ -60,7 +60,7 @@ index c82de14eb..87b715d69 100644
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.BaseEncoding;
@@ -1187,8 +1189,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1185,8 +1187,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
hiddenPlayers.put(player.getUniqueId(), hidingPlugins);
// Remove this player from the hidden player's EntityTrackerEntry
@ -75,7 +75,7 @@ index c82de14eb..87b715d69 100644
PlayerChunkMap.EntityTracker entry = tracker.trackedEntities.get(other.getId());
if (entry != null) {
entry.clear(getHandle());
@@ -1229,8 +1236,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1227,8 +1234,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
hiddenPlayers.remove(player.getUniqueId());
@ -90,7 +90,7 @@ index c82de14eb..87b715d69 100644
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other));
@@ -1239,6 +1251,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1237,6 +1249,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entry.updatePlayer(getHandle());
}
}

View file

@ -1,4 +1,4 @@
From 346d3423305d7f19d3e2d5a1da0d5cdf45a528bd Mon Sep 17 00:00:00 2001
From 708fcdaf3cb707f2d8ceeef9ee0afd71baaad221 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 31 Mar 2018 17:04:26 +0100
Subject: [PATCH] Flag to disable the channel limit
@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 87b715d69..4dc79ca4e 100644
index e786641cc..b3a2b7fea 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -138,6 +138,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -20,7 +20,7 @@ index 87b715d69..4dc79ca4e 100644
// Paper end
public CraftPlayer(CraftServer server, EntityPlayer entity) {
@@ -1453,7 +1454,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1451,7 +1452,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void addChannel(String channel) {

View file

@ -1,4 +1,4 @@
From 792aa8e22f2ae684c1c8e27c50142a186d44f4c4 Mon Sep 17 00:00:00 2001
From f25751b7d11157ad17eab03837a8fecec84c83a0 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 3 Jul 2018 21:56:23 -0400
Subject: [PATCH] InventoryCloseEvent Reason API
@ -34,7 +34,7 @@ index 3917980b7..007934d8c 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 4e6601617..bb2a0b7e6 100644
index 6443e68f4..850c7cc1b 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -362,7 +362,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -55,7 +55,7 @@ index 4e6601617..bb2a0b7e6 100644
}
String deathMessage = event.getDeathMessage();
@@ -1027,7 +1027,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1026,7 +1026,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return OptionalInt.empty();
} else {
if (this.activeContainer != this.defaultContainer) {
@ -64,7 +64,7 @@ index 4e6601617..bb2a0b7e6 100644
}
this.nextContainerCounter();
@@ -1087,7 +1087,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1086,7 +1086,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// CraftBukkit end
if (this.activeContainer != this.defaultContainer) {
@ -73,7 +73,7 @@ index 4e6601617..bb2a0b7e6 100644
}
// this.nextContainerCounter(); // CraftBukkit - moved up
@@ -1151,7 +1151,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1150,7 +1150,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
public void closeInventory() {
@ -155,7 +155,7 @@ index cd8ad2704..e169679c8 100644
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4dc79ca4e..e45dd6cd4 100644
index b3a2b7fea..61dbb31e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -780,7 +780,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -193,5 +193,5 @@ index 94fbac5e4..7967222d9 100644
human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity());
}
--
2.24.1
2.17.1

View file

@ -1,11 +1,11 @@
From 1cff7748d9053fd2e109b2ec39eeecc5bb0bc371 Mon Sep 17 00:00:00 2001
From 1bd8a641dc923c81dc47c642be0387b5c42f3168 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Mon, 3 Sep 2018 18:20:03 -0500
Subject: [PATCH] Add ray tracing methods to LivingEntity
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 91b6d6878..ac85a5d23 100644
index 91b6d6878..1592a705f 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -3252,6 +3252,23 @@ public abstract class EntityLiving extends Entity {
@ -21,7 +21,7 @@ index 91b6d6878..ac85a5d23 100644
+ throw new IllegalArgumentException("maxDistance must be between 1-120");
+ }
+
+ Vec3D start = new Vec3D(locX, locY + getHeadHeight(), locZ);
+ Vec3D start = new Vec3D(locX(), locY() + getHeadHeight(), locZ());
+ org.bukkit.util.Vector dir = getBukkitEntity().getLocation().getDirection().multiply(maxDistance);
+ Vec3D end = new Vec3D(start.x + dir.getX(), start.y + dir.getY(), start.z + dir.getZ());
+ RayTrace raytrace = new RayTrace(start, end, RayTrace.BlockCollisionOption.OUTLINE, fluidCollisionOption, this);
@ -66,5 +66,5 @@ index 379239567..6f4c6c589 100644
public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) {
return getLineOfSight(transparent, maxDistance, 2);
--
2.24.0
2.24.1

View file

@ -1,4 +1,4 @@
From 20af10901efba6851ec582004bb968ff7405c197 Mon Sep 17 00:00:00 2001
From 3590e4bd260d911e814106f2fb07e0ed215f4b15 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Tue, 4 Sep 2018 15:02:00 -0500
Subject: [PATCH] Expose attack cooldown methods for Player
@ -27,10 +27,10 @@ index 007934d8c..78e48f478 100644
this.aB = 0;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e45dd6cd4..9e0be10d7 100644
index 61dbb31e7..c6c392676 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1913,6 +1913,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1911,6 +1911,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getInventory().setItemInMainHand(hand);
}
@ -52,5 +52,5 @@ index e45dd6cd4..9e0be10d7 100644
private final Player.Spigot spigot = new Player.Spigot()
{
--
2.24.0
2.17.1

View file

@ -1,4 +1,4 @@
From 7b45772c16bd065ecea3697a44803236cf706216 Mon Sep 17 00:00:00 2001
From 88c1f7c439fe9eeccb0cb1cbb7b22dfc46885368 Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events
@ -119,7 +119,7 @@ index 80717ad9a..53aac5bcc 100644
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index ac85a5d23..c6bd68919 100644
index 1592a705f..78e4fe67d 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -89,7 +89,7 @@ public abstract class EntityLiving extends Entity {
@ -279,7 +279,7 @@ index ac85a5d23..c6bd68919 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 bb2a0b7e6..26096afbe 100644
index ca69f9038..139d19cde 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -357,10 +357,10 @@ index 90fdf89c8..b761a41dc 100644
this.minecraftKey = minecraftKey;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9e0be10d7..ad70bd5ba 100644
index c6c392676..05f380023 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1706,7 +1706,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1704,7 +1704,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void sendHealthUpdate() {

View file

@ -1,4 +1,4 @@
From bbf14ec267b75fbde5ce1f4ebc529c36e19c2717 Mon Sep 17 00:00:00 2001
From ebf53752a5a07cefac575ed2ea3f09bcb7501450 Mon Sep 17 00:00:00 2001
From: Trigary <trigary0@gmail.com>
Date: Fri, 14 Sep 2018 17:42:08 +0200
Subject: [PATCH] Limit lightning strike effect distance
@ -38,7 +38,7 @@ index e49318a19..fe3e78f36 100644
private void fixedInhabitedTime() {
if (PaperConfig.version < 16) {
diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java
index 7c518983a..0bd67395e 100644
index 7c518983a..bdb534deb 100644
--- a/src/main/java/net/minecraft/server/EntityLightning.java
+++ b/src/main/java/net/minecraft/server/EntityLightning.java
@@ -64,6 +64,17 @@ public class EntityLightning extends Entity {
@ -48,7 +48,7 @@ index 7c518983a..0bd67395e 100644
+ // Paper start - Limit lightning strike effect distance
+ if (distanceSquared <= this.world.paperConfig.sqrMaxLightningImpactSoundDistance) {
+ player.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT,
+ SoundCategory.WEATHER, this.locX, this.locY, this.locZ, 2.0f, 0.5F + this.random.nextFloat() * 0.2F));
+ SoundCategory.WEATHER, this.locX(), this.locY(), this.locZ(), 2.0f, 0.5F + this.random.nextFloat() * 0.2F));
+ }
+
+ if (world.paperConfig.sqrMaxThunderDistance != -1 && distanceSquared >= world.paperConfig.sqrMaxThunderDistance) {

View file

@ -1,11 +1,11 @@
From c3dbf581a251e2eef711756f72f023013dae9245 Mon Sep 17 00:00:00 2001
From 8de1621abf5b2c62d7370831f711c0544ad9829c Mon Sep 17 00:00:00 2001
From: Caleb Bassham <caleb.bassham@gmail.com>
Date: Fri, 28 Sep 2018 02:32:19 -0500
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 26096afbe..bdb73b68a 100644
index 51b3acadb..9b1758303 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -60,7 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -17,7 +17,7 @@ index 26096afbe..bdb73b68a 100644
public boolean worldChangeInvuln;
private boolean cm; private void setHasSeenCredits(boolean has) { this.cm = has; } // Paper - OBFHELPER
private final RecipeBookServer recipeBook;
@@ -1556,15 +1556,35 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1555,15 +1555,35 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity);
}
@ -58,7 +58,7 @@ index 26096afbe..bdb73b68a 100644
}
@Override
@@ -1572,7 +1592,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1571,7 +1591,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (this.portalCooldown > 0 && !this.worldChangeInvuln) {
--this.portalCooldown;
}

View file

@ -1,4 +1,4 @@
From fe691a23845cf0576a6a8e257623a97a102876bb Mon Sep 17 00:00:00 2001
From 7d91c54dad37261266ba5ae2e7e369b70fd20ba6 Mon Sep 17 00:00:00 2001
From: GreenMeanie <GreenMeanieMC@gmail.com>
Date: Sat, 20 Oct 2018 22:34:02 -0400
Subject: [PATCH] Reset players airTicks on respawn
@ -17,10 +17,10 @@ index 5d31068d7..365984bb8 100644
return 300;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index bdb73b68a..c15543a5c 100644
index 9b1758303..c467ca356 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1832,6 +1832,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1831,6 +1831,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
this.setHealth(this.getMaxHealth());

View file

@ -1,4 +1,4 @@
From b4e64a666d6bf724ad14dd41c6a2dd510080066d Mon Sep 17 00:00:00 2001
From 258afe1d3af26813306c091e0c8012fc1450a569 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Wed, 2 Jan 2019 00:35:43 -0600
Subject: [PATCH] Add APIs to replace OfflinePlayer#getLastPlayed
@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f41fd576d..1665a302a 100644
index 64992e139..ad600c318 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -75,6 +75,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -106,7 +106,7 @@ index c1ef1c950..3824180ee 100644
public Location getBedSpawnLocation() {
NBTTagCompound data = getData();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ad70bd5ba..04fc8e233 100644
index 05f380023..67a960616 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -139,6 +139,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -117,7 +117,7 @@ index ad70bd5ba..04fc8e233 100644
// Paper end
public CraftPlayer(CraftServer server, EntityPlayer entity) {
@@ -1357,6 +1358,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1355,6 +1356,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed;
}
@ -136,7 +136,7 @@ index ad70bd5ba..04fc8e233 100644
public void readExtraData(NBTTagCompound nbttagcompound) {
hasPlayedBefore = true;
if (nbttagcompound.hasKey("bukkit")) {
@@ -1379,6 +1392,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1377,6 +1390,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setExtraData(NBTTagCompound nbttagcompound) {
@ -145,7 +145,7 @@ index ad70bd5ba..04fc8e233 100644
if (!nbttagcompound.hasKey("bukkit")) {
nbttagcompound.set("bukkit", new NBTTagCompound());
}
@@ -1393,6 +1408,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1391,6 +1406,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.setLong("firstPlayed", getFirstPlayed());
data.setLong("lastPlayed", System.currentTimeMillis());
data.setString("lastKnownName", handle.getName());

View file

@ -1,14 +1,14 @@
From 30cdc7bfec8a09f2ea963c30f8bb5eb46456e1a7 Mon Sep 17 00:00:00 2001
From 0bedd55ef9732090f7f853a3f78e38726522ba10 Mon Sep 17 00:00:00 2001
From: connorhartley <vectrixu+gh@gmail.com>
Date: Mon, 7 Jan 2019 14:43:48 -0600
Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 1665a302a..cc9e69651 100644
index 0f8e0e81e..ac032c0ed 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1261,6 +1261,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1260,6 +1260,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void n() {
this.cq = true;
this.ejectPassengers();

View file

@ -1,4 +1,4 @@
From 830cd5873ebed9e73f0216f8fedf7d2bd04224e4 Mon Sep 17 00:00:00 2001
From 8b6d5725bfd52f3a65c23c7e60e8c409dd5319f8 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Mon, 4 Feb 2019 23:33:24 -0500
Subject: [PATCH] Block Entity#remove from being called on Players
@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
be unintentional in the few cases we've seen so far.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 04fc8e233..4b847ddd8 100644
index 67a960616..b176b2346 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1958,6 +1958,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1956,6 +1956,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetCooldown() {
getHandle().resetCooldown();
}
@ -32,5 +32,5 @@ index 04fc8e233..4b847ddd8 100644
// Spigot start
--
2.24.1
2.17.1

View file

@ -1,4 +1,4 @@
From d5f010e8360f67f7b54f41e19be07f238fee2896 Mon Sep 17 00:00:00 2001
From 64338f14b0ce74b1b8d53d996cb08ca4ba984966 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Mon, 6 May 2019 01:29:25 -0400
Subject: [PATCH] Per-Player View Distance API placeholders
@ -39,10 +39,10 @@ index 2e95069c1..8977c3516 100644
double deltaX = this.locX() - player.locX();
double deltaZ = this.locZ() - player.locZ();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4b847ddd8..049ebf4c4 100644
index b176b2346..5603ed126 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1967,6 +1967,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1965,6 +1965,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
super.remove();
}
}
@ -60,5 +60,5 @@ index 4b847ddd8..049ebf4c4 100644
// Spigot start
--
2.24.1
2.17.1

View file

@ -1,4 +1,4 @@
From 1126822c11025916fb4dc7d2d43da654baa53c60 Mon Sep 17 00:00:00 2001
From 7aeff3196542cd822a56ef1006e087cf48cacbaa Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 1 Jun 2019 13:00:55 -0700
Subject: [PATCH] Chunk debug command
@ -198,7 +198,7 @@ index 038b7b68d..9b2bafdbd 100644
public final ChunkGenerator<?> chunkGenerator;
private final WorldServer world;
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index ec3732193..23d1935dd 100644
index d49e210a3..25a87c2d3 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -4,7 +4,13 @@ import com.destroystokyo.paper.block.TargetBlockInfo;
@ -334,9 +334,9 @@ index ec3732193..23d1935dd 100644
+ JsonObject playerData = new JsonObject();
+
+ playerData.addProperty("name", player.getName());
+ playerData.addProperty("x", player.locX);
+ playerData.addProperty("y", player.locY);
+ playerData.addProperty("z", player.locZ);
+ playerData.addProperty("x", player.locX());
+ playerData.addProperty("y", player.locY());
+ playerData.addProperty("z", player.locZ());
+
+ playersData.add(playerData);
+

View file

@ -1,4 +1,4 @@
From 9dd828c0ae7071fcab9994e1c2e8c35c2b46b132 Mon Sep 17 00:00:00 2001
From 5772233362f877a05c3f2ac98a102723e701ea65 Mon Sep 17 00:00:00 2001
From: stonar96 <minecraft.stonar96@gmail.com>
Date: Mon, 20 Aug 2018 03:03:58 +0200
Subject: [PATCH] Anti-Xray
@ -1440,7 +1440,7 @@ index e156804f7..96a785af2 100644
public void a() {
this.o();
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 47710067a..654474341 100644
index 47710067a..ef7ade797 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -1,5 +1,6 @@
@ -1490,23 +1490,27 @@ index 47710067a..654474341 100644
this.g = Lists.newArrayList();
iterator = chunk.getTileEntities().entrySet().iterator();
int totalSigns = 0; // Paper
@@ -82,7 +97,15 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@@ -81,9 +96,19 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
this.g.add(nbttagcompound);
}
}
+ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // Paper - Anti-Xray - Modify blocks
+ }
+ // Paper start - Async-Anti-Xray - Getter and Setter for the ready flag
+ public boolean isReady() {
+ return this.ready;
+ }
+
}
+ public void setReady(boolean ready) {
+ this.ready = ready;
}
+ }
+ // Paper end
+
@Override
public void a(PacketDataSerializer packetdataserializer) throws IOException {
@@ -150,6 +173,11 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
this.a = packetdataserializer.readInt();
@@ -150,6 +175,11 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
public int writeChunk(PacketDataSerializer packetDataSerializer, Chunk chunk, int chunkSectionSelector) { return this.a(packetDataSerializer, chunk, chunkSectionSelector); } // Paper - OBFHELPER
public int a(PacketDataSerializer packetdataserializer, Chunk chunk, int i) {
@ -1518,7 +1522,7 @@ index 47710067a..654474341 100644
int j = 0;
ChunkSection[] achunksection = chunk.getSections();
int k = 0;
@@ -159,9 +187,12 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@@ -159,7 +189,8 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
if (chunksection != Chunk.a && (!this.f() || !chunksection.c()) && (i & 1 << k) != 0) {
j |= 1 << k;
@ -1527,11 +1531,7 @@ index 47710067a..654474341 100644
+ chunksection.getBlocks().writeDataPaletteBlock(packetdataserializer, chunkPacketInfo, k); // Paper - Anti-Xray - Add chunk packet info
}
}
+ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // Paper - Anti-Xray - Modify blocks
+ }
return j;
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 43d9a5634..615d27863 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java

View file

@ -1,4 +1,4 @@
From 3fae95d22e640e7029c5a134c308f1a677c17b85 Mon Sep 17 00:00:00 2001
From e091c4269f0c72f45f9a3de946e7777bc83933d0 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Mon, 19 Aug 2019 01:27:58 +0500
Subject: [PATCH] implement optional per player mob spawns
@ -601,7 +601,7 @@ index f138b112f..109c6ada8 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index ca2398386..19ba79c65 100644
index fc3cb17e6..c9492ed37 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -80,6 +80,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -624,7 +624,7 @@ index ca2398386..19ba79c65 100644
}
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
@@ -1736,6 +1742,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1735,6 +1741,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
@ -645,7 +645,7 @@ index d49ad0308..2fb04e3e9 100644
return this.bb;
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index fc6436c4f..67a909859 100644
index fc6436c4f..9915c2443 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -78,7 +78,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -669,8 +669,8 @@ index fc6436c4f..67a909859 100644
+ if (!this.world.paperConfig.perPlayerMobSpawns) {
+ return;
+ }
+ int chunkX = (int)Math.floor(entity.locX) >> 4;
+ int chunkZ = (int)Math.floor(entity.locZ) >> 4;
+ int chunkX = (int)Math.floor(entity.locX()) >> 4;
+ int chunkZ = (int)Math.floor(entity.locZ()) >> 4;
+ int index = entity.getEntityType().getEnumCreatureType().ordinal();
+
+ for (EntityPlayer player : this.playerMobDistanceMap.getPlayersInRange(chunkX, chunkZ)) {
@ -684,7 +684,7 @@ index fc6436c4f..67a909859 100644
private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index bcca7faed..57ce02a97 100644
index e168c528c..56dabbc15 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -3,6 +3,7 @@ package net.minecraft.server;
@ -802,5 +802,5 @@ index 7b89b509a..fd42390d4 100644
@Override
--
2.24.1
2.17.1

View file

@ -1,4 +1,4 @@
From 8dde5baf395c8b4ee38e7908a3831db9539829d4 Mon Sep 17 00:00:00 2001
From b94bbd71db373ef1099062dc8a7a046675a85e58 Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Sun, 15 Sep 2019 11:32:32 -0500
Subject: [PATCH] Fix zero-tick instant grow farms MC-113809
@ -45,31 +45,31 @@ index c482aad3e..02c548dd9 100644
int i = this.b(worldserver, blockposition) + 1;
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 4c82fe335..728491dd9 100644
index 4c82fe335..44ce67eb8 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -21,6 +21,7 @@ public class BlockCactus extends Block {
if (!iblockdata.canPlace(worldserver, blockposition)) {
worldserver.b(blockposition, true);
} else {
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
+ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
BlockPosition blockposition1 = blockposition.up();
if (worldserver.isEmpty(blockposition1)) {
diff --git a/src/main/java/net/minecraft/server/BlockChorusFlower.java b/src/main/java/net/minecraft/server/BlockChorusFlower.java
index d70b52cad..ff0ba15f8 100644
index d70b52cad..b624cf380 100644
--- a/src/main/java/net/minecraft/server/BlockChorusFlower.java
+++ b/src/main/java/net/minecraft/server/BlockChorusFlower.java
@@ -22,6 +22,7 @@ public class BlockChorusFlower extends Block {
if (!iblockdata.canPlace(worldserver, blockposition)) {
worldserver.b(blockposition, true);
} else {
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
+ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
BlockPosition blockposition1 = blockposition.up();
if (worldserver.isEmpty(blockposition1) && blockposition1.getY() < 256) {
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index baa2ed2b6..083b7ee59 100644
index 55b07444e..3bc3c5aa2 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -23,6 +23,7 @@ public class BlockReed extends Block {
@ -95,5 +95,5 @@ index fd42390d4..4c53f8063 100644
}
--
2.24.1
2.17.1