summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/BlockCake.patch2
-rw-r--r--nms-patches/BlockCauldron.patch12
-rw-r--r--nms-patches/BlockMagma.patch2
-rw-r--r--nms-patches/ContainerAnvil.patch12
-rw-r--r--nms-patches/DedicatedServer.patch2
-rw-r--r--nms-patches/Enchantment.patch2
-rw-r--r--nms-patches/Entity.patch96
-rw-r--r--nms-patches/EntityFireworks.patch10
-rw-r--r--nms-patches/EntityFishingHook.patch17
-rw-r--r--nms-patches/EntityHuman.patch22
-rw-r--r--nms-patches/EntityPig.patch4
-rw-r--r--nms-patches/EntityPlayer.patch52
-rw-r--r--nms-patches/EntityPotion.patch4
-rw-r--r--nms-patches/EntityTippedArrow.patch4
-rw-r--r--nms-patches/EntityWither.patch6
-rw-r--r--nms-patches/HandshakeListener.patch4
-rw-r--r--nms-patches/ItemFishingRod.patch12
-rw-r--r--nms-patches/ItemMonsterEgg.patch4
-rw-r--r--nms-patches/MobSpawnerAbstract.patch2
-rw-r--r--nms-patches/PlayerConnection.patch260
-rw-r--r--nms-patches/PlayerList.patch84
-rw-r--r--nms-patches/RecipesFurnace.patch8
-rw-r--r--nms-patches/TileEntity.patch2
-rw-r--r--nms-patches/World.patch63
-rw-r--r--nms-patches/WorldNBTStorage.patch4
-rw-r--r--nms-patches/WorldServer.patch6
26 files changed, 364 insertions, 332 deletions
diff --git a/nms-patches/BlockCake.patch b/nms-patches/BlockCake.patch
index a588357c..80b0801d 100644
--- a/nms-patches/BlockCake.patch
+++ b/nms-patches/BlockCake.patch
@@ -3,7 +3,7 @@
@@ -40,7 +40,18 @@
return false;
} else {
- entityhuman.b(StatisticList.J);
+ entityhuman.b(StatisticList.H);
- entityhuman.getFoodData().eat(2, 0.1F);
+ // CraftBukkit start
+ // entityhuman.getFoodData().eat(2, 0.1F);
diff --git a/nms-patches/BlockCauldron.patch b/nms-patches/BlockCauldron.patch
index a21ef981..2f79cc98 100644
--- a/nms-patches/BlockCauldron.patch
+++ b/nms-patches/BlockCauldron.patch
@@ -35,7 +35,7 @@
entityhuman.a(enumhand, new ItemStack(Items.BUCKET));
}
- entityhuman.b(StatisticList.K);
+ entityhuman.b(StatisticList.I);
- this.a(world, blockposition, iblockdata, 3);
+ // this.a(world, blockposition, iblockdata, 3);
+ // CraftBukkit end
@@ -55,7 +55,7 @@
@@ -82,7 +97,8 @@
}
- entityhuman.b(StatisticList.L);
+ entityhuman.b(StatisticList.J);
- this.a(world, blockposition, iblockdata, 0);
+ // this.a(world, blockposition, iblockdata, 0);
+ // CraftBukkit end
@@ -72,7 +72,7 @@
+ }
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1 = PotionUtil.a(new ItemStack(Items.POTION), Potions.b);
- entityhuman.b(StatisticList.L);
+ entityhuman.b(StatisticList.J);
@@ -106,12 +126,17 @@
}
@@ -91,7 +91,7 @@
+ }
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1 = new ItemStack(Items.GLASS_BOTTLE);
- entityhuman.b(StatisticList.L);
+ entityhuman.b(StatisticList.J);
@@ -122,7 +147,8 @@
}
@@ -114,7 +114,7 @@
- this.a(world, blockposition, iblockdata, i - 1);
+ // this.a(world, blockposition, iblockdata, i - 1);
+ // CraftBukkit end
- entityhuman.b(StatisticList.M);
+ entityhuman.b(StatisticList.K);
return true;
}
@@ -140,13 +171,18 @@
@@ -128,7 +128,7 @@
itemstack1 = itemstack.cloneItemStack();
itemstack1.setCount(1);
TileEntityBanner.c(itemstack1);
- entityhuman.b(StatisticList.N);
+ entityhuman.b(StatisticList.L);
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack.subtract(1);
- this.a(world, blockposition, iblockdata, i - 1);
diff --git a/nms-patches/BlockMagma.patch b/nms-patches/BlockMagma.patch
index 6c73106b..75f5fbad 100644
--- a/nms-patches/BlockMagma.patch
+++ b/nms-patches/BlockMagma.patch
@@ -3,7 +3,7 @@
@@ -17,7 +17,9 @@
public void stepOn(World world, BlockPosition blockposition, Entity entity) {
- if (!entity.isFireProof() && entity instanceof EntityLiving && !EnchantmentManager.j((EntityLiving) entity)) {
+ if (!entity.isFireProof() && entity instanceof EntityLiving && !EnchantmentManager.i((EntityLiving) entity)) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); // CraftBukkit
entity.damageEntity(DamageSource.HOT_FLOOR, 1.0F);
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
diff --git a/nms-patches/ContainerAnvil.patch b/nms-patches/ContainerAnvil.patch
index 27ce994b..967b3103 100644
--- a/nms-patches/ContainerAnvil.patch
+++ b/nms-patches/ContainerAnvil.patch
@@ -28,7 +28,7 @@
this.j = blockposition;
this.i = world;
this.m = entityhuman;
-@@ -110,7 +119,7 @@
+@@ -117,7 +126,7 @@
byte b1 = 0;
if (itemstack.isEmpty()) {
@@ -37,7 +37,7 @@
this.a = 0;
} else {
ItemStack itemstack1 = itemstack.cloneItemStack();
-@@ -128,7 +137,7 @@
+@@ -140,7 +149,7 @@
if (itemstack1.f() && itemstack1.getItem().a(itemstack, itemstack2)) {
k = Math.min(itemstack1.i(), itemstack1.k() / 4);
if (k <= 0) {
@@ -46,7 +46,7 @@
this.a = 0;
return;
}
-@@ -143,7 +152,7 @@
+@@ -155,7 +164,7 @@
this.k = l;
} else {
if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.f())) {
@@ -55,7 +55,7 @@
this.a = 0;
return;
}
-@@ -270,7 +279,7 @@
+@@ -292,7 +301,7 @@
EnchantmentManager.a(map, itemstack1);
}
@@ -64,7 +64,7 @@
this.b();
}
}
-@@ -295,6 +304,7 @@
+@@ -317,6 +326,7 @@
}
public boolean a(EntityHuman entityhuman) {
@@ -72,7 +72,7 @@
return this.i.getType(this.j).getBlock() != Blocks.ANVIL ? false : entityhuman.d((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
}
-@@ -350,4 +360,29 @@
+@@ -372,4 +382,29 @@
this.e();
}
diff --git a/nms-patches/DedicatedServer.patch b/nms-patches/DedicatedServer.patch
index dc698b69..86d2a4d8 100644
--- a/nms-patches/DedicatedServer.patch
+++ b/nms-patches/DedicatedServer.patch
@@ -98,7 +98,7 @@
+
thread.setDaemon(true);
thread.start();
- DedicatedServer.LOGGER.info("Starting minecraft server version 1.11");
+ DedicatedServer.LOGGER.info("Starting minecraft server version 1.11.1");
@@ -78,7 +125,7 @@
}
diff --git a/nms-patches/Enchantment.patch b/nms-patches/Enchantment.patch
index 0f15da1d..cdfad14a 100644
--- a/nms-patches/Enchantment.patch
+++ b/nms-patches/Enchantment.patch
@@ -9,7 +9,7 @@
}
@Nullable
-@@ -149,6 +149,11 @@
+@@ -154,6 +154,11 @@
Enchantment.enchantments.a(62, new MinecraftKey("lure"), new EnchantmentLure(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
Enchantment.enchantments.a(70, new MinecraftKey("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
Enchantment.enchantments.a(71, new MinecraftKey("vanishing_curse"), new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values()));
diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch
index e4236955..5a0f4157 100644
--- a/nms-patches/Entity.patch
+++ b/nms-patches/Entity.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/Entity.java
+++ b/net/minecraft/server/Entity.java
-@@ -15,8 +15,48 @@
+@@ -16,8 +16,48 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -49,17 +49,17 @@
private static final Logger a = LogManager.getLogger();
private static final List<ItemStack> b = Collections.emptyList();
private static final AxisAlignedBB c = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
-@@ -98,6 +138,9 @@
- public boolean glowing;
- private final Set<String> aG;
+@@ -101,6 +141,9 @@
private boolean aH;
+ private double[] aI;
+ private long aJ;
+ public boolean valid; // CraftBukkit
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
+ public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
public Entity(World world) {
this.id = Entity.entityCount++;
-@@ -202,6 +245,33 @@
+@@ -206,6 +249,33 @@
}
protected void setYawPitch(float f, float f1) {
@@ -93,7 +93,7 @@
this.yaw = f % 360.0F;
this.pitch = f1 % 360.0F;
}
-@@ -245,7 +315,7 @@
+@@ -249,7 +319,7 @@
if (this.ak) {
MinecraftServer minecraftserver = this.world.getMinecraftServer();
@@ -102,7 +102,7 @@
if (!this.isPassenger()) {
int i = this.V();
-@@ -330,6 +400,27 @@
+@@ -334,6 +404,27 @@
protected void burnFromLava() {
if (!this.fireProof) {
this.damageEntity(DamageSource.LAVA, 4.0F);
@@ -130,7 +130,7 @@
this.setOnFire(15);
}
}
-@@ -370,6 +461,22 @@
+@@ -374,6 +465,22 @@
this.a(this.getBoundingBox().d(d0, d1, d2));
this.recalcPosition();
} else {
@@ -150,28 +150,28 @@
+ return;
+ }
+ // CraftBukkit end
- this.world.methodProfiler.a("move");
- double d3 = this.locX;
- double d4 = this.locY;
-@@ -470,7 +577,7 @@
+ if (enummovetype == EnumMoveType.PISTON) {
+ long i = this.world.getTime();
+
+@@ -515,7 +622,7 @@
}
}
-- boolean flag1 = this.onGround || d1 != d1 && d1 < 0.0D;
-+ boolean flag1 = this.onGround || d1 != d7 && d1 < 0.0D; // CraftBukkit - decompile error
- double d10;
+- boolean flag = this.onGround || d1 != d1 && d1 < 0.0D;
++ boolean flag = this.onGround || d1 != d8 && d1 < 0.0D; // CraftBukkit - decompile error
+ double d11;
- if (this.P > 0.0F && flag1 && (d6 != d0 || d8 != d2)) {
-@@ -568,7 +675,7 @@
+ if (this.P > 0.0F && flag && (d7 != d0 || d9 != d2)) {
+@@ -613,7 +720,7 @@
this.world.methodProfiler.a("rest");
this.recalcPosition();
- this.positionChanged = d6 != d0 || d8 != d2;
+ this.positionChanged = d7 != d0 || d9 != d2;
- this.B = d1 != d1;
-+ this.B = d1 != d7; // CraftBukkit - decompile error
- this.onGround = this.B && d7 < 0.0D;
++ this.B = d1 != d8; // CraftBukkit - decompile error
+ this.onGround = this.B && d8 < 0.0D;
this.C = this.positionChanged || this.B;
- j = MathHelper.floor(this.locX);
-@@ -603,6 +710,28 @@
+ l = MathHelper.floor(this.locX);
+@@ -648,6 +755,28 @@
block1.a(this.world, this);
}
@@ -197,10 +197,10 @@
+ }
+ // CraftBukkit end
+
- if (this.playStepSound() && !flag && !this.isPassenger()) {
- double d21 = this.locX - d3;
- double d22 = this.locY - d4;
-@@ -634,6 +763,8 @@
+ if (this.playStepSound() && (!this.onGround || !this.isSneaking() || !(this instanceof EntityHuman)) && !this.isPassenger()) {
+ double d22 = this.locX - d4;
+ double d23 = this.locY - d5;
+@@ -683,6 +812,8 @@
}
}
@@ -209,17 +209,17 @@
try {
this.checkBlockCollisions();
} catch (Throwable throwable) {
-@@ -643,6 +774,8 @@
+@@ -692,6 +823,8 @@
this.appendEntityCrashDetails(crashreportsystemdetails);
throw new ReportedException(crashreport);
}
+ */
+ // CraftBukkit end
- boolean flag2 = this.ai();
+ boolean flag1 = this.ai();
-@@ -651,7 +784,14 @@
- if (!flag2) {
+@@ -700,7 +833,14 @@
+ if (!flag1) {
++this.fireTicks;
if (this.fireTicks == 0) {
- this.setOnFire(8);
@@ -234,7 +234,7 @@
}
}
} else if (this.fireTicks <= 0) {
-@@ -772,7 +912,7 @@
+@@ -821,7 +961,7 @@
return null;
}
@@ -243,7 +243,7 @@
if (!this.fireProof) {
this.damageEntity(DamageSource.FIRE, (float) i);
}
-@@ -938,6 +1078,13 @@
+@@ -991,6 +1131,13 @@
}
public void spawnIn(World world) {
@@ -257,7 +257,7 @@
this.world = world;
}
-@@ -1170,6 +1317,18 @@
+@@ -1223,6 +1370,18 @@
try {
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ}));
nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));
@@ -276,7 +276,7 @@
nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch}));
nbttagcompound.setFloat("FallDistance", this.fallDistance);
nbttagcompound.setShort("Fire", (short) this.fireTicks);
-@@ -1179,6 +1338,12 @@
+@@ -1232,6 +1391,12 @@
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
nbttagcompound.a("UUID", this.getUniqueID());
@@ -289,7 +289,7 @@
if (this.hasCustomName()) {
nbttagcompound.setString("CustomName", this.getCustomName());
}
-@@ -1254,6 +1419,8 @@
+@@ -1307,6 +1472,8 @@
this.motX = nbttaglist1.e(0);
this.motY = nbttaglist1.e(1);
this.motZ = nbttaglist1.e(2);
@@ -298,7 +298,7 @@
if (Math.abs(this.motX) > 10.0D) {
this.motX = 0.0D;
}
-@@ -1265,6 +1432,7 @@
+@@ -1318,6 +1485,7 @@
if (Math.abs(this.motZ) > 10.0D) {
this.motZ = 0.0D;
}
@@ -306,7 +306,7 @@
this.locX = nbttaglist.e(0);
this.locY = nbttaglist.e(1);
-@@ -1322,6 +1490,58 @@
+@@ -1375,6 +1543,58 @@
this.setPosition(this.locX, this.locY, this.locZ);
}
@@ -365,7 +365,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
-@@ -1389,6 +1609,12 @@
+@@ -1442,6 +1662,12 @@
if (itemstack.isEmpty()) {
return null;
} else {
@@ -378,7 +378,7 @@
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
entityitem.q();
-@@ -1514,6 +1740,24 @@
+@@ -1567,6 +1793,24 @@
if (entity.bB() != this) {
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
} else {
@@ -403,7 +403,7 @@
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bw() instanceof EntityHuman)) {
this.passengers.add(0, entity);
} else {
-@@ -1527,6 +1771,22 @@
+@@ -1580,6 +1824,22 @@
if (entity.bB() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else {
@@ -426,7 +426,7 @@
this.passengers.remove(entity);
entity.j = 60;
}
-@@ -1666,14 +1926,48 @@
+@@ -1719,14 +1979,48 @@
}
public void setAirTicks(int i) {
@@ -478,7 +478,7 @@
}
}
-@@ -1818,19 +2112,67 @@
+@@ -1871,19 +2165,67 @@
if (!this.world.isClientSide && !this.dead) {
this.world.methodProfiler.a("changeDimension");
MinecraftServer minecraftserver = this.B_();
@@ -549,7 +549,7 @@
BlockPosition blockposition;
if (i == 1) {
-@@ -1859,12 +2201,18 @@
+@@ -1912,12 +2254,18 @@
blockposition = new BlockPosition(this);
}
@@ -569,7 +569,7 @@
if (j == 1 && i == 1) {
BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn());
-@@ -1872,6 +2220,7 @@
+@@ -1925,6 +2273,7 @@
} else {
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
}
@@ -577,7 +577,7 @@
boolean flag = entity.attachedToPlayer;
-@@ -1879,6 +2228,14 @@
+@@ -1932,6 +2281,14 @@
worldserver1.addEntity(entity);
entity.attachedToPlayer = flag;
worldserver1.entityJoinedWorld(entity, false);
@@ -592,7 +592,7 @@
}
this.dead = true;
-@@ -1989,6 +2346,11 @@
+@@ -2042,6 +2399,11 @@
}
public void setCustomName(String s) {
@@ -604,7 +604,7 @@
this.datawatcher.set(Entity.aA, s);
}
-@@ -2046,7 +2408,26 @@
+@@ -2099,7 +2461,26 @@
}
public void a(AxisAlignedBB axisalignedbb) {
@@ -632,7 +632,7 @@
}
public float getHeadHeight() {
-@@ -2220,7 +2601,7 @@
+@@ -2273,7 +2654,7 @@
for (Iterator iterator = this.bx().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
entity = (Entity) iterator.next();
if (oclass.isAssignableFrom(entity.getClass())) {
diff --git a/nms-patches/EntityFireworks.patch b/nms-patches/EntityFireworks.patch
index 8a06d7bb..9575d172 100644
--- a/nms-patches/EntityFireworks.patch
+++ b/nms-patches/EntityFireworks.patch
@@ -1,11 +1,17 @@
--- a/net/minecraft/server/EntityFireworks.java
+++ b/net/minecraft/server/EntityFireworks.java
-@@ -77,7 +77,7 @@
+@@ -117,8 +117,12 @@
}
if (!this.world.isClientSide && this.ticksFlown > this.expectedLifespan) {
- this.world.broadcastEntityEffect(this, (byte) 17);
-+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) this.world.broadcastEntityEffect(this, (byte) 17); // CraftBukkit
+- this.k();
++ // CraftBukkit start
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) {
++ this.world.broadcastEntityEffect(this, (byte) 17);
++ this.k();
++ }
++ // CraftBukkit end
this.die();
}
diff --git a/nms-patches/EntityFishingHook.patch b/nms-patches/EntityFishingHook.patch
index 7b0fbc62..65113404 100644
--- a/nms-patches/EntityFishingHook.patch
+++ b/nms-patches/EntityFishingHook.patch
@@ -12,7 +12,7 @@
public class EntityFishingHook extends Entity {
-@@ -251,6 +256,7 @@
+@@ -261,6 +266,7 @@
}
if (movingobjectposition != null && movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.MISS) {
@@ -20,7 +20,7 @@
if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
this.hooked = movingobjectposition.entity;
this.s();
-@@ -283,6 +289,10 @@
+@@ -293,6 +299,10 @@
if (this.g <= 0) {
this.h = 0;
this.at = 0;
@@ -31,7 +31,7 @@
} else {
this.motY -= 0.2D * (double) this.random.nextFloat() * (double) this.random.nextFloat();
}
-@@ -318,6 +328,13 @@
+@@ -328,6 +338,13 @@
worldserver.a(EnumParticle.WATER_WAKE, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D, new int[0]);
}
} else {
@@ -45,7 +45,7 @@
this.motY = (double) (-0.4F * MathHelper.a(this.random, 0.6F, 1.0F));
this.a(SoundEffects.H, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
double d3 = this.getBoundingBox().b + 0.5D;
-@@ -374,6 +391,14 @@
+@@ -384,6 +401,14 @@
int i = 0;
if (this.hooked != null) {
@@ -60,7 +60,7 @@
this.k();
this.world.broadcastEntityEffect(this, (byte) 31);
i = this.hooked instanceof EntityItem ? 3 : 5;
-@@ -386,6 +411,15 @@
+@@ -396,6 +421,15 @@
while (iterator.hasNext()) {
ItemStack itemstack = (ItemStack) iterator.next();
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
@@ -76,7 +76,7 @@
double d0 = this.owner.locX - this.locX;
double d1 = this.owner.locY - this.locY;
double d2 = this.owner.locZ - this.locZ;
-@@ -396,15 +430,36 @@
+@@ -406,7 +440,11 @@
entityitem.motY = d1 * 0.1D + (double) MathHelper.sqrt(d3) * 0.08D;
entityitem.motZ = d2 * 0.1D;
this.world.addEntity(entityitem);
@@ -86,9 +86,10 @@
+ this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, playerFishEvent.getExpToDrop()));
+ }
+ // CraftBukkit end
- }
+ Item item = itemstack.getItem();
- i = 1;
+ if (item == Items.FISH || item == Items.COOKED_FISH) {
+@@ -418,8 +456,25 @@
}
if (this.isInGround) {
diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch
index 19bc4b5f..fce5fd79 100644
--- a/nms-patches/EntityHuman.patch
+++ b/nms-patches/EntityHuman.patch
@@ -274,20 +274,20 @@
}
}
-@@ -945,8 +1043,11 @@
+@@ -946,8 +1044,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.r(entityliving) && this.h(entityliving) < 9.0D) {
+ // CraftBukkit start - Only apply knockback if the damage hits
-+ if (entityliving.damageEntity(DamageSource.playerAttack(this), 1.0F)) {
++ if (entityliving.damageEntity(DamageSource.playerAttack(this), f4)) {
entityliving.a(this, 0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)));
-- entityliving.damageEntity(DamageSource.playerAttack(this), 1.0F);
+- entityliving.damageEntity(DamageSource.playerAttack(this), f4);
+ }
+ // CraftBukkit end
}
}
-@@ -955,11 +1056,28 @@
+@@ -956,11 +1057,28 @@
}
if (entity instanceof EntityPlayer && entity.velocityChanged) {
@@ -316,9 +316,9 @@
}
if (flag2) {
-@@ -1012,7 +1130,14 @@
+@@ -1013,7 +1131,14 @@
- this.a(StatisticList.y, Math.round(f4 * 10.0F));
+ this.a(StatisticList.y, Math.round(f5 * 10.0F));
if (j > 0) {
- entity.setOnFire(j * 4);
+ // CraftBukkit start - Call a combust event when somebody hits with a fire enchanted item
@@ -331,8 +331,8 @@
+ // CraftBukkit end
}
- if (this.world instanceof WorldServer && f4 > 2.0F) {
-@@ -1028,6 +1153,11 @@
+ if (this.world instanceof WorldServer && f5 > 2.0F) {
+@@ -1029,6 +1154,11 @@
if (flag4) {
entity.extinguish();
}
@@ -344,7 +344,7 @@
}
}
-@@ -1118,6 +1248,20 @@
+@@ -1119,6 +1249,20 @@
this.stopRiding();
}
@@ -365,7 +365,7 @@
this.setSize(0.2F, 0.2F);
if (this.world.isLoaded(blockposition)) {
float f = 0.5F + (float) enumdirection.getAdjacentX() * 0.4F;
-@@ -1177,6 +1321,23 @@
+@@ -1178,6 +1322,23 @@
this.world.everyoneSleeping();
}
@@ -389,7 +389,7 @@
this.sleepTicks = flag ? 0 : 100;
if (flag2) {
this.setRespawnPosition(this.bedPosition, false);
-@@ -1228,9 +1389,11 @@
+@@ -1229,9 +1390,11 @@
if (blockposition != null) {
this.e = blockposition;
this.f = flag;
diff --git a/nms-patches/EntityPig.patch b/nms-patches/EntityPig.patch
index 81061ed4..1eed1c43 100644
--- a/nms-patches/EntityPig.patch
+++ b/nms-patches/EntityPig.patch
@@ -9,7 +9,7 @@
public class EntityPig extends EntityAnimal {
private static final DataWatcherObject<Boolean> bw = DataWatcher.a(EntityPig.class, DataWatcherRegistry.h);
-@@ -144,6 +146,12 @@
+@@ -156,6 +158,12 @@
if (!this.world.isClientSide && !this.dead) {
EntityPigZombie entitypigzombie = new EntityPigZombie(this.world);
@@ -22,7 +22,7 @@
entitypigzombie.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
entitypigzombie.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
entitypigzombie.setAI(this.hasAI());
-@@ -152,7 +160,8 @@
+@@ -164,7 +172,8 @@
entitypigzombie.setCustomNameVisible(this.getCustomNameVisible());
}
diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch
index 508b23e5..3c7bd958 100644
--- a/nms-patches/EntityPlayer.patch
+++ b/nms-patches/EntityPlayer.patch
@@ -66,8 +66,8 @@
+ this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit
}
- public void b(NBTTagCompound nbttagcompound) {
-@@ -102,8 +133,33 @@
+ public static void a(DataConverterManager dataconvertermanager) {
+@@ -119,8 +150,33 @@
nbttagcompound1.set("Entity", nbttagcompound2);
nbttagcompound.set("RootVehicle", nbttagcompound1);
}
@@ -101,7 +101,7 @@
public void levelDown(int i) {
super.levelDown(i);
-@@ -134,6 +190,11 @@
+@@ -151,6 +207,11 @@
}
public void A_() {
@@ -113,7 +113,7 @@
this.playerInteractManager.a();
--this.invulnerableTicks;
if (this.noDamageTicks > 0) {
-@@ -193,7 +254,7 @@
+@@ -210,7 +271,7 @@
}
if (this.getHealth() != this.lastHealthSent || this.cc != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.cd) {
@@ -122,7 +122,7 @@
this.lastHealthSent = this.getHealth();
this.cc = this.foodData.getFoodLevel();
this.cd = this.foodData.getSaturationLevel() == 0.0F;
-@@ -214,6 +275,12 @@
+@@ -231,6 +292,12 @@
this.a(IScoreboardCriteria.i, MathHelper.f((float) this.bX));
}
@@ -135,7 +135,7 @@
if (this.getArmorStrength() != this.bY) {
this.bY = this.getArmorStrength();
this.a(IScoreboardCriteria.j, MathHelper.f((float) this.bY));
-@@ -238,6 +305,16 @@
+@@ -255,6 +322,16 @@
this.o();
}
@@ -152,7 +152,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Ticking player");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked");
-@@ -248,12 +325,11 @@
+@@ -265,12 +342,11 @@
}
private void a(IScoreboardCriteria iscoreboardcriteria, int i) {
@@ -167,7 +167,7 @@
scoreboardscore.setScore(i);
}
-@@ -302,31 +378,61 @@
+@@ -319,31 +395,61 @@
boolean flag = this.world.getGameRules().getBoolean("showDeathMessages");
this.playerConnection.sendPacket(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, flag));
@@ -182,7 +182,7 @@
+
+ if (!keepInventory) {
+ for (ItemStack item : this.inventory.getContents()) {
-+ if (!item.isEmpty() && !EnchantmentManager.c(item)) { // PAIL: shouldNotDrop (Vanishing enchant)
++ if (!item.isEmpty() && !EnchantmentManager.e(item)) { // PAIL: shouldNotDrop (Vanishing enchant)
+ loot.add(CraftItemStack.asCraftMirror(item));
+ }
+ }
@@ -243,7 +243,7 @@
scoreboardscore.incrementScore();
}
-@@ -385,13 +491,15 @@
+@@ -402,13 +508,15 @@
}
private boolean canPvP() {
@@ -261,7 +261,7 @@
this.world.kill(this);
if (!this.viewingCredits) {
this.viewingCredits = true;
-@@ -412,7 +520,10 @@
+@@ -429,7 +537,10 @@
this.b((Statistic) AchievementList.y);
}
@@ -273,7 +273,7 @@
this.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1032, BlockPosition.ZERO, 0, false));
this.lastSentExp = -1;
this.lastHealthSent = -1.0F;
-@@ -457,6 +568,7 @@
+@@ -474,6 +585,7 @@
}
public void a(boolean flag, boolean flag1, boolean flag2) {
@@ -281,7 +281,7 @@
if (this.isSleeping()) {
this.x().getTracker().sendPacketToEntity(this, new PacketPlayOutAnimation(this, 2));
}
-@@ -535,23 +647,52 @@
+@@ -552,23 +664,52 @@
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
}
@@ -337,7 +337,7 @@
if (iinventory instanceof ILootable && ((ILootable) iinventory).b() != null && this.isSpectator()) {
this.a((new ChatMessage("container.spectatorCantOpen", new Object[0])).setChatModifier((new ChatModifier()).setColor(EnumChatFormat.RED)), true);
} else {
-@@ -565,18 +706,21 @@
+@@ -582,18 +723,21 @@
if (itileinventory.isLocked() && !this.a(itileinventory.getLock()) && !this.isSpectator()) {
this.playerConnection.sendPacket(new PacketPlayOutChat(new ChatMessage("container.isLocked", new Object[] { iinventory.getScoreboardDisplayName()}), (byte) 2));
this.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.Y, SoundCategory.BLOCKS, this.locX, this.locY, this.locZ, 1.0F, 1.0F));
@@ -361,7 +361,7 @@
this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this);
-@@ -584,8 +728,14 @@
+@@ -601,8 +745,14 @@
}
public void openTrade(IMerchant imerchant) {
@@ -377,7 +377,7 @@
this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this);
InventoryMerchant inventorymerchant = ((ContainerMerchant) this.activeContainer).e();
-@@ -605,13 +755,20 @@
+@@ -622,13 +772,20 @@
}
public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) {
@@ -399,7 +399,7 @@
this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this);
}
-@@ -648,6 +805,11 @@
+@@ -665,6 +822,11 @@
public void a(Container container, NonNullList<ItemStack> nonnulllist) {
this.playerConnection.sendPacket(new PacketPlayOutWindowItems(container.windowId, nonnulllist));
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried()));
@@ -411,7 +411,7 @@
}
public void setContainerData(Container container, int i, int j) {
-@@ -662,6 +824,7 @@
+@@ -679,6 +841,7 @@
}
public void closeInventory() {
@@ -419,7 +419,7 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.s();
}
-@@ -743,7 +906,16 @@
+@@ -760,7 +923,16 @@
public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F;
@@ -436,7 +436,7 @@
public void a(IChatBaseComponent ichatbasecomponent, boolean flag) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, (byte) (flag ? 2 : 0)));
-@@ -804,6 +976,8 @@
+@@ -821,6 +993,8 @@
}
public void a(EnumGamemode enumgamemode) {
@@ -445,7 +445,7 @@
this.playerInteractManager.setGameMode(enumgamemode);
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.getId()));
if (enumgamemode == EnumGamemode.SPECTATOR) {
-@@ -814,6 +988,7 @@
+@@ -831,6 +1005,7 @@
this.updateAbilities();
this.cw();
@@ -453,7 +453,7 @@
}
public boolean isSpectator() {
-@@ -829,6 +1004,7 @@
+@@ -846,6 +1021,7 @@
}
public boolean a(int i, String s) {
@@ -461,7 +461,7 @@
if ("seed".equals(s) && !this.server.aa()) {
return true;
} else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) {
-@@ -842,6 +1018,15 @@
+@@ -859,6 +1035,15 @@
} else {
return true;
}
@@ -477,7 +477,7 @@
}
public String A() {
-@@ -853,6 +1038,12 @@
+@@ -870,6 +1055,12 @@
}
public void a(PacketPlayInSettings packetplayinsettings) {
@@ -490,7 +490,7 @@
this.locale = packetplayinsettings.a();
this.cg = packetplayinsettings.c();
this.ch = packetplayinsettings.d();
-@@ -941,7 +1132,7 @@
+@@ -958,7 +1149,7 @@
@Nullable
public IChatBaseComponent getPlayerListName() {
@@ -499,7 +499,7 @@
}
public void a(EnumHand enumhand) {
-@@ -958,11 +1149,150 @@
+@@ -975,11 +1166,150 @@
}
public void M() {
diff --git a/nms-patches/EntityPotion.patch b/nms-patches/EntityPotion.patch
index ccef405f..f7ce8610 100644
--- a/nms-patches/EntityPotion.patch
+++ b/nms-patches/EntityPotion.patch
@@ -99,8 +99,8 @@
entityareaeffectcloud.setSource(this.getShooter());
entityareaeffectcloud.setRadius(3.0F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
-@@ -181,7 +214,14 @@
- entityareaeffectcloud.a(new MobEffect(mobeffect));
+@@ -187,7 +220,14 @@
+ entityareaeffectcloud.setColor(nbttagcompound.getInt("CustomPotionColor"));
}
- this.world.addEntity(entityareaeffectcloud);
diff --git a/nms-patches/EntityTippedArrow.patch b/nms-patches/EntityTippedArrow.patch
index fce1c47d..9e211602 100644
--- a/nms-patches/EntityTippedArrow.patch
+++ b/nms-patches/EntityTippedArrow.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityTippedArrow.java
+++ b/net/minecraft/server/EntityTippedArrow.java
-@@ -102,6 +102,25 @@
+@@ -116,6 +116,25 @@
}
}
@@ -23,6 +23,6 @@
+ }
+ // CraftBukkit end
+
- public int q() {
+ public int o() {
return ((Integer) this.datawatcher.get(EntityTippedArrow.f)).intValue();
}
diff --git a/nms-patches/EntityWither.patch b/nms-patches/EntityWither.patch
index 4b64b4d3..10c3e64d 100644
--- a/nms-patches/EntityWither.patch
+++ b/nms-patches/EntityWither.patch
@@ -13,7 +13,7 @@
public class EntityWither extends EntityMonster implements IRangedEntity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
-@@ -188,13 +194,38 @@
+@@ -193,13 +199,38 @@
if (this.dh() > 0) {
i = this.dh() - 1;
if (i <= 0) {
@@ -55,7 +55,7 @@
}
} else {
-@@ -285,6 +316,11 @@
+@@ -290,6 +321,11 @@
Block block = iblockdata.getBlock();
if (iblockdata.getMaterial() != Material.AIR && a(block)) {
@@ -67,7 +67,7 @@
flag = this.world.setAir(blockposition, true) || flag;
}
}
-@@ -298,7 +334,7 @@
+@@ -303,7 +339,7 @@
}
if (this.ticksLived % 20 == 0) {
diff --git a/nms-patches/HandshakeListener.patch b/nms-patches/HandshakeListener.patch
index 7f0640c2..5a2d6f7b 100644
--- a/nms-patches/HandshakeListener.patch
+++ b/nms-patches/HandshakeListener.patch
@@ -57,8 +57,8 @@
+ }
+ // CraftBukkit end
+
- if (packethandshakinginsetprotocol.b() > 315) {
- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.11");
+ if (packethandshakinginsetprotocol.b() > 316) {
+ chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.11.1");
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
@@ -26,6 +71,7 @@
this.b.close(chatcomponenttext);
diff --git a/nms-patches/ItemFishingRod.patch b/nms-patches/ItemFishingRod.patch
index 0c8cee22..fb2f9fbd 100644
--- a/nms-patches/ItemFishingRod.patch
+++ b/nms-patches/ItemFishingRod.patch
@@ -8,14 +8,19 @@
public class ItemFishingRod extends Item {
public ItemFishingRod() {
-@@ -19,9 +21,18 @@
+@@ -19,7 +21,6 @@
itemstack.damage(i, entityhuman);
entityhuman.a(enumhand);
} else {
- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.I, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.j.nextFloat() * 0.4F + 0.8F));
if (!world.isClientSide) {
-+ // CraftBukkit start
EntityFishingHook entityfishinghook = new EntityFishingHook(world, entityhuman);
+ int j = EnchantmentManager.c(itemstack);
+@@ -34,6 +35,17 @@
+ entityfishinghook.b(k);
+ }
+
++ // CraftBukkit start
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, (org.bukkit.entity.Fish) entityfishinghook.getBukkitEntity(), PlayerFishEvent.State.FISHING);
+ world.getServer().getPluginManager().callEvent(playerFishEvent);
+
@@ -25,6 +30,7 @@
+ }
+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.I, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.j.nextFloat() * 0.4F + 0.8F));
+ // CraftBukkit end
-
++
world.addEntity(entityfishinghook);
}
+
diff --git a/nms-patches/ItemMonsterEgg.patch b/nms-patches/ItemMonsterEgg.patch
index 95d75a29..2069ea11 100644
--- a/nms-patches/ItemMonsterEgg.patch
+++ b/nms-patches/ItemMonsterEgg.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/ItemMonsterEgg.java
+++ b/net/minecraft/server/ItemMonsterEgg.java
-@@ -153,6 +153,11 @@
+@@ -152,6 +152,11 @@
@Nullable
public static Entity a(World world, @Nullable MinecraftKey minecraftkey, double d0, double d1, double d2) {
@@ -12,7 +12,7 @@
if (minecraftkey != null && EntityTypes.eggInfo.containsKey(minecraftkey)) {
Entity entity = null;
-@@ -165,8 +170,13 @@
+@@ -164,8 +169,13 @@
entityinsentient.aP = entityinsentient.yaw;
entityinsentient.aN = entityinsentient.yaw;
entityinsentient.prepare(world.D(new BlockPosition(entityinsentient)), (GroupDataEntity) null);
diff --git a/nms-patches/MobSpawnerAbstract.patch b/nms-patches/MobSpawnerAbstract.patch
index 21298f01..87c41c2e 100644
--- a/nms-patches/MobSpawnerAbstract.patch
+++ b/nms-patches/MobSpawnerAbstract.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MobSpawnerAbstract.java
+++ b/net/minecraft/server/MobSpawnerAbstract.java
-@@ -104,7 +104,7 @@
+@@ -102,7 +102,7 @@
((EntityInsentient) entity).prepare(world.D(new BlockPosition(entity)), (GroupDataEntity) null);
}
diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch
index ecd694a4..b208f9fb 100644
--- a/nms-patches/PlayerConnection.patch
+++ b/nms-patches/PlayerConnection.patch
@@ -267,7 +267,7 @@
+
this.minecraftServer.getPlayerList().d(this.player);
this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2);
- this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.d(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
+ this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -260,7 +442,7 @@
} else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@@ -300,113 +300,113 @@
double d0 = this.player.locX;
double d1 = this.player.locY;
double d2 = this.player.locZ;
-@@ -295,15 +485,33 @@
- ++this.receivedMovePackets;
- int i = this.receivedMovePackets - this.processedMovePackets;
-
-- if (i > 5) {
-+ // CraftBukkit start - handle custom speeds and skipped ticks
-+ this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
-+ this.allowedPlayerTicks = Math.max(this.allowedPlayerTicks, 1);
-+ this.lastTick = (int) (System.currentTimeMillis() / 50);
-+
-+ if (i > Math.max(this.allowedPlayerTicks, 5)) {
- PlayerConnection.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", new Object[] { this.player.getName(), Integer.valueOf(i)});
- i = 1;
- }
+@@ -301,15 +491,33 @@
+ ++this.receivedMovePackets;
+ int i = this.receivedMovePackets - this.processedMovePackets;
+
+- if (i > 5) {
++ // CraftBukkit start - handle custom speeds and skipped ticks
++ this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
++ this.allowedPlayerTicks = Math.max(this.allowedPlayerTicks, 1);
++ this.lastTick = (int) (System.currentTimeMillis() / 50);
++
++ if (i > Math.max(this.allowedPlayerTicks, 5)) {
+ PlayerConnection.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", new Object[] { this.player.getName(), Integer.valueOf(i)});
+ i = 1;
+ }
-+ if (packetplayinflying.hasLook || d11 > 0) {
-+ allowedPlayerTicks -= 1;
-+ } else {
-+ allowedPlayerTicks = 20;
-+ }
-+ float speed;
-+ if (player.abilities.isFlying) {
-+ speed = player.abilities.flySpeed * 20f;
-+ } else {
-+ speed = player.abilities.walkSpeed * 10f;
-+ }
++ if (packetplayinflying.hasLook || d11 > 0) {
++ allowedPlayerTicks -= 1;
++ } else {
++ allowedPlayerTicks = 20;
++ }
++ float speed;
++ if (player.abilities.isFlying) {
++ speed = player.abilities.flySpeed * 20f;
++ } else {
++ speed = player.abilities.walkSpeed * 10f;
++ }
+
- if (!this.player.K() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cH())) {
- float f2 = this.player.cH() ? 300.0F : 100.0F;
+ if (!this.player.K() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cH())) {
+ float f2 = this.player.cH() ? 300.0F : 100.0F;
-- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
-+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
-+ // CraftBukkit end
- PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[] { this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9)});
- this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
- return;
-@@ -349,6 +557,69 @@
+- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
++ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
++ // CraftBukkit end
+ PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[] { this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9)});
+ this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
+ return;
+@@ -355,6 +563,69 @@
+ }
}
- }
-+ // CraftBukkit start - fire PlayerMoveEvent
-+ // Rest to old location first
-+ this.player.setLocation(prevX, prevY, prevZ, prevYaw, prevPitch);
++ // CraftBukkit start - fire PlayerMoveEvent
++ // Rest to old location first
++ this.player.setLocation(prevX, prevY, prevZ, prevYaw, prevPitch);
+
-+ Player player = this.getPlayer();
-+ Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location.
-+ Location to = player.getLocation().clone(); // Start off the To location as the Players current location.
++ Player player = this.getPlayer();
++ Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location.
++ Location to = player.getLocation().clone(); // Start off the To location as the Players current location.
+
-+ // If the packet contains movement information then we update the To location with the correct XYZ.
-+ if (packetplayinflying.hasPos) {
-+ to.setX(packetplayinflying.x);
-+ to.setY(packetplayinflying.y);
-+ to.setZ(packetplayinflying.z);
-+ }
++ // If the packet contains movement information then we update the To location with the correct XYZ.
++ if (packetplayinflying.hasPos) {
++ to.setX(packetplayinflying.x);
++ to.setY(packetplayinflying.y);
++ to.setZ(packetplayinflying.z);
++ }
+
-+ // If the packet contains look information then we update the To location with the correct Yaw & Pitch.
-+ if (packetplayinflying.hasLook) {
-+ to.setYaw(packetplayinflying.yaw);
-+ to.setPitch(packetplayinflying.pitch);
-+ }
++ // If the packet contains look information then we update the To location with the correct Yaw & Pitch.
++ if (packetplayinflying.hasLook) {
++ to.setYaw(packetplayinflying.yaw);
++ to.setPitch(packetplayinflying.pitch);
++ }
+
-+ // Prevent 40 event-calls for less than a single pixel of movement >.>
-+ double delta = Math.pow(this.lastPosX - to.getX(), 2) + Math.pow(this.lastPosY - to.getY(), 2) + Math.pow(this.lastPosZ - to.getZ(), 2);
-+ float deltaAngle = Math.abs(this.lastYaw - to.getYaw()) + Math.abs(this.lastPitch - to.getPitch());
-+
-+ if ((delta > 1f / 256 || deltaAngle > 10f) && !this.player.isFrozen()) {
-+ this.lastPosX = to.getX();
-+ this.lastPosY = to.getY();
-+ this.lastPosZ = to.getZ();
-+ this.lastYaw = to.getYaw();
-+ this.lastPitch = to.getPitch();
-+
-+ // Skip the first time we do this
-+ if (from.getX() != Double.MAX_VALUE) {
-+ Location oldTo = to.clone();
-+ PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
-+ this.server.getPluginManager().callEvent(event);
-+
-+ // If the event is cancelled we move the player back to their old location.
-+ if (event.isCancelled()) {
-+ teleport(from);
-+ return;
-+ }
++ // Prevent 40 event-calls for less than a single pixel of movement >.>
++ double delta = Math.pow(this.lastPosX - to.getX(), 2) + Math.pow(this.lastPosY - to.getY(), 2) + Math.pow(this.lastPosZ - to.getZ(), 2);
++ float deltaAngle = Math.abs(this.lastYaw - to.getYaw()) + Math.abs(this.lastPitch - to.getPitch());
++
++ if ((delta > 1f / 256 || deltaAngle > 10f) && !this.player.isFrozen()) {
++ this.lastPosX = to.getX();
++ this.lastPosY = to.getY();
++ this.lastPosZ = to.getZ();
++ this.lastYaw = to.getYaw();
++ this.lastPitch = to.getPitch();
++
++ // Skip the first time we do this
++ if (from.getX() != Double.MAX_VALUE) {
++ Location oldTo = to.clone();
++ PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
++ this.server.getPluginManager().callEvent(event);
++
++ // If the event is cancelled we move the player back to their old location.
++ if (event.isCancelled()) {
++ teleport(from);
++ return;
++ }
+
-+ // If a Plugin has changed the To destination then we teleport the Player
-+ // there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
-+ // We only do this if the Event was not cancelled.
-+ if (!oldTo.equals(event.getTo()) && !event.isCancelled()) {
-+ this.player.getBukkitEntity().teleport(event.getTo(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
-+ return;
-+ }
++ // If a Plugin has changed the To destination then we teleport the Player
++ // there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
++ // We only do this if the Event was not cancelled.
++ if (!oldTo.equals(event.getTo()) && !event.isCancelled()) {
++ this.player.getBukkitEntity().teleport(event.getTo(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
++ return;
++ }
+
-+ // Check to see if the Players Location has some how changed during the call of the event.
-+ // This can happen due to a plugin teleporting the player instead of using .setTo()
-+ if (!from.equals(this.getPlayer().getLocation()) && this.justTeleported) {
-+ this.justTeleported = false;
-+ return;
++ // Check to see if the Players Location has some how changed during the call of the event.
++ // This can happen due to a plugin teleporting the player instead of using .setTo()
++ if (!from.equals(this.getPlayer().getLocation()) && this.justTeleported) {
++ this.justTeleported = false;
++ return;
++ }
+ }
+ }
-+ }
-+ this.player.setLocation(d4, d5, d6, f, f1); // Copied from above
-+ // CraftBukkit end
++ this.player.setLocation(d4, d5, d6, f, f1); // Copied from above
++ // CraftBukkit end
+
- this.B = d12 >= -0.03125D;
- this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
- this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cH() && !worldserver.d(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
-@@ -365,10 +636,68 @@
+ this.B = d12 >= -0.03125D;
+ this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
+ this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cH() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
+@@ -372,10 +643,68 @@
}
public void a(double d0, double d1, double d2, float f, float f1) {
@@ -476,7 +476,7 @@
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D;
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D;
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D;
-@@ -385,6 +714,14 @@
+@@ -392,6 +721,14 @@
f3 = f1 + this.player.pitch;
}
@@ -491,7 +491,7 @@
if (++this.teleportAwait == Integer.MAX_VALUE) {
this.teleportAwait = 0;
}
-@@ -396,6 +733,7 @@
+@@ -403,6 +740,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x());
@@ -499,7 +499,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.a();
-@@ -405,7 +743,15 @@
+@@ -412,7 +750,15 @@
if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@@ -516,7 +516,7 @@
this.player.a(EnumHand.MAIN_HAND, itemstack);
}
-@@ -413,6 +759,21 @@
+@@ -420,6 +766,21 @@
case DROP_ITEM:
if (!this.player.isSpectator()) {
@@ -538,7 +538,7 @@
this.player.a(false);
}
-@@ -446,7 +807,15 @@
+@@ -453,7 +814,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
} else {
@@ -554,7 +554,7 @@
}
} else {
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
-@@ -466,10 +835,12 @@
+@@ -473,10 +842,12 @@
default:
throw new IllegalArgumentException("Invalid player action");
}
@@ -567,7 +567,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.c();
ItemStack itemstack = this.player.b(enumhand);
-@@ -483,6 +854,13 @@
+@@ -490,6 +861,13 @@
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, (byte) 2));
} else if (this.teleportPos == null && this.player.d((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
@@ -581,7 +581,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f());
}
-@@ -492,13 +870,52 @@
+@@ -499,13 +877,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x());
@@ -635,7 +635,7 @@
}
}
-@@ -509,8 +926,8 @@
+@@ -516,8 +933,8 @@
WorldServer[] aworldserver = this.minecraftServer.worldServer;
int i = aworldserver.length;
@@ -646,7 +646,7 @@
if (worldserver != null) {
entity = packetplayinspectate.a(worldserver);
-@@ -523,6 +940,8 @@
+@@ -530,6 +947,8 @@
if (entity != null) {
this.player.setSpectatorTarget(this.player);
this.player.stopRiding();
@@ -655,7 +655,7 @@
if (entity.world == this.player.world) {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
} else {
-@@ -548,12 +967,19 @@
+@@ -555,12 +974,19 @@
this.minecraftServer.getPlayerList().b(this.player, worldserver2);
this.minecraftServer.getPlayerList().updateClient(this.player);
}
@@ -676,7 +676,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x());
-@@ -566,14 +992,29 @@
+@@ -573,14 +999,29 @@
}
public void a(IChatBaseComponent ichatbasecomponent) {
@@ -708,7 +708,7 @@
if (this.minecraftServer.R() && this.player.getName().equals(this.minecraftServer.Q())) {
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown();
-@@ -595,6 +1036,15 @@
+@@ -602,6 +1043,15 @@
}
}
@@ -724,7 +724,7 @@
try {
this.networkManager.sendPacket(packet);
} catch (Throwable throwable) {
-@@ -616,17 +1066,32 @@
+@@ -623,17 +1073,32 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x());
@@ -759,7 +759,7 @@
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
-@@ -639,39 +1104,249 @@
+@@ -646,39 +1111,249 @@
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@@ -1017,7 +1017,7 @@
this.player.resetIdleTimer();
IJumpable ijumpable;
-@@ -743,6 +1418,7 @@
+@@ -750,6 +1425,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x());
@@ -1025,7 +1025,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver);
-@@ -758,20 +1434,68 @@
+@@ -765,20 +1441,68 @@
if (this.player.h(entity) < d0) {
EnumHand enumhand;
@@ -1095,7 +1095,7 @@
}
}
}
-@@ -787,7 +1511,8 @@
+@@ -794,7 +1518,8 @@
case PERFORM_RESPAWN:
if (this.player.viewingCredits) {
this.player.viewingCredits = false;
@@ -1105,7 +1105,7 @@
} else {
if (this.player.getHealth() > 0.0F) {
return;
-@@ -813,14 +1538,20 @@
+@@ -820,14 +1545,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
@@ -1127,7 +1127,7 @@
NonNullList nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
-@@ -829,8 +1560,279 @@
+@@ -836,8 +1567,279 @@
this.player.a(this.player.activeContainer, nonnulllist);
} else {
@@ -1136,10 +1136,10 @@
+ if (packetplayinwindowclick.b() < -1 && packetplayinwindowclick.b() != -999) {
+ return;
+ }
-
++
+ InventoryView inventory = this.player.activeContainer.getBukkitView();
+ SlotType type = CraftInventoryView.getSlotType(inventory, packetplayinwindowclick.b());
-+
+
+ InventoryClickEvent event;
+ ClickType click = ClickType.UNKNOWN;
+ InventoryAction action = InventoryAction.UNKNOWN;
@@ -1408,7 +1408,7 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
this.player.f = true;
-@@ -859,6 +1861,7 @@
+@@ -866,6 +1868,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
@@ -1416,7 +1416,7 @@
this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
-@@ -892,7 +1895,46 @@
+@@ -899,7 +1902,46 @@
}
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
@@ -1464,7 +1464,7 @@
if (flag1 && flag2) {
if (itemstack.isEmpty()) {
-@@ -916,6 +1958,7 @@
+@@ -923,6 +1965,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
@@ -1472,7 +1472,7 @@
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
-@@ -926,6 +1969,7 @@
+@@ -933,6 +1976,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
@@ -1480,7 +1480,7 @@
this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.a();
-@@ -942,14 +1986,30 @@
+@@ -949,14 +1993,30 @@
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@@ -1512,7 +1512,7 @@
tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
-@@ -972,11 +2032,27 @@
+@@ -979,11 +2039,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
@@ -1541,7 +1541,7 @@
ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
-@@ -1020,10 +2096,13 @@
+@@ -1027,10 +2103,13 @@
}
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@@ -1555,7 +1555,7 @@
}
} else {
String s1;
-@@ -1062,10 +2141,11 @@
+@@ -1069,10 +2148,11 @@
}
itemstack2.a("pages", (NBTBase) nbttaglist);
@@ -1568,7 +1568,7 @@
}
} else if ("MC|TrSel".equals(s)) {
try {
-@@ -1077,6 +2157,7 @@
+@@ -1084,6 +2164,7 @@
}
} catch (Exception exception2) {
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
@@ -1576,7 +1576,7 @@
}
} else {
TileEntity tileentity;
-@@ -1126,6 +2207,7 @@
+@@ -1133,6 +2214,7 @@
}
} catch (Exception exception3) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
@@ -1584,7 +1584,7 @@
}
} else if ("MC|AutoCmd".equals(s)) {
if (!this.minecraftServer.getEnableCommandBlock()) {
-@@ -1193,6 +2275,7 @@
+@@ -1200,6 +2282,7 @@
}
} catch (Exception exception4) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
@@ -1592,7 +1592,7 @@
}
} else {
int k;
-@@ -1216,6 +2299,7 @@
+@@ -1223,6 +2306,7 @@
}
} catch (Exception exception5) {
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
@@ -1600,7 +1600,7 @@
}
}
} else if ("MC|ItemName".equals(s)) {
-@@ -1302,6 +2386,7 @@
+@@ -1309,6 +2393,7 @@
}
} catch (Exception exception6) {
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
@@ -1608,7 +1608,7 @@
}
} else if ("MC|PickItem".equals(s)) {
packetdataserializer = packetplayincustompayload.b();
-@@ -1316,9 +2401,31 @@
+@@ -1323,9 +2408,31 @@
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);
}
}
diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch
index 31a7126f..5750faaf 100644
--- a/nms-patches/PlayerList.patch
+++ b/nms-patches/PlayerList.patch
@@ -116,7 +116,7 @@
playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
this.b(entityplayer, worldserver);
if (!this.server.getResourcePack().isEmpty()) {
-@@ -159,6 +204,8 @@
+@@ -151,6 +196,8 @@
}
entityplayer.syncInventory();
@@ -125,7 +125,7 @@
}
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
-@@ -191,26 +238,27 @@
+@@ -183,26 +230,27 @@
}
public void setPlayerFileData(WorldServer[] aworldserver) {
@@ -158,16 +158,16 @@
}
public void b(WorldBorder worldborder, double d0) {}
-@@ -235,7 +283,7 @@
- }
+@@ -228,7 +276,7 @@
+ @Nullable
public NBTTagCompound a(EntityPlayer entityplayer) {
- NBTTagCompound nbttagcompound = this.server.worldServer[0].getWorldData().h();
+ NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().h(); // CraftBukkit
NBTTagCompound nbttagcompound1;
if (entityplayer.getName().equals(this.server.Q()) && nbttagcompound != null) {
-@@ -259,28 +307,72 @@
+@@ -252,28 +300,72 @@
}
@@ -246,7 +246,7 @@
this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getVehicle();
-@@ -312,13 +404,61 @@
+@@ -305,13 +397,61 @@
this.o.remove(uuid);
}
@@ -311,7 +311,7 @@
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile);
s = "You are banned from this server!\nReason: " + gameprofilebanentry.getReason();
-@@ -326,10 +466,12 @@
+@@ -319,10 +459,12 @@
s = s + "\nYour ban will be removed on " + PlayerList.g.format(gameprofilebanentry.getExpires());
}
@@ -327,7 +327,7 @@
IpBanEntry ipbanentry = this.l.get(socketaddress);
s = "Your IP address is banned from this server!\nReason: " + ipbanentry.getReason();
-@@ -337,13 +479,25 @@
+@@ -330,13 +472,25 @@
s = s + "\nYour ban will be removed on " + PlayerList.g.format(ipbanentry.getExpires());
}
@@ -356,7 +356,7 @@
UUID uuid = EntityHuman.a(gameprofile);
ArrayList arraylist = Lists.newArrayList();
-@@ -378,17 +532,26 @@
+@@ -371,17 +525,26 @@
}
return new EntityPlayer(this.server, this.server.getWorldServer(0), gameprofile, (PlayerInteractManager) object);
@@ -384,7 +384,7 @@
entityplayer.dimension = i;
Object object;
-@@ -399,6 +562,11 @@
+@@ -392,6 +555,11 @@
}
EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.getWorldServer(entityplayer.dimension), entityplayer.getProfile(), (PlayerInteractManager) object);
@@ -396,7 +396,7 @@
entityplayer1.playerConnection = entityplayer.playerConnection;
entityplayer1.copyTo(entityplayer, flag);
-@@ -413,43 +581,157 @@
+@@ -406,43 +574,157 @@
entityplayer1.a(s);
}
@@ -427,13 +427,13 @@
+ entityplayer1.setRespawnPosition(null, true);
+ entityplayer1.playerConnection.sendPacket(new PacketPlayOutGameStateChange(0, 0.0F));
+ }
- }
++ }
+
+ if (location == null) {
+ cworld = (CraftWorld) this.server.server.getWorlds().get(0);
+ blockposition = cworld.getHandle().getSpawn();
+ location = new Location(cworld, (double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.1F), (double) ((float) blockposition.getZ() + 0.5F));
-+ }
+ }
+
+ Player respawnPlayer = cserver.getPlayer(entityplayer1);
+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn);
@@ -571,7 +571,7 @@
public void f(EntityPlayer entityplayer) {
GameProfile gameprofile = entityplayer.getProfile();
int i = this.isOp(gameprofile) ? this.operators.a(gameprofile) : 0;
-@@ -488,12 +770,111 @@
+@@ -481,12 +763,111 @@
}
public void changeWorld(Entity entity, int i, WorldServer worldserver, WorldServer worldserver1) {
@@ -593,12 +593,12 @@
+ double d1 = enter.getZ();
+ double d2 = 8.0D;
+ /*
- double d0 = entity.locX;
- double d1 = entity.locZ;
- double d2 = 8.0D;
- float f = entity.yaw;
-
- worldserver.methodProfiler.a("moving");
++ double d0 = entity.locX;
++ double d1 = entity.locZ;
++ double d2 = 8.0D;
++ float f = entity.yaw;
++
++ worldserver.methodProfiler.a("moving");
+ */
+ if (worldserver1.dimension == -1) {
+ d0 = MathHelper.a(d0 / d2, worldserver1.getWorldBorder().b()+ 16.0D, worldserver1.getWorldBorder().d() - 16.0D);
@@ -668,12 +668,12 @@
+ int i = worldserver.dimension;
+
+ /*
-+ double d0 = entity.locX;
-+ double d1 = entity.locZ;
-+ double d2 = 8.0D;
-+ float f = entity.yaw;
-+
-+ worldserver.methodProfiler.a("moving");
+ double d0 = entity.locX;
+ double d1 = entity.locZ;
+ double d2 = 8.0D;
+ float f = entity.yaw;
+
+ worldserver.methodProfiler.a("moving");
+ */
+ entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch());
+ if (entity.isAlive()) {
@@ -683,7 +683,7 @@
if (entity.dimension == -1) {
d0 = MathHelper.a(d0 / 8.0D, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D);
d1 = MathHelper.a(d1 / 8.0D, worldserver1.getWorldBorder().c() + 16.0D, worldserver1.getWorldBorder().e() - 16.0D);
-@@ -512,6 +893,8 @@
+@@ -505,6 +886,8 @@
BlockPosition blockposition;
if (i == 1) {
@@ -692,7 +692,7 @@
blockposition = worldserver1.getSpawn();
} else {
blockposition = worldserver1.getDimensionSpawn();
-@@ -525,16 +908,27 @@
+@@ -518,16 +901,27 @@
worldserver.entityJoinedWorld(entity, false);
}
}
@@ -723,7 +723,7 @@
worldserver1.entityJoinedWorld(entity, false);
}
-@@ -542,11 +936,23 @@
+@@ -535,11 +929,23 @@
}
entity.spawnIn(worldserver1);
@@ -748,7 +748,7 @@
this.u = 0;
}
-@@ -559,6 +965,25 @@
+@@ -552,6 +958,25 @@
}
@@ -774,7 +774,7 @@
public void a(Packet<?> packet, int i) {
for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
-@@ -657,11 +1082,23 @@
+@@ -650,11 +1075,23 @@
this.operators.add(new OpListEntry(gameprofile, this.server.q(), this.operators.b(gameprofile)));
this.b(this.a(gameprofile.getId()), i);
@@ -798,7 +798,7 @@
}
private void b(EntityPlayer entityplayer, int i) {
-@@ -686,7 +1123,7 @@
+@@ -679,7 +1116,7 @@
}
public boolean isOp(GameProfile gameprofile) {
@@ -807,7 +807,7 @@
}
@Nullable
-@@ -710,6 +1147,12 @@
+@@ -703,6 +1140,12 @@
for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
@@ -820,7 +820,7 @@
if (entityplayer != entityhuman && entityplayer.dimension == i) {
double d4 = d0 - entityplayer.locX;
double d5 = d1 - entityplayer.locY;
-@@ -757,7 +1200,7 @@
+@@ -750,7 +1193,7 @@
public void reloadWhitelist() {}
public void b(EntityPlayer entityplayer, WorldServer worldserver) {
@@ -829,7 +829,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.INITIALIZE));
entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean("doDaylightCycle")));
-@@ -765,16 +1208,21 @@
+@@ -758,16 +1201,21 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
if (worldserver.W()) {
@@ -855,7 +855,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
}
-@@ -787,7 +1235,7 @@
+@@ -780,7 +1228,7 @@
}
public String[] getSeenPlayers() {
@@ -864,7 +864,7 @@
}
public boolean getHasWhitelist() {
-@@ -836,17 +1284,29 @@
+@@ -829,17 +1277,29 @@
}
public void u() {
@@ -875,17 +875,17 @@
+ player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
}
+ // CraftBukkit end
-+
-+ }
+
+ }
+ // CraftBukkit start
+ public void sendMessage(IChatBaseComponent[] iChatBaseComponents) {
+ for (IChatBaseComponent component : iChatBaseComponents) {
+ sendMessage(component, true);
+ }
- }
++ }
+ // CraftBukkit end
-
++
public void sendMessage(IChatBaseComponent ichatbasecomponent, boolean flag) {
this.server.sendMessage(ichatbasecomponent);
int i = flag ? 1 : 0;
@@ -897,7 +897,7 @@
}
public void sendMessage(IChatBaseComponent ichatbasecomponent) {
-@@ -883,8 +1343,10 @@
+@@ -876,8 +1336,10 @@
WorldServer[] aworldserver = this.server.worldServer;
int j = aworldserver.length;
diff --git a/nms-patches/RecipesFurnace.patch b/nms-patches/RecipesFurnace.patch
index 62124ddc..9bdd8edf 100644
--- a/nms-patches/RecipesFurnace.patch
+++ b/nms-patches/RecipesFurnace.patch
@@ -12,8 +12,8 @@
public static RecipesFurnace getInstance() {
return RecipesFurnace.a;
-@@ -54,6 +56,12 @@
- this.registerRecipe(Blocks.QUARTZ_ORE, new ItemStack(Items.QUARTZ), 0.2F);
+@@ -78,6 +80,12 @@
+ this.a(Items.GOLDEN_HORSE_ARMOR, new ItemStack(Items.GOLD_NUGGET), 0.1F);
}
+ // CraftBukkit start - add method
@@ -25,7 +25,7 @@
public void registerRecipe(Block block, ItemStack itemstack, float f) {
this.a(Item.getItemOf(block), itemstack, f);
}
-@@ -68,13 +76,23 @@
+@@ -92,13 +100,23 @@
}
public ItemStack getResult(ItemStack itemstack) {
@@ -51,7 +51,7 @@
}
entry = (Entry) iterator.next();
-@@ -92,13 +110,23 @@
+@@ -116,13 +134,23 @@
}
public float b(ItemStack itemstack) {
diff --git a/nms-patches/TileEntity.patch b/nms-patches/TileEntity.patch
index 3b5db83a..6024fdbc 100644
--- a/nms-patches/TileEntity.patch
+++ b/nms-patches/TileEntity.patch
@@ -9,7 +9,7 @@
public abstract class TileEntity {
private static final Logger a = LogManager.getLogger();
-@@ -255,4 +257,13 @@
+@@ -250,4 +252,13 @@
a("command_block", TileEntityCommand.class);
a("shulker_box", TileEntityShulkerBox.class);
}
diff --git a/nms-patches/World.patch b/nms-patches/World.patch
index 921a5b9e..5993990b 100644
--- a/nms-patches/World.patch
+++ b/nms-patches/World.patch
@@ -341,7 +341,26 @@
this.c(entity);
}
-@@ -1068,6 +1291,11 @@
+@@ -872,6 +1095,9 @@
+ int l = MathHelper.f(axisalignedbb.e) + 1;
+ int i1 = MathHelper.floor(axisalignedbb.c) - 1;
+ int j1 = MathHelper.f(axisalignedbb.f) + 1;
++ // CraftBukkit start - filter out large ranges
++ com.google.common.base.Preconditions.checkArgument(j - i <= 32 && l - k <= 32 && j1 - i1 <= 32, "Filtered out large getCubes call %s,%s %s,%s %s,%s", i, j, k, l, i1, j1);
++ // CraftBukkit end
+ WorldBorder worldborder = this.getWorldBorder();
+ boolean flag1 = entity != null && entity.br();
+ boolean flag2 = entity != null && this.g(entity);
+@@ -974,7 +1200,7 @@
+ }
+
+ public boolean a(AxisAlignedBB axisalignedbb) {
+- return this.a((Entity) null, axisalignedbb, true, Lists.newArrayList());
++ return this.a((Entity) null, axisalignedbb, true, Lists.<AxisAlignedBB>newArrayList()); // CraftBukkit - decompile error
+ }
+
+ public int a(float f) {
+@@ -1044,6 +1270,11 @@
for (i = 0; i < this.j.size(); ++i) {
entity = (Entity) this.j.get(i);
@@ -353,7 +372,7 @@
try {
++entity.ticksLived;
-@@ -1116,8 +1344,10 @@
+@@ -1092,8 +1323,10 @@
CrashReportSystemDetails crashreportsystemdetails1;
CrashReport crashreport1;
@@ -366,7 +385,7 @@
Entity entity1 = entity.bB();
if (entity1 != null) {
-@@ -1150,7 +1380,7 @@
+@@ -1126,7 +1359,7 @@
this.getChunkAt(j, l).b(entity);
}
@@ -375,7 +394,7 @@
this.c(entity);
}
-@@ -1159,6 +1389,13 @@
+@@ -1135,6 +1368,13 @@
this.methodProfiler.c("blockEntities");
this.M = true;
@@ -389,7 +408,7 @@
Iterator iterator = this.tileEntityListTick.iterator();
while (iterator.hasNext()) {
-@@ -1169,7 +1406,7 @@
+@@ -1145,7 +1385,7 @@
if (this.isLoaded(blockposition) && this.N.a(blockposition)) {
try {
@@ -398,7 +417,7 @@
((ITickable) tileentity).F_();
this.methodProfiler.b();
} catch (Throwable throwable2) {
-@@ -1191,11 +1428,13 @@
+@@ -1167,11 +1407,13 @@
}
this.M = false;
@@ -412,7 +431,7 @@
this.methodProfiler.c("pendingBlockEntities");
if (!this.b.isEmpty()) {
-@@ -1203,9 +1442,11 @@
+@@ -1179,9 +1421,11 @@
TileEntity tileentity1 = (TileEntity) this.b.get(i1);
if (!tileentity1.y()) {
@@ -424,7 +443,7 @@
if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
-@@ -1213,6 +1454,12 @@
+@@ -1189,6 +1433,12 @@
chunk.a(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@@ -437,7 +456,7 @@
}
}
}
-@@ -1267,7 +1514,10 @@
+@@ -1243,7 +1493,10 @@
int j = MathHelper.floor(entity.locZ);
boolean flag1 = true;
@@ -449,7 +468,7 @@
entity.M = entity.locX;
entity.N = entity.locY;
entity.O = entity.locZ;
-@@ -1571,11 +1821,18 @@
+@@ -1547,11 +1800,18 @@
}
}
@@ -468,7 +487,7 @@
TileEntity tileentity = null;
if (this.M) {
-@@ -1610,6 +1867,14 @@
+@@ -1586,6 +1846,14 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!this.E(blockposition)) {
if (tileentity != null && !tileentity.y()) {
@@ -483,7 +502,7 @@
if (this.M) {
tileentity.setPosition(blockposition);
Iterator iterator = this.b.iterator();
-@@ -1769,6 +2034,14 @@
+@@ -1745,6 +2013,14 @@
}
this.o = MathHelper.a(this.o, 0.0F, 1.0F);
@@ -498,7 +517,7 @@
}
}
}
-@@ -1900,7 +2173,10 @@
+@@ -1876,7 +2152,10 @@
}
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@@ -510,7 +529,7 @@
return false;
} else {
int i = 0;
-@@ -2067,7 +2343,7 @@
+@@ -2043,7 +2322,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -519,7 +538,7 @@
arraylist.add(entity);
}
}
-@@ -2082,7 +2358,7 @@
+@@ -2058,7 +2337,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -528,7 +547,7 @@
arraylist.add(entity);
}
}
-@@ -2131,7 +2407,7 @@
+@@ -2107,7 +2386,7 @@
}
}
@@ -537,7 +556,7 @@
}
@Nullable
-@@ -2152,8 +2428,17 @@
+@@ -2128,8 +2407,17 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -557,7 +576,7 @@
++i;
}
}
-@@ -2162,12 +2447,18 @@
+@@ -2138,12 +2426,18 @@
}
public void a(Collection<Entity> collection) {
@@ -577,7 +596,7 @@
this.b(entity);
}
-@@ -2181,7 +2472,13 @@
+@@ -2157,7 +2451,13 @@
IBlockData iblockdata = this.getType(blockposition);
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().c(this, blockposition);
@@ -592,7 +611,7 @@
}
public int K() {
-@@ -2291,6 +2588,11 @@
+@@ -2267,6 +2567,11 @@
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
@@ -604,7 +623,7 @@
if (predicate.apply(entityhuman1)) {
double d5 = entityhuman1.d(d0, d1, d2);
-@@ -2459,6 +2761,16 @@
+@@ -2435,6 +2740,16 @@
public void everyoneSleeping() {}
@@ -621,7 +640,7 @@
public float h(float f) {
return (this.p + (this.q - this.p) * f) * this.j(f);
}
-@@ -2676,7 +2988,7 @@
+@@ -2652,7 +2967,7 @@
int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true;
diff --git a/nms-patches/WorldNBTStorage.patch b/nms-patches/WorldNBTStorage.patch
index 4f3b18e3..c39f4ef7 100644
--- a/nms-patches/WorldNBTStorage.patch
+++ b/nms-patches/WorldNBTStorage.patch
@@ -20,7 +20,7 @@
public WorldNBTStorage(File file, String s, boolean flag, DataConverterManager dataconvertermanager) {
this.a = dataconvertermanager;
-@@ -167,12 +173,38 @@
+@@ -168,12 +174,38 @@
}
if (nbttagcompound != null) {
@@ -59,7 +59,7 @@
public IPlayerFileData getPlayerFileData() {
return this;
}
-@@ -202,4 +234,50 @@
+@@ -203,4 +235,50 @@
public DefinedStructureManager h() {
return this.h;
}
diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch
index 37c8b6f0..386a0a48 100644
--- a/nms-patches/WorldServer.patch
+++ b/nms-patches/WorldServer.patch
@@ -501,12 +501,12 @@
}
- public boolean addEntity(Entity entity) {
-- return this.i(entity) ? super.addEntity(entity) : false;
+- return this.j(entity) ? super.addEntity(entity) : false;
+ // CraftBukkit start
+ public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
+ // World.addEntity(Entity) will call this, and we still want to perform
+ // existing entity checking when it's called with a SpawnReason
-+ return this.i(entity) ? super.addEntity(entity, spawnReason) : false;
++ return this.j(entity) ? super.addEntity(entity, spawnReason) : false;
}
+ // CraftBukkit end
@@ -514,7 +514,7 @@
ArrayList arraylist = Lists.newArrayList(collection);
@@ -837,7 +1062,7 @@
- private boolean i(Entity entity) {
+ private boolean j(Entity entity) {
if (entity.dead) {
- WorldServer.a.warn("Tried to add entity {} but it was marked as removed already", new Object[] { EntityTypes.a(entity)});
+ // WorldServer.a.warn("Tried to add entity {} but it was marked as removed already", new Object[] { EntityTypes.a(entity)}); // CraftBukkit