From 4832b1a385274271cc48a7a84bda449eefdd9836 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Wed, 16 Nov 2016 20:23:38 -0600
Subject: [PATCH] Update Paper to MC 1.11
---
...ityRegainHealthEvent-isFastRegen-API.patch | 5 -
Spigot-API-Patches/POM-changes.patch | 6 +-
.../Add-BeaconEffectEvent.patch | 8 +-
.../Add-EntityZapEvent.patch | 6 +-
.../Add-PlayerUseUnknownEntityEvent.patch | 2 +-
.../Add-World-Util-Methods.patch | 2 +-
...-despawn-distances-for-living-entiti.patch | 4 +-
.../Add-exception-reporting-event.patch | 4 +-
.../Add-getEntity-by-UUID-API.patch | 2 +-
...Add-hit-entity-to-ProjectileHitEvent.patch | 14 +-
...working-with-arrows-stuck-in-living-.patch | 8 +-
...chunks-are-slime-spawn-chunks-toggle.patch | 4 +-
.../Allow-nerfed-mobs-to-jump.patch | 7 +-
...opper-searches-if-there-are-no-items.patch | 4 +-
...entation-of-tile-entity-removal-list.patch | 20 +-
.../Chunk-Save-Reattempt.patch | 2 +-
.../Chunk-registration-fixes.patch | 2 +-
...le-Keep-Spawn-Loaded-range-per-world.patch | 12 +-
...urable-Non-Player-Arrow-Despawn-Rate.patch | 12 +-
.../Configurable-Player-Collision.patch | 2 +-
...figurable-baby-zombie-movement-speed.patch | 6 +-
.../Configurable-fishing-time-ranges.patch | 18 +-
...le-spawn-chances-for-skeleton-horses.patch | 13 +-
.../Configurable-squid-spawn-ranges.patch | 7 +-
.../Custom-replacement-for-eaten-items.patch | 12 +-
.../Disable-explosion-knockback.patch | 6 +-
.../Disable-ticking-of-snow-blocks.patch | 2 +-
...am-reload-spawn-chunks-in-nether-end.patch | 10 +-
...ck-and-tnt-entities-at-the-specified.patch | 5 +-
.../Ensure-inv-drag-is-in-bounds.patch | 4 +-
Spigot-Server-Patches/Entity-Origin-API.patch | 10 +-
...ityRegainHealthEvent-isFastRegen-API.patch | 6 +-
...g-BlockPlaceEvent-triggering-physics.patch | 8 +-
.../Fix-Chunk-Unload-Queue-Issues.patch | 4 +-
...-FallingBlocks-being-stuck-on-fences.patch | 3 +-
.../Fix-Furnace-cook-time-bug.patch | 4 +-
.../Fix-Old-Sign-Conversion.patch | 4 +-
...dDebugInfo-not-initialized-on-client.patch | 2 +-
.../Generator-Settings.patch | 30 +--
.../Implement-PlayerLocaleChangeEvent.patch | 8 +-
...item-frames-performance-and-bug-fixe.patch | 10 +-
...Improve-Minecraft-Hopper-Performance.patch | 38 ++--
Spigot-Server-Patches/Lighting-Queue.patch | 2 +-
...-API-Replenishable-Lootables-Feature.patch | 27 +--
Spigot-Server-Patches/MC-Dev-fixes.patch | 84 +++++++-
.../Make-entities-look-for-hoppers.patch | 38 ++--
.../Minecart-drop-name-workaround.patch | 22 ---
...on-Wither-Death-sounds-to-same-world.patch | 2 +-
.../Optimize-TileEntity-Ticking.patch | 42 ++--
.../Optimize-UserCache-Thread-Safe.patch | 4 +-
Spigot-Server-Patches/Optimize-draining.patch | 26 ---
...Location-getType-and-getBlockData-fo.patch | 4 +-
.../Optimized-Light-Level-Comparisons.patch | 10 +-
...sable-BlockPhysicsEvent-for-Redstone.patch | 4 +-
.../Optional-old-TNT-cannon-behaviors.patch | 58 +++---
Spigot-Server-Patches/POM-Changes.patch | 12 +-
.../Pass-world-to-Village-creation.patch | 2 +-
.../Player-Exhaustion-Multipliers.patch | 58 ------
.../Player-Tab-List-and-Title-APIs.patch | 2 +-
.../Player-affects-spawning-API.patch | 180 +++---------------
...event-tile-entity-and-entity-crashes.patch | 6 +-
...ata-Conversion-post-ItemMeta-on-Copy.patch | 19 +-
...tring-limit-for-packet-serialization.patch | 2 +-
...ve-invalid-mob-spawner-tile-entities.patch | 2 +-
...from-the-correct-hand-when-spawn-egg.patch | 32 ----
...Remove-unused-World-Tile-Entity-List.patch | 2 +-
...-dispenser-dropper-furnace-placement.patch | 4 +-
Spigot-Server-Patches/Timings-v2.patch | 62 +++---
.../Toggleable-Elytra-Wall-Damage.patch | 4 +-
.../Undead-horse-leashing.patch | 13 +-
.../Use-a-Shared-Random-for-Entities.patch | 2 +-
.../Vanished-players-don-t-have-rights.patch | 33 ++--
.../Vehicle-Event-Cancellation-Changes.patch | 4 +-
...-mobs-should-only-spawn-in-the-water.patch | 2 +-
...-possibility-for-getServer-singleton.patch | 2 +-
scripts/importmcdev.sh | 1 +
work/BuildData | 2 +-
work/Bukkit | 2 +-
work/CraftBukkit | 2 +-
work/Spigot | 2 +-
80 files changed, 453 insertions(+), 658 deletions(-)
delete mode 100644 Spigot-Server-Patches/Minecart-drop-name-workaround.patch
delete mode 100644 Spigot-Server-Patches/Optimize-draining.patch
delete mode 100644 Spigot-Server-Patches/Player-Exhaustion-Multipliers.patch
delete mode 100644 Spigot-Server-Patches/Remove-the-item-from-the-correct-hand-when-spawn-egg.patch
diff --git a/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch
index ed71403c16..1be8a9890e 100644
--- a/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch
+++ b/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch
@@ -14,11 +14,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final RegainReason regainReason;
+ private final boolean isFastRegen; // Paper
- @Deprecated
- public EntityRegainHealthEvent(final Entity entity, final int amount, final RegainReason regainReason) {
-@@ -0,0 +0,0 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
- }
-
public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) {
+ // Paper start - Forward
+ this(entity, amount, regainReason, false);
diff --git a/Spigot-API-Patches/POM-changes.patch b/Spigot-API-Patches/POM-changes.patch
index 38a1edc23f..9e9e12dd8d 100644
--- a/Spigot-API-Patches/POM-changes.patch
+++ b/Spigot-API-Patches/POM-changes.patch
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- spigot-api
+ com.destroystokyo.paper
+ paper-api
- 1.10.2-R0.1-SNAPSHOT
+ 1.11-R0.1-SNAPSHOT
jar
- Spigot-API
@@ -101,7 +101,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- org.codehaus.mojo
- animal-sniffer-maven-plugin
-- 1.14
+- 1.15
-
-
- process-classes
@@ -121,5 +121,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-
org.apache.maven.plugins
maven-shade-plugin
- 2.4.1
+ 2.4.3
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Add-BeaconEffectEvent.patch b/Spigot-Server-Patches/Add-BeaconEffectEvent.patch
index 6430b9b1bf..65ada97fde 100644
--- a/Spigot-Server-Patches/Add-BeaconEffectEvent.patch
+++ b/Spigot-Server-Patches/Add-BeaconEffectEvent.patch
@@ -59,12 +59,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
int i = getLevel();
List list = getHumansInRange();
-- applyEffect(list, this.l, i, b0);
-+ applyEffect(list, this.l, i, b0, true); // Paper - BeaconEffectEvent
+- applyEffect(list, this.primaryEffect, i, b0);
++ applyEffect(list, this.primaryEffect, i, b0, true); // Paper - BeaconEffectEvent
if (hasSecondaryEffect()) {
-- applyEffect(list, this.m, i, 0);
-+ applyEffect(list, this.m, i, 0, false); // Paper - BeaconEffectEvent
+- applyEffect(list, this.secondaryEffect, i, 0);
++ applyEffect(list, this.secondaryEffect, i, 0, false); // Paper - BeaconEffectEvent
}
}
diff --git a/Spigot-Server-Patches/Add-EntityZapEvent.patch b/Spigot-Server-Patches/Add-EntityZapEvent.patch
index b77bd0ae0e..e132dc6ee0 100644
--- a/Spigot-Server-Patches/Add-EntityZapEvent.patch
+++ b/Spigot-Server-Patches/Add-EntityZapEvent.patch
@@ -25,7 +25,7 @@ diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/j
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
-@@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements IMerchant, NPC {
+@@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
if (!this.world.isClientSide && !this.dead) {
EntityWitch entitywitch = new EntityWitch(this.world);
@@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
entitywitch.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
entitywitch.prepare(this.world.D(new BlockPosition(entitywitch)), (GroupDataEntity) null);
entitywitch.setAI(this.hasAI());
-@@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements IMerchant, NPC {
+@@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
entitywitch.setCustomNameVisible(this.getCustomNameVisible());
}
@@ -64,6 +64,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
+
public static HorseJumpEvent callHorseJumpEvent(Entity horse, float power) {
- HorseJumpEvent event = new HorseJumpEvent((Horse) horse.getBukkitEntity(), power);
+ HorseJumpEvent event = new HorseJumpEvent((AbstractHorse) horse.getBukkitEntity(), power);
horse.getBukkitEntity().getServer().getPluginManager().callEvent(event);
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch
index 77d1117e35..0b2cd15390 100644
--- a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch
+++ b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch
@@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
-@@ -0,0 +0,0 @@ import java.io.IOException;
+@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public class PacketPlayInUseEntity implements Packet {
diff --git a/Spigot-Server-Patches/Add-World-Util-Methods.patch b/Spigot-Server-Patches/Add-World-Util-Methods.patch
index bcc2566515..0ad6f42c9b 100644
--- a/Spigot-Server-Patches/Add-World-Util-Methods.patch
+++ b/Spigot-Server-Patches/Add-World-Util-Methods.patch
@@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.c(blockposition, true);
}
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
- return this.worldProvider.n()[this.getLightLevel(blockposition)];
+ return this.worldProvider.o()[this.getLightLevel(blockposition)];
}
+ // Paper start - reduces need to do isLoaded before getType
diff --git a/Spigot-Server-Patches/Add-configurable-despawn-distances-for-living-entiti.patch b/Spigot-Server-Patches/Add-configurable-despawn-distances-for-living-entiti.patch
index cd9a835760..0155d2789e 100644
--- a/Spigot-Server-Patches/Add-configurable-despawn-distances-for-living-entiti.patch
+++ b/Spigot-Server-Patches/Add-configurable-despawn-distances-for-living-entiti.patch
@@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
- log("Player exhaustion penalty for breaking blocks is " + blockBreakExhaustion);
- log("Player exhaustion penalty for swimming is " + playerSwimmingExhaustion);
+ private void nerfedMobsShouldJump() {
+ nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
}
+
+ public int softDespawnDistance;
diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch
index 2f765a3086..6c87cb9c48 100644
--- a/Spigot-Server-Patches/Add-exception-reporting-event.patch
+++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch
@@ -217,7 +217,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public class RegionFile {
- this.b(i, j, (int) (MinecraftServer.av() / 1000L));
+ this.b(i, j, (int) (MinecraftServer.aw() / 1000L));
} catch (IOException ioexception) {
ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception); // Paper
@@ -284,7 +284,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.List;
import javax.annotation.Nullable;
@@ -0,0 +0,0 @@ public class VillageSiege {
- entityzombie.setVillagerType(EnumZombieType.NORMAL);
+ entityzombie.prepare(this.a.D(new BlockPosition(entityzombie)), (GroupDataEntity) null);
} catch (Exception exception) {
exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper
diff --git a/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch b/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch
index 105d109c84..46420d9c65 100644
--- a/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch
+++ b/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
- this.Y = 0L;
+ this.Z = 0L;
}
+ public Entity getEntity(UUID uuid) { return this.a(uuid); } // Paper - OBFHELPER
diff --git a/Spigot-Server-Patches/Add-hit-entity-to-ProjectileHitEvent.patch b/Spigot-Server-Patches/Add-hit-entity-to-ProjectileHitEvent.patch
index fd267813bd..2c0e3584c8 100644
--- a/Spigot-Server-Patches/Add-hit-entity-to-ProjectileHitEvent.patch
+++ b/Spigot-Server-Patches/Add-hit-entity-to-ProjectileHitEvent.patch
@@ -35,14 +35,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
- // Paper end
+ // Paper end
+
+ if (movingobjectposition != null) {
+- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
++ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Craftbukkit - Call event // Paper - Include entity in movingobjectposition
+ vec3d1 = new Vec3D(movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z);
+ }
- if (movingobjectposition != null) {
-- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
-+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Craftbukkit - Call event // Paper - Include entity in movingobjectposition
- if (movingobjectposition.entity != null) {
- this.hooked = movingobjectposition.entity;
- this.getDataWatcher().set(EntityFishingHook.c, Integer.valueOf(this.hooked.getId() + 1));
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
diff --git a/Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch
index 65329fc05d..8ebae1ecda 100644
--- a/Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch
+++ b/Spigot-Server-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch
@@ -12,14 +12,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue();
}
-+ public final int getStuckArrows() { return this.cb(); } // Paper - OBFHELPER
- public final int cb() {
- return ((Integer) this.datawatcher.get(EntityLiving.h)).intValue();
++ public final int getStuckArrows() { return this.cc(); } // Paper - OBFHELPER
+ public final int cc() {
+ return ((Integer) this.datawatcher.get(EntityLiving.bq)).intValue();
}
+ public final void setStuckArrows(int arrows) { this.f(arrows); } // Paper - OBFHELPER
public final void f(int i) {
- this.datawatcher.set(EntityLiving.h, Integer.valueOf(i));
+ this.datawatcher.set(EntityLiving.bq, Integer.valueOf(i));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
diff --git a/Spigot-Server-Patches/All-chunks-are-slime-spawn-chunks-toggle.patch b/Spigot-Server-Patches/All-chunks-are-slime-spawn-chunks-toggle.patch
index 084f8219bf..d5368494dd 100644
--- a/Spigot-Server-Patches/All-chunks-are-slime-spawn-chunks-toggle.patch
+++ b/Spigot-Server-Patches/All-chunks-are-slime-spawn-chunks-toggle.patch
@@ -23,13 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntitySlime.java
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
@@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster {
- return super.cK();
+ return super.cM();
}
- if (this.random.nextInt(10) == 0 && chunk.a(987234911L).nextInt(10) == 0 && this.locY < 40.0D) {
+ boolean isSlimeChunk = world.paperConfig.allChunksAreSlimeChunks || chunk.a(987234911L).nextInt(10) == 0; // Paper
+ if (this.random.nextInt(10) == 0 && isSlimeChunk && this.locY < 40.0D) {
- return super.cK();
+ return super.cM();
}
}
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump.patch b/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump.patch
index 3929297bdc..d98970ec75 100644
--- a/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump.patch
+++ b/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump.patch
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
- fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 900);
+ fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
}
+
@@ -23,9 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
- private boolean bE;
+ private boolean bD;
private Entity leashHolder;
- private NBTTagCompound bG;
+ private NBTTagCompound bF;
++ private NBTTagCompound bG;
+ public PathfinderGoalFloat goalFloat; // Paper
public EntityInsentient(World world) {
diff --git a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch
index 750f9579c3..89de1be817 100644
--- a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch
+++ b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch
@@ -32,8 +32,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private int neighbors = 0x1 << 12;
public long chunkKey;
@@ -0,0 +0,0 @@ public class Chunk {
- entity.ad = k;
- entity.ae = this.locZ;
+ entity.ac = k;
+ entity.ad = this.locZ;
this.entitySlices[k].add(entity);
+ // Paper start - update count
+ if (entity instanceof EntityItem) {
diff --git a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch
index 714c3ef8d4..2a6fa7c7ed 100644
--- a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch
+++ b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch
@@ -12,15 +12,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final DataWatcherObject aB = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
private static final DataWatcherObject aC = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
private static final DataWatcherObject aD = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
-- public boolean ab;
+- public boolean aa;
+- public int ab;
- public int ac;
- public int ad;
-- public int ae;
-+ public boolean ab; public boolean isAddedToChunk() { return ab; } // Paper - OBFHELPER
-+ public int ac; public int getChunkX() { return ac; } // Paper - OBFHELPER
-+ public int ad; public int getChunkY() { return ad; } // Paper - OBFHELPER
-+ public int ae; public int getChunkZ() { return ae; } // Paper - OBFHELPER
- public boolean ai;
++ public boolean aa; public boolean isAddedToChunk() { return aa; } // Paper - OBFHELPER
++ public int ab; public int getChunkX() { return ab; } // Paper - OBFHELPER
++ public int ac; public int getChunkY() { return ac; } // Paper - OBFHELPER
++ public int ad; public int getChunkZ() { return ad; } // Paper - OBFHELPER
+ public boolean ah;
public boolean impulse;
public int portalCooldown;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
@@ -64,10 +64,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- for (i = 0; i < this.f.size(); ++i) {
- entity = (Entity) this.f.get(i);
-- int k = entity.ac;
+- int k = entity.ab;
-
-- j = entity.ae;
-- if (entity.ab && this.isChunkLoaded(k, j, true)) {
+- j = entity.ad;
+- if (entity.aa && this.isChunkLoaded(k, j, true)) {
- this.getChunkAt(k, j).b(entity);
+ if (e.isAddedToChunk() && this.isChunkLoaded(k, j, true)) {
+ this.getChunkAt(k, j).b(e);
diff --git a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch
index 143273b986..204c4bc873 100644
--- a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch
+++ b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch
@@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile {
- this.b(i, j, (int) (MinecraftServer.av() / 1000L));
+ this.b(i, j, (int) (MinecraftServer.aw() / 1000L));
} catch (IOException ioexception) {
- ioexception.printStackTrace();
- ServerInternalException.reportInternalException(ioexception); // Paper
diff --git a/Spigot-Server-Patches/Chunk-registration-fixes.patch b/Spigot-Server-Patches/Chunk-registration-fixes.patch
index 7b97492e59..a559a4690f 100644
--- a/Spigot-Server-Patches/Chunk-registration-fixes.patch
+++ b/Spigot-Server-Patches/Chunk-registration-fixes.patch
@@ -19,5 +19,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ int l = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior
int i1 = MathHelper.floor(entity.locZ / 16.0D);
- if (!entity.ab || entity.ac != k || entity.ad != l || entity.ae != i1) {
+ if (!entity.aa || entity.ab != k || entity.ac != l || entity.ad != i1) {
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch
index 536bdd2a63..4b36a4e7d6 100644
--- a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch
+++ b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch
@@ -25,15 +25,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
- long j = av();
+ long j = aw();
i = 0;
- for (int k = -192; k <= 192 && this.isRunning(); k += 16) {
- for (int l = -192; l <= 192 && this.isRunning(); l += 16) {
-+ short radius = worldserver.paperConfig.keepLoadedRange; // Paper
-+ for (int k = -radius; k <= radius && this.isRunning(); k += 16) { // Paper
-+ for (int l = -radius; l <= radius && this.isRunning(); l += 16) { // Paper
- long i1 = av();
++ // Paper start
++ short radius = worldserver.paperConfig.keepLoadedRange;
++ for (int k = -radius; k <= radius && this.isRunning(); k += 16) {
++ for (int l = -radius; l <= radius && this.isRunning(); l += 16) {
++ // Paper end
+ long i1 = aw();
if (i1 - j > 1000L) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
diff --git a/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch b/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch
index 9e500e6a6f..f3f3c4ecea 100644
--- a/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch
+++ b/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch
@@ -28,12 +28,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile {
-
- if (block == this.aw && i == this.ax) {
- ++this.ay;
-- if (this.ay >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter
-+ if (this.ay >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot - First int after shooter // Paper
+ this.ay = 0;
+ } else {
+ ++this.ax;
+- if (this.ax >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter
++ if (this.ax >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot - First int after shooter // Paper
this.die();
}
- } else {
+ }
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Configurable-Player-Collision.patch b/Spigot-Server-Patches/Configurable-Player-Collision.patch
index 5324b70a01..a42a9aff1b 100644
--- a/Spigot-Server-Patches/Configurable-Player-Collision.patch
+++ b/Spigot-Server-Patches/Configurable-Player-Collision.patch
@@ -100,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
PlayerList.f.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at ([" + entityplayer.world.worldData.getName() + "]" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")");
}
@@ -0,0 +0,0 @@ public abstract class PlayerList {
- entityplayer.k_();// SPIGOT-924 // PAIL: rename - playerTick
+ entityplayer.playerTick();// SPIGOT-924
// CraftBukkit end
+ // Paper start - Remove from collideRule team if needed
diff --git a/Spigot-Server-Patches/Configurable-baby-zombie-movement-speed.patch b/Spigot-Server-Patches/Configurable-baby-zombie-movement-speed.patch
index 452d50a782..1e0c894aec 100644
--- a/Spigot-Server-Patches/Configurable-baby-zombie-movement-speed.patch
+++ b/Spigot-Server-Patches/Configurable-baby-zombie-movement-speed.patch
@@ -29,9 +29,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
- private static final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, 1);
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, 1); // Paper - Remove static - Make baby speed configurable
- private static final DataWatcherObject bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
- private static final DataWatcherObject by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
- private static final DataWatcherObject bz = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
+ private static final DataWatcherObject bw = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
+ private static final DataWatcherObject bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
+ private static final DataWatcherObject by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
if (this.world != null && !this.world.isClientSide) {
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
diff --git a/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch b/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch
index 624a2e7837..788e521c31 100644
--- a/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch
+++ b/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public int fishingMaxTicks;
+ private void fishingTickRange() {
+ fishingMinTicks = getInt("fishing-time-range.MinimumTicks", 100);
-+ fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 900);
++ fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
+ log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
+ }
}
@@ -26,12 +26,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
- this.aw = MathHelper.nextInt(this.random, 20, 80);
- }
- } else {
-- this.av = MathHelper.nextInt(this.random, 100, 900);
-+ this.av = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper - Configurable fishing time range
- this.av -= EnchantmentManager.g(this.owner) * 20 * 5;
- }
- }
+ this.at = MathHelper.nextInt(this.random, 20, 80);
+ }
+ } else {
+- this.h = MathHelper.nextInt(this.random, 100, 600);
++ this.h = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper - Configurable fishing time range
+ this.h -= EnchantmentManager.g(this.owner) * 20 * 5;
+ }
+ }
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch b/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch
index b51f14e9e6..2fa7eaa6f7 100644
--- a/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch
+++ b/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch
@@ -15,10 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ public double skeleHorseSpawnChance;
+ private void skeleHorseSpawnChance() {
-+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", -1.0D); // -1.0D represents a "vanilla" state
-+ if (skeleHorseSpawnChance < 0) {
-+ skeleHorseSpawnChance = 0.05D; // Vanilla
-+ }
++ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
@@ -29,9 +26,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.D(blockposition);
-- if (this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.05D) {
-+ if (this.random.nextDouble() < difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { // Paper - Configurable skeleton horse spawn chance
- EntityHorse entityhorse = new EntityHorse(this);
+- if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) {
++ if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) {
+ EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
- entityhorse.setType(EnumHorseType.SKELETON);
+ entityhorseskeleton.p(true);
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Configurable-squid-spawn-ranges.patch b/Spigot-Server-Patches/Configurable-squid-spawn-ranges.patch
index b987dd9237..d9ef753495 100644
--- a/Spigot-Server-Patches/Configurable-squid-spawn-ranges.patch
+++ b/Spigot-Server-Patches/Configurable-squid-spawn-ranges.patch
@@ -28,10 +28,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal {
}
- public boolean cK() {
-- return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cK();
-+ // Paper - Configurable squid spawn height range
-+ return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cK();
+ public boolean cM() {
+- return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cM();
++ return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cM(); // Paper - Configurable squid spawn height range
}
public void b(float f, float f1, float f2) {
diff --git a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch
index 5045256f34..78a5dab3a3 100644
--- a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch
+++ b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch
@@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.bo.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
+ ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.activeItem.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
+ this.a(this.cz(), itemstack);
// CraftBukkit end
-
++
+ // Paper start - save the default replacement item and change it if necessary
+ final ItemStack defaultReplacement = itemstack;
+ if (event.getReplacement() != null) {
@@ -19,12 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
- if (itemstack != null && itemstack.count == 0) {
- itemstack = null;
- }
-
- this.a(this.cy(), itemstack);
- this.cE();
+ this.cF();
+
+ // Paper start - if the replacement is anything but the default, update the client inventory
+ if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
diff --git a/Spigot-Server-Patches/Disable-explosion-knockback.patch b/Spigot-Server-Patches/Disable-explosion-knockback.patch
index 1ffeecf13a..f2e4b4be80 100644
--- a/Spigot-Server-Patches/Disable-explosion-knockback.patch
+++ b/Spigot-Server-Patches/Disable-explosion-knockback.patch
@@ -44,14 +44,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
+
if (this.getHealth() <= 0.0F) {
- SoundEffect soundeffect = this.bW();
-
+ if (!this.d(damagesource)) {
+ SoundEffect soundeffect = this.bX();
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion {
- double d14 = 1.0D;
+ double d14 = d13;
if (entity instanceof EntityLiving) {
- d14 = EnchantmentProtection.a((EntityLiving) entity, d13);
diff --git a/Spigot-Server-Patches/Disable-ticking-of-snow-blocks.patch b/Spigot-Server-Patches/Disable-ticking-of-snow-blocks.patch
index fc53483ba7..22330e5bc2 100644
--- a/Spigot-Server-Patches/Disable-ticking-of-snow-blocks.patch
+++ b/Spigot-Server-Patches/Disable-ticking-of-snow-blocks.patch
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - snow blocks don't need to tick
+ /*
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
- if (world.b(EnumSkyBlock.BLOCK, blockposition) > 11) {
+ if (world.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) {
this.b(world, blockposition, world.getType(blockposition), 0);
@@ -0,0 +0,0 @@ public class BlockSnowBlock extends Block {
}
diff --git a/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch
index 7a47f6e45d..3f055cfc8e 100644
--- a/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch
+++ b/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch
@@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.N;
}
-+ public boolean shouldStayLoaded(int i, int j) { return d(i, j); } // Paper - OBFHELPER
- public boolean d(int i, int j) {
++ public boolean shouldStayLoaded(int i, int j) { return e(i, j); } // Paper - OBFHELPER
+ public boolean e(int i, int j) {
BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX();
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -21,12 +21,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -0,0 +0,0 @@ public abstract class WorldProvider {
+ public void s() {}
- public void r() {}
-
-- public boolean c(int i, int j) {
+ public boolean c(int i, int j) {
- return true;
-+ public boolean c(int i, int j) { // Method is "can chunk unload"
+ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds
}
}
diff --git a/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch
index 9aca16b505..40eeb7231a 100644
--- a/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch
+++ b/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch
@@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
}
- this.move(this.motX, this.motY, this.motZ);
+ this.move(EnumMoveType.SELF, this.motX, this.motY, this.motZ);
+
+ // Paper start - Configurable EntityFallingBlock height nerf
+ if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperConfig.fallingBlockHeightNerf) {
@@ -41,7 +41,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.die();
+ }
+ // Paper end
-+
this.motX *= 0.9800000190734863D;
this.motY *= 0.9800000190734863D;
this.motZ *= 0.9800000190734863D;
@@ -52,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
}
- this.move(this.motX, this.motY, this.motZ);
+ this.move(EnumMoveType.SELF, this.motX, this.motY, this.motZ);
+
+ // Paper start - Configurable TNT entity height nerf
+ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY > this.world.paperConfig.entityTNTHeightNerf) {
diff --git a/Spigot-Server-Patches/Ensure-inv-drag-is-in-bounds.patch b/Spigot-Server-Patches/Ensure-inv-drag-is-in-bounds.patch
index 8d66ea7018..58ab98afd0 100644
--- a/Spigot-Server-Patches/Ensure-inv-drag-is-in-bounds.patch
+++ b/Spigot-Server-Patches/Ensure-inv-drag-is-in-bounds.patch
@@ -15,6 +15,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- Slot slot = (Slot) this.c.get(i);
+ Slot slot = i < this.c.size() ? this.c.get(i) : null; // Paper - Ensure drag in bounds
- if (slot != null && a(slot, playerinventory.getCarried(), true) && slot.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count > this.h.size() && this.b(slot)) {
- this.h.add(slot);
+ itemstack1 = playerinventory.getCarried();
+ if (slot != null && a(slot, itemstack1, true) && slot.isAllowed(itemstack1) && (this.dragType == 2 || itemstack1.getCount() > this.h.size()) && this.b(slot)) {
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Entity-Origin-API.patch b/Spigot-Server-Patches/Entity-Origin-API.patch
index bd16c2015e..842b7f7e41 100644
--- a/Spigot-Server-Patches/Entity-Origin-API.patch
+++ b/Spigot-Server-Patches/Entity-Origin-API.patch
@@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
}
- public EntityLiving getSource() {
+ @Nullable
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/World.java
@@ -122,11 +122,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
}
-diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingSand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingSand.java
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingSand.java
-+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingSand.java
-@@ -0,0 +0,0 @@ public class CraftFallingSand extends CraftEntity implements FallingSand {
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
+@@ -0,0 +0,0 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock {
// Second field for EntityFallingBlock
getHandle().ticksLived = value;
}
diff --git a/Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch
index 55a2280656..d45c7e51d5 100644
--- a/Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch
+++ b/Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch
@@ -33,10 +33,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -0,0 +0,0 @@ public class FoodMetaData {
if (this.foodTickTimer >= 10) {
- float f = Math.min(this.saturationLevel, 4.0F);
+ float f = Math.min(this.saturationLevel, 6.0F);
-- entityhuman.heal(f / 4.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
-+ entityhuman.heal(f / 4.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen
+- entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
++ entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen
this.a(f);
this.foodTickTimer = 0;
}
diff --git a/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
index 67775d11e8..564ab4988e 100644
--- a/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
+++ b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
@@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
}
- public void applyPhysics(BlockPosition blockposition, Block block) {
+ public void applyPhysics(BlockPosition blockposition, Block block, boolean flag) {
+ if (captureBlockStates) { return; } // Paper - Cancel all physics during placement
- this.e(blockposition.west(), block);
- this.e(blockposition.east(), block);
- this.e(blockposition.down(), block);
+ this.a(blockposition.west(), block, blockposition);
+ this.a(blockposition.east(), block, blockposition);
+ this.a(blockposition.down(), block, blockposition);
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch b/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch
index 7b41135e07..0ce225cb6f 100644
--- a/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch
+++ b/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch
@@ -15,9 +15,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class Chunk {
private long w;
private int x;
- private ConcurrentLinkedQueue y;
+ private final ConcurrentLinkedQueue y;
- public boolean d;
-+ public boolean d;public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER
++ public boolean d; public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER
protected gnu.trove.map.hash.TObjectIntHashMap entityCount = new gnu.trove.map.hash.TObjectIntHashMap(); // Spigot
// Paper start
diff --git a/Spigot-Server-Patches/Fix-FallingBlocks-being-stuck-on-fences.patch b/Spigot-Server-Patches/Fix-FallingBlocks-being-stuck-on-fences.patch
index 949fb8e139..d9f7935023 100644
--- a/Spigot-Server-Patches/Fix-FallingBlocks-being-stuck-on-fences.patch
+++ b/Spigot-Server-Patches/Fix-FallingBlocks-being-stuck-on-fences.patch
@@ -39,7 +39,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
+
public void a_(World world, BlockPosition blockposition) {}
- }
+
+ public void b(World world, BlockPosition blockposition) {}
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
diff --git a/Spigot-Server-Patches/Fix-Furnace-cook-time-bug.patch b/Spigot-Server-Patches/Fix-Furnace-cook-time-bug.patch
index a61d8090df..4fd3677878 100644
--- a/Spigot-Server-Patches/Fix-Furnace-cook-time-bug.patch
+++ b/Spigot-Server-Patches/Fix-Furnace-cook-time-bug.patch
@@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.cookTime += elapsedTicks;
if (this.cookTime >= this.cookTimeTotal) {
- this.cookTime = 0;
-+ this.cookTime -= this.a(this.items[0]); // Paper
- this.cookTimeTotal = this.a(this.items[0]);
++ this.cookTime -= this.a(this.items.get(0)); // Paper
+ this.cookTimeTotal = this.a((ItemStack) this.items.get(0));
this.burn();
flag1 = true;
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch b/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch
index 5d81b5ce3c..f35f4af43d 100644
--- a/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch
+++ b/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch
@@ -43,8 +43,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
+ boolean isLoadingStructure = false; // Paper
private static final Logger a = LogManager.getLogger();
- private static final Map> f = Maps.newHashMap();
- private static final Map, String> g = Maps.newHashMap();
+ private static final RegistryMaterials> f = new RegistryMaterials();
+ protected World world;
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
diff --git a/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch
index 4200479ec8..a27a618ddc 100644
--- a/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch
+++ b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {
- playerconnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
+ playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities));
playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
+ playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean("reducedDebugInfo") ? 22 : 23))); // Paper - fix this rule not being initialized on the client
diff --git a/Spigot-Server-Patches/Generator-Settings.patch b/Spigot-Server-Patches/Generator-Settings.patch
index 7eec5f552c..80ad1b09c1 100644
--- a/Spigot-Server-Patches/Generator-Settings.patch
+++ b/Spigot-Server-Patches/Generator-Settings.patch
@@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (i2 <= random.nextInt(5)) {
+ if (i2 <= (world.paperConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock
chunksnapshot.a(l, i2, k, BiomeMesa.c);
- } else if (l1 < 15) {
+ } else if (l1 < 15 || this.J) {
IBlockData iblockdata2 = chunksnapshot.a(l, i2, k);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderFlat.java b/src/main/java/net/minecraft/server/ChunkProviderFlat.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -77,27 +77,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!map1.containsKey("size")) {
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator {
- this.e.add(new WorldGenVillage(map1));
+ this.e.put("Village", new WorldGenVillage(map1));
}
- if (map.containsKey("biome_1")) {
+ if (map.containsKey("biome_1") && world.paperConfig.generateTemple) { // Paper
- this.e.add(new WorldGenLargeFeature((Map) map.get("biome_1")));
+ this.e.put("Temple", new WorldGenLargeFeature((Map) map.get("biome_1")));
}
- if (map.containsKey("mineshaft")) {
+ if (map.containsKey("mineshaft") && world.paperConfig.generateMineshaft) { // Paper
- this.e.add(new WorldGenMineshaft((Map) map.get("mineshaft")));
+ this.e.put("Mineshaft", new WorldGenMineshaft((Map) map.get("mineshaft")));
}
- if (map.containsKey("stronghold")) {
+ if (map.containsKey("stronghold") && world.paperConfig.generateStronghold) { // Paper
- this.e.add(new WorldGenStronghold((Map) map.get("stronghold")));
+ this.e.put("Stronghold", new WorldGenStronghold((Map) map.get("stronghold")));
}
- if (map.containsKey("oceanmonument")) {
+ if (map.containsKey("oceanmonument") && world.paperConfig.generateMonument) { // Paper
- this.e.add(new WorldGenMonument((Map) map.get("oceanmonument")));
+ this.e.put("Monument", new WorldGenMonument((Map) map.get("oceanmonument")));
}
}
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator {
@@ -115,15 +115,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
this.a(i, j, chunksnapshot);
- this.C = this.n.getWorldChunkManager().getBiomeBlock(this.C, i * 16, j * 16, 16, 16);
- this.a(i, j, chunksnapshot, this.C);
+ this.D = this.n.getWorldChunkManager().getBiomeBlock(this.D, i * 16, j * 16, 16, 16);
+ this.a(i, j, chunksnapshot, this.D);
- if (this.s.r) {
+ if (this.s.r && this.n.paperConfig.generateCaves) { // Paper
this.v.a(this.n, i, j, chunksnapshot);
}
-- if (this.s.z) {
-+ if (this.s.z && this.n.paperConfig.generateCanyon) { // Paper
+- if (this.s.A) {
++ if (this.s.A && this.n.paperConfig.generateCanyon) { // Paper
this.A.a(this.n, i, j, chunksnapshot);
}
@@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, i, j, chunksnapshot);
}
- }
+
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
@@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, this.i, chunkcoordintpair);
}
- }
+
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
}
}
@@ -219,7 +219,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, i, j, (ChunkSnapshot) null);
}
- }
+
diff --git a/src/main/java/net/minecraft/server/ChunkProviderHell.java b/src/main/java/net/minecraft/server/ChunkProviderHell.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderHell.java
@@ -259,9 +259,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class StructureGenerator extends WorldGenBase {
}
- public synchronized boolean b(World world, BlockPosition blockposition) { // CraftBukkit - synchronized
+ public boolean a(World world, BlockPosition blockposition) {
+ if (this.g == null) return false; // Paper
this.a(world);
- Iterator iterator = this.c.values().iterator();
+ ObjectIterator objectiterator = this.c.values().iterator();
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch
index d0d2c779c6..98e6f23502 100644
--- a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch
+++ b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ import org.bukkit.inventory.MainHand;
public class EntityPlayer extends EntityHuman implements ICrafting {
- private static final Logger bS = LogManager.getLogger();
+ private static final Logger bR = LogManager.getLogger();
- public String locale = "en_US"; // Spigot private -> public
+ public String locale = null; // Spigot private -> public // Paper - default to null
public PlayerConnection playerConnection;
@@ -30,9 +30,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent();
+ }
+ // Paper end
- this.ch = packetplayinsettings.c();
- this.ci = packetplayinsettings.d();
- this.getDataWatcher().set(EntityPlayer.br, Byte.valueOf((byte) packetplayinsettings.e()));
+ this.cg = packetplayinsettings.c();
+ this.ch = packetplayinsettings.d();
+ this.getDataWatcher().set(EntityPlayer.bq, Byte.valueOf((byte) packetplayinsettings.e()));
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
diff --git a/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
index 0ec488e6c1..ccef40cbc5 100644
--- a/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
+++ b/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
@@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
EntityItemFrame entityitemframe = (EntityItemFrame) this.tracker;
ItemStack itemstack = entityitemframe.getItem();
-- if (this.a % 10 == 0 && itemstack != null && itemstack.getItem() instanceof ItemWorldMap) { // CraftBukkit - Moved this.m % 10 logic here so item frames do not enter the other blocks
+- if (this.a % 10 == 0 && itemstack.getItem() instanceof ItemWorldMap) { // CraftBukkit - Moved this.a % 10 logic here so item frames do not enter the other blocks
+ if (itemstack != null && itemstack.getItem() instanceof ItemWorldMap) { // Paper - moved back up
WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, this.tracker.world);
Iterator iterator = this.trackedPlayers.iterator(); // CraftBukkit
@@ -64,8 +64,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldMap.java
+++ b/src/main/java/net/minecraft/server/WorldMap.java
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
- public List h = Lists.newArrayList();
- public final Map j = Maps.newHashMap(); // Spigot
+ public List i = Lists.newArrayList();
+ public final Map k = Maps.newHashMap(); // Spigot private -> public
public Map decorations = Maps.newLinkedHashMap(); // Spigot
+ private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper
@@ -93,7 +93,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public void updateSeenPlayers(EntityHuman entityhuman, ItemStack itemstack) { a(entityhuman, itemstack); } // Paper - OBFHELPER
public void a(EntityHuman entityhuman, ItemStack itemstack) {
- if (!this.j.containsKey(entityhuman)) {
+ if (!this.k.containsKey(entityhuman)) {
WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman);
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
@@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private boolean d = true;
private int e;
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
-
+ @Nullable
public Packet> a(ItemStack itemstack) {
// CraftBukkit start
- org.bukkit.craftbukkit.map.RenderData render = WorldMap.this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) this.trackee.getBukkitEntity()); // CraftBukkit
diff --git a/Spigot-Server-Patches/Improve-Minecraft-Hopper-Performance.patch b/Spigot-Server-Patches/Improve-Minecraft-Hopper-Performance.patch
index 3c38720406..3e45d1b59f 100644
--- a/Spigot-Server-Patches/Improve-Minecraft-Hopper-Performance.patch
+++ b/Spigot-Server-Patches/Improve-Minecraft-Hopper-Performance.patch
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -0,0 +0,0 @@ public abstract class TileEntity {
- }
+ return (MinecraftKey) TileEntity.f.b(oclass);
}
+ static boolean IGNORE_TILE_UPDATES = false; // Paper
@@ -25,44 +25,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (IGNORE_TILE_UPDATES) return; // Paper
IBlockData iblockdata = this.world.getType(this.position);
- this.h = iblockdata.getBlock().toLegacyData(iblockdata);
+ this.g = iblockdata.getBlock().toLegacyData(iblockdata);
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
- return true;
- }
- }
-+
- return false;
- } else {
- return false;
-@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
- boolean flag = false;
+ boolean flag1 = iinventory1.w_();
- if (itemstack1 == null) {
+ if (itemstack1.isEmpty()) {
+ IGNORE_TILE_UPDATES = true; // Paper
- iinventory.setItem(i, itemstack);
+ iinventory1.setItem(i, itemstack);
+ IGNORE_TILE_UPDATES = false; // Paper
- itemstack = null;
+ itemstack = ItemStack.a;
flag = true;
} else if (a(itemstack1, itemstack)) {
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
- tileentityhopper.setCooldown(tileentityhopper.world.spigotConfig.hopperTransfer); // Spigot
}
-
-- iinventory.update();
-+ //iinventory.update(); // Paper
}
- iinventory.update();
+- iinventory1.update();
++ //iinventory1.update(); // Paper
+ }
+ }
+
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
- this.g = i;
+ this.f = i;
}
-+ boolean isCooledDown() { return o(); } // Paper - OBFHELPER
- public boolean o() {
- return this.g > 0;
++ boolean isCooledDown() { return J(); } // Paper - OBFHELPER
+ private boolean J() {
+ return this.f > 0;
}
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Lighting-Queue.patch b/Spigot-Server-Patches/Lighting-Queue.patch
index 24ec84b50e..fceceee7b3 100644
--- a/Spigot-Server-Patches/Lighting-Queue.patch
+++ b/Spigot-Server-Patches/Lighting-Queue.patch
@@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ long i = System.nanoTime(); long startTime = i; // Paper
++this.ticks;
- if (this.S) {
+ if (this.T) {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b();
diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
index 77e90e0af9..60683674b4 100644
--- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
+++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
@@ -437,8 +437,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable {
+public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable, CraftLootableInventory { // Paper
- private ItemStack[] items = new ItemStack[27]; // CraftBukkit - 36 -> 27
- private boolean b = true;
+ private NonNullList items;
+ private boolean b;
private MinecraftKey c;
- private long d;
+ private long d;public long getLootTableSeed() { return d; } // Paper - OBFHELPER
@@ -457,22 +457,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
- } else {
+ } if (true) { // Paper - Always save the items, Table may stick around
- NBTTagList nbttaglist = new NBTTagList();
+ ContainerUtil.a(nbttagcompound, this.items);
+ }
- for (int i = 0; i < this.items.length; ++i) {
@@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
- protected void a(NBTTagCompound nbttagcompound) {
- super.a(nbttagcompound);
- this.items = new ItemStack[this.getSize()];
-+ lootableData.loadNbt(nbttagcompound); // Paper
if (nbttagcompound.hasKeyOfType("LootTable", 8)) {
this.c = new MinecraftKey(nbttagcompound.getString("LootTable"));
this.d = nbttagcompound.getLong("LootTableSeed");
- } else {
+ } if (true) { // Paper - always load the items, table may still remain
- NBTTagList nbttaglist = nbttagcompound.getList("Items", 10);
+ ContainerUtil.b(nbttagcompound, this.items);
+ }
- for (int i = 0; i < nbttaglist.size(); ++i) {
@@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
}
@@ -487,7 +483,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.d == 0L) {
@@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
-
+ this.items.clear();
}
+ public void setLootTable(MinecraftKey key, long seed) { a(key, seed);} // Paper - OBFHELPER
@@ -559,6 +555,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
protected MinecraftKey m;
- protected long n;
+ protected long n; public long getLootTableSeed() { return n; } // Paper - OBFHELPER
+ protected String o;
public TileEntityLootable() {}
@@ -589,7 +586,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
- protected void d(@Nullable EntityHuman entityhuman) {
+ public void d(@Nullable EntityHuman entityhuman) {
- if (this.m != null) {
+ if (lootableData.shouldReplenish(entityhuman)) { // Paper
LootTable loottable = this.world.ak().a(this.m);
@@ -612,7 +609,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void a(MinecraftKey minecraftkey, long i) {
this.m = minecraftkey;
this.n = i;
+@@ -0,0 +0,0 @@ public abstract class TileEntityLootable extends TileEntityContainer implements
}
+
+ protected abstract NonNullList q();
+
+ // Paper start - LootTable API
+ private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this);
@@ -650,6 +650,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.m = (MinecraftKey) null;
+ }
+ // Paper end
++
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -722,7 +723,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import net.minecraft.server.EntityMinecartChest;
import org.bukkit.craftbukkit.CraftServer;
-@@ -0,0 +0,0 @@ import org.bukkit.entity.StorageMinecart;
+@@ -0,0 +0,0 @@ import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.inventory.Inventory;
@SuppressWarnings("deprecation")
diff --git a/Spigot-Server-Patches/MC-Dev-fixes.patch b/Spigot-Server-Patches/MC-Dev-fixes.patch
index 10ff3d70b5..963cbdf293 100644
--- a/Spigot-Server-Patches/MC-Dev-fixes.patch
+++ b/Spigot-Server-Patches/MC-Dev-fixes.patch
@@ -54,8 +54,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- return (Entity) object;
+ return (T) object; // Paper - fix decompile error
} else {
- throw new ExceptionEntityNotFound();
+ throw new ExceptionEntityNotFound(s);
}
+@@ -0,0 +0,0 @@ public abstract class CommandAbstract implements ICommand {
+ }
+
+ private static > IBlockData a(IBlockData iblockdata, IBlockState iblockstate, Comparable> comparable) {
+- return iblockdata.set(iblockstate, comparable);
++ return iblockdata.set(iblockstate, (T) comparable); // Paper - fix decompiler error
+ }
+
+ public static Predicate b(final Block block, String s) throws ExceptionInvalidBlockState {
+@@ -0,0 +0,0 @@ public abstract class CommandAbstract implements ICommand {
+
+ @Nullable
+ private static > T a(IBlockState iblockstate, String s) {
+- return (Comparable) iblockstate.b(s).orNull();
++ return iblockstate.b(s).orNull(); // Paper - fix decompiler error
+ }
+
+ public static String a(Object[] aobject) {
@@ -0,0 +0,0 @@ public abstract class CommandAbstract implements ICommand {
return this.getCommand().compareTo(icommand.getCommand());
}
@@ -65,6 +83,66 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.a((ICommand) object);
}
+diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/IEntitySelector.java
++++ b/src/main/java/net/minecraft/server/IEntitySelector.java
+@@ -0,0 +0,0 @@ public final class IEntitySelector {
+ }
+
+ public boolean apply(@Nullable Object object) {
+- return this.a((Entity) object);
++ return this.a((T) object); // Paper - Fix decompile error
+ }
+ };
+ }
+@@ -0,0 +0,0 @@ public final class IEntitySelector {
+ final ScoreboardTeamBase.EnumTeamPush scoreboardteambase_enumteampush = scoreboardteambase == null ? ScoreboardTeamBase.EnumTeamPush.ALWAYS : scoreboardteambase.getCollisionRule();
+
+ return scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER ? Predicates.alwaysFalse() : Predicates.and(IEntitySelector.e, new Predicate() {
+- public boolean a(@Nullable Entity entity) {
++ public boolean a(@Nullable Entity entity1) { // Paper - fix decompile error
+ if (!entity.isCollidable()) {
+ return false;
+ } else if (entity1.world.isClientSide && (!(entity instanceof EntityHuman) || !((EntityHuman) entity).cR())) {
+@@ -0,0 +0,0 @@ public final class IEntitySelector {
+ if (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER) {
+ return false;
+ } else {
+- boolean flag = scoreboardteambase1 != null && scoreboardteambase1.isAlly(scoreboardteambase);
++ boolean flag = scoreboardteambase != null && scoreboardteambase.isAlly(scoreboardteambase); // Paper - fix decompile error
+
+- return (scoreboardteambase_enumteampush1 == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM || scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM) && flag ? false : scoreboardteambase_enumteampush1 != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS && scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS || flag;
++ // Paper - fix decompiler error
++ return (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM || scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM) && flag ? false : scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS && scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS || flag;
+ }
+ }
+ }
+@@ -0,0 +0,0 @@ public final class IEntitySelector {
+
+ public static Predicate b(final Entity entity) {
+ return new Predicate() {
+- public boolean a(@Nullable Entity entity) {
++ public boolean a(@Nullable Entity entity1) { // Paper - fix decompile error
+ while (true) {
+- if (entity.isPassenger()) {
+- entity = entity.bB();
++ // Paper start - fix decompile error - entity -> entity1 - double check this
++ if (entity1.isPassenger()) {
++ entity1 = entity.bB();
++ // Paper end
+ if (entity != entity1) {
+ continue;
+ }
+@@ -0,0 +0,0 @@ public final class IEntitySelector {
+ }
+ }
+
+- public boolean apply(@Nullable Object object) {
++ public boolean apply(@Nullable Entity object) {
+ return this.a((Entity) object);
+ }
+ }
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
@@ -78,6 +156,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
final Collection names = new HashSet();
for (ZipEntry clazzEntry; (clazzEntry = nmsZipStream.getNextEntry()) != null; ) {
final String entryName = clazzEntry.getName();
---
-2.7.4 (Apple Git-66)
-
+--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Make-entities-look-for-hoppers.patch b/Spigot-Server-Patches/Make-entities-look-for-hoppers.patch
index b5193aa205..1d6ebd4250 100644
--- a/Spigot-Server-Patches/Make-entities-look-for-hoppers.patch
+++ b/Spigot-Server-Patches/Make-entities-look-for-hoppers.patch
@@ -99,8 +99,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
-+ public final boolean intersects(AxisAlignedBB intersecting) { return this.b(intersecting); } // Paper - OBFHELPER
- public boolean b(AxisAlignedBB axisalignedbb) {
++ public final boolean intersects(AxisAlignedBB intersecting) { return this.c(intersecting); } // Paper - OBFHELPER
+ public boolean c(AxisAlignedBB axisalignedbb) {
return this.a(axisalignedbb.a, axisalignedbb.b, axisalignedbb.c, axisalignedbb.d, axisalignedbb.e, axisalignedbb.f);
}
diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java
@@ -182,16 +182,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+public class EntityItem extends Entity implements HopperPusher {
+ @Override
+ public boolean acceptItem(TileEntityHopper hopper) {
-+ return TileEntityHopper.a(hopper, this);
++ return TileEntityHopper.putDropInInventory(null, hopper, this);
+ }
+// Paper end
private static final Logger b = LogManager.getLogger();
- private static final DataWatcherObject> c = DataWatcher.a(EntityItem.class, DataWatcherRegistry.f);
+ private static final DataWatcherObject c = DataWatcher.a(EntityItem.class, DataWatcherRegistry.f);
@@ -0,0 +0,0 @@ public class EntityItem extends Entity {
this.die();
} else {
- super.m();
+ super.A_();
+ if (tryPutInHopper()) return; // Paper
// CraftBukkit start - Use wall time for pickup and despawn timers
int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
@@ -229,8 +229,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
-+ public void m() {
-+ super.m();
++ public void A_() {
++ super.A_();
+ tryPutInHopper();
+ }
+
@@ -241,8 +241,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
- private ItemStack[] items = new ItemStack[27]; // CraftBukkit - 36 -> 27
- private boolean b = true;
+ private NonNullList items;
+ private boolean b;
diff --git a/src/main/java/net/minecraft/server/IHopper.java b/src/main/java/net/minecraft/server/IHopper.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/IHopper.java
@@ -267,10 +267,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
}
- public boolean m() {
+ private boolean o() {
+ mayAcceptItems = false; // Paper - at the beginning of a tick, assume we can't accept items
if (this.world != null && !this.world.isClientSide) {
- if (!this.o() && BlockHopper.f(this.u())) {
+ if (!this.J() && BlockHopper.f(this.v())) {
boolean flag = false;
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
}
@@ -292,9 +292,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
- private boolean q() {
- ItemStack[] aitemstack = this.items;
- int i = aitemstack.length;
+ private boolean p() {
+ Iterator iterator = this.items.iterator();
+
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
return true;
}
@@ -323,9 +323,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) {
EntityItem entityitem = (EntityItem) iterator.next();
+@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
+ return false;
+ }
+
++ public static boolean putDropInInventory(IInventory iinventory, IInventory iinventory1, EntityItem entityitem) { return a(iinventory, iinventory1, entityitem); } // Paper - OBFHELPER
+ public static boolean a(IInventory iinventory, IInventory iinventory1, EntityItem entityitem) {
+ boolean flag = false;
+
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
private IInventory I() {
- EnumDirection enumdirection = BlockHopper.e(this.u());
+ EnumDirection enumdirection = BlockHopper.e(this.v());
- return b(this.getWorld(), this.E() + (double) enumdirection.getAdjacentX(), this.F() + (double) enumdirection.getAdjacentY(), this.G() + (double) enumdirection.getAdjacentZ());
+ // Paper start - don't search for entities in push mode
diff --git a/Spigot-Server-Patches/Minecart-drop-name-workaround.patch b/Spigot-Server-Patches/Minecart-drop-name-workaround.patch
deleted file mode 100644
index b3072b7029..0000000000
--- a/Spigot-Server-Patches/Minecart-drop-name-workaround.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Fabse
-Date: Mon, 28 Mar 2016 00:46:46 +0200
-Subject: [PATCH] Minecart drop name workaround
-
-This is a workaround for MC-68446 (or similar).
-In Survival Minecraft this bug only shows in minecart drops, so this is the only thing fixed here.
-
-diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
-+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
-@@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT
- if (this.world.getGameRules().getBoolean("doEntityDrops")) {
- ItemStack itemstack = new ItemStack(Items.MINECART, 1);
-
-- if (this.getName() != null) {
-+ if (this.hasCustomName()) { // Paper - Only set item name if custom name is set. Workaround for MC-68446
- itemstack.c(this.getName());
- }
-
---
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
index 703882702e..3aa7b29631 100644
--- a/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
+++ b/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
- if (this.bH == 1) {
+ if (this.bG == 1) {
// CraftBukkit start - Use relative location for far away sounds
// this.world.a(1028, new BlockPosition(this), 0);
- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
diff --git a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch
index cde326d31b..4f740324d9 100644
--- a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch
+++ b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch
@@ -12,10 +12,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.entity.HumanEntity;
// CraftBukkit end
--public class TileEntityChest extends TileEntityLootable implements ITickable, IInventory {
-+public class TileEntityChest extends TileEntityLootable implements IInventory { // Paper - Remove ITickable
+-public class TileEntityChest extends TileEntityLootable implements ITickable {
++public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITickable
- private ItemStack[] items = new ItemStack[27];
+ private NonNullList items;
public boolean a;
- public TileEntityChest f;
- public TileEntityChest g;
@@ -30,19 +30,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public float k;
- public int l;
+ public int l; // Paper - Number of viewers
- private int p;
- private BlockChest.Type q;
- private String r;
-@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable, II
+ private int q;
+ private BlockChest.Type r;
+
+@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
}
- public void E_() {
+ public void F_() {
+ // Paper - Disable all of this, just in case this does get ticked
+ /*
- this.m();
+ this.o();
int i = this.position.getX();
int j = this.position.getY();
-@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable, II
+@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
this.j = 0.0F;
}
}
@@ -52,13 +52,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public boolean c(int i, int j) {
-@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable, II
+@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
++this.l;
+
+ // Paper start - Move chest open sound out of the tick loop
-+ this.m();
++ this.o();
+
+ if (this.l > 0 && this.j == 0.0F && this.f == null && this.h == null) {
+ this.j = 0.7F;
@@ -74,17 +74,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ d1 += 0.5D;
+ }
+
-+ this.world.a((EntityHuman) null, d1, (double) this.position.getY() + 0.5D, d0, SoundEffects.X, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
++ this.world.a((EntityHuman) null, d1, (double) this.position.getY() + 0.5D, d0, SoundEffects.Z, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
+ }
+ // Paper end
+
if (this.world == null) return; // CraftBukkit
this.world.playBlockAction(this.position, this.getBlock(), 1, this.l);
-@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable, II
+@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
+ if (!entityhuman.isSpectator() && this.getBlock() instanceof BlockChest) {
int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
--this.l;
- if (this.world == null) return; // CraftBukkit
+
+ // Paper start - Move chest close sound out of the tick loop
+ if (this.l == 0 && this.j > 0.0F || this.l > 0 && this.j < 1.0F) {
@@ -108,14 +108,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ d0 += 0.5D;
+ }
+
-+ this.world.a((EntityHuman) null, d0, (double) yLoc + 0.5D, d2, SoundEffects.V, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
++ this.world.a((EntityHuman) null, d0, (double) yLoc + 0.5D, d2, SoundEffects.X, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
+ this.j = 0.0F;
+ }
+ // Paper end
+
this.world.playBlockAction(this.position, this.getBlock(), 1, this.l);
+ this.world.applyPhysics(this.position, this.getBlock(), false);
- // CraftBukkit start - Call redstone event
diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java
@@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public TileEntityEnderChest() {}
- public void E_() {
+ public void F_() {
+ // Paper start - Disable all of this, just in case this does get ticked
+ /*
if (++this.h % 20 * 4 == 0) {
@@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
- public void d() {
+ public void a() {
++this.g;
+
+ // Paper start - Move enderchest open sounds out of the tick loop
@@ -162,7 +162,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ double d1 = (double) this.getPosition().getX() + 0.5D;
+ double d0 = (double) this.getPosition().getZ() + 0.5D;
+
-+ this.world.a((EntityHuman) null, d1, (double) this.getPosition().getY() + 0.5D, d0, SoundEffects.aN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
++ this.world.a((EntityHuman) null, d1, (double) this.getPosition().getY() + 0.5D, d0, SoundEffects.aQ, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
+ }
+ // Paper end
+
@@ -177,7 +177,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ double d0 = (double) this.getPosition().getX() + 0.5D;
+ double d2 = (double) this.getPosition().getZ() + 0.5D;
+
-+ this.world.a((EntityHuman) null, d0, (double) this.getPosition().getY() + 0.5D, d2, SoundEffects.aM, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
++ this.world.a((EntityHuman) null, d0, (double) this.getPosition().getY() + 0.5D, d2, SoundEffects.aP, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
+ this.a = 0.0F;
+ }
+ // Paper end
diff --git a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch
index 23a9f7fd41..05f598cf31 100644
--- a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch
+++ b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch
@@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot start
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
LOGGER.info("Saving usercache.json");
-- this.X.c();
-+ this.X.c(false); // Paper
+- this.Y.c();
++ this.Y.c(false); // Paper
}
// Spigot end
}
diff --git a/Spigot-Server-Patches/Optimize-draining.patch b/Spigot-Server-Patches/Optimize-draining.patch
deleted file mode 100644
index 578bd0d048..0000000000
--- a/Spigot-Server-Patches/Optimize-draining.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Byteflux
-Date: Wed, 2 Mar 2016 00:55:24 -0600
-Subject: [PATCH] Optimize draining
-
-
-diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/BlockFlowing.java
-+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
-@@ -0,0 +0,0 @@ public class BlockFlowing extends BlockFluids {
- iblockdata = iblockdata.set(BlockFlowing.LEVEL, Integer.valueOf(i1));
- world.setTypeAndData(blockposition, iblockdata, 2);
- world.a(blockposition, (Block) this, j);
-- world.applyPhysics(blockposition, this);
-+ // Paper start - Optimize draining
-+ world.e(blockposition.west(), this);
-+ world.e(blockposition.east(), this);
-+ world.e(blockposition.up(), this);
-+ world.e(blockposition.north(), this);
-+ world.e(blockposition.south(), this);
-+ // Paper end
- }
- }
- } else {
---
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch
index c2ecbca7b3..ce5764a323 100644
--- a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch
+++ b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch
@@ -241,8 +241,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
- if (!this.E(blockposition)) {
-+ if (!blockposition.isInvalidYLocation()) { // Paper
- if (tileentity != null && !tileentity.x()) {
++ if (!blockposition.isInvalidYLocation()) {
+ if (tileentity != null && !tileentity.y()) {
// CraftBukkit start
if (captureBlockStates) {
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
diff --git a/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch b/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch
index f9757af805..de3ab7f578 100644
--- a/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch
+++ b/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
super.b(world, blockposition, iblockdata, random);
- if (world.getLightLevel(blockposition.up()) >= 9) {
+ if (world.isLightLevel(blockposition.up(), 9)) { // Paper
- int i = this.x(iblockdata);
+ int i = this.z(iblockdata);
if (i < this.g()) {
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
@@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
@@ -0,0 +0,0 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
- if (this.world.b(EnumSkyBlock.SKY, blockposition) > this.random.nextInt(32)) {
+ if (this.world.getBrightness(EnumSkyBlock.SKY, blockposition) > this.random.nextInt(32)) {
return false;
} else {
- int i = this.world.getLightLevel(blockposition);
@@ -125,9 +125,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
int j1 = j + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1);
int k1 = k + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1);
-- if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
-+ if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && !this.world.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper
+- if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).r() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
++ if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).r() && !this.world.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper
entityzombie.setPosition((double) i1, (double) j1, (double) k1);
- if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D, EntityHuman.affectsSpawningFilter()) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { // Paper - affectsSpawning filter
+ if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch
index b1f85c2257..e93076f99c 100644
--- a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch
+++ b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch
@@ -15,8 +15,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
- skeleHorseSpawnChance = 0.05D; // Vanilla
- }
+ private void skeleHorseSpawnChance() {
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state
}
+
+ public boolean firePhysicsEventForRedstone = false;
diff --git a/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch b/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch
index 22c1f931db..79279fe9e0 100644
--- a/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch
+++ b/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch
@@ -31,12 +31,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
world.setAir(blockposition);
+ // Paper start - Old TNT cannon behaviors
+ if (world.paperConfig.oldCannonBehaviors) {
-+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
++ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
+ return;
+ }
+ // Paper end
@@ -49,12 +49,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.d) {
+ // Paper start - Old TNT cannon behaviors
+ if (world.paperConfig.oldCannonBehaviors) {
-+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
++ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
+ return;
+ }
+ // Paper end
@@ -97,12 +97,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Old TNT cannon behaviors
+ private void shiftPositions(World world, BlockPosition blockposition) {
-+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
++ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
+ }
+ // Paper end
+
@@ -145,15 +145,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class BlockRedstoneWire extends Block {
private void b(World world, BlockPosition blockposition) {
if (world.getType(blockposition).getBlock() == this) {
- world.applyPhysics(blockposition, this);
-+ // Paper start - Old TNT cannon behaviors
+ world.applyPhysics(blockposition, this, false);
+ if (world.paperConfig.oldCannonBehaviors) {
-+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
-+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
++ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
++ world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
+ return;
+ }
+ // Paper end
@@ -189,7 +188,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
world.addEntity(entitytntprimed);
- world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gz, SoundCategory.BLOCKS, 1.0F, 1.0F);
+ world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gV, SoundCategory.BLOCKS, 1.0F, 1.0F);
diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/DispenserRegistry.java
@@ -227,7 +226,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
}
- public double f(double d0, double d1, double d2) {
+ public double e(double d0, double d1, double d2) {
+ // Paper start - OBFHELPER
+ return this.getDistance(d0, d1, d2);
+ }
@@ -240,13 +239,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
}
- public void g(double d0, double d1, double d2) {
+ public void f(double d0, double d1, double d2) {
+ // Paper start - OBFHELPER
+ this.addVelocity(d0, d1, d2);
+ }
+
+ public void addVelocity(double d0, double d1, double d2) {
-+ // Paper end
this.motX += d0;
this.motY += d1;
this.motZ += d2;
diff --git a/Spigot-Server-Patches/POM-Changes.patch b/Spigot-Server-Patches/POM-Changes.patch
index 9cde258e27..839cc6278a 100644
--- a/Spigot-Server-Patches/POM-Changes.patch
+++ b/Spigot-Server-Patches/POM-Changes.patch
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ com.destroystokyo.paper
+ paper
jar
- 1.10.2-R0.1-SNAPSHOT
+ 1.11-R0.1-SNAPSHOT
- Spigot
- http://www.spigotmc.org
+ Paper
@@ -26,9 +26,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
UTF-8
@@ -0,0 +0,0 @@
- 1_10_R1
git-Bukkit-
+ yyyyMMdd-HHmm
- 1.6
- 1.6
+
@@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@
maven-jar-plugin
- 2.6
+ 3.0.2
+ true
@@ -111,7 +111,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
CraftBukkit
- ${spigot.desc}${craftbukkit.desc}
+ ${describe}
- Bukkit Team
+ ${maven.build.timestamp}
Bukkit
${api.version}
@@ -0,0 +0,0 @@
@@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- org.codehaus.mojo
- animal-sniffer-maven-plugin
-- 1.14
+- 1.15
-
-
- process-classes
@@ -140,7 +140,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-
org.apache.maven.plugins
maven-shade-plugin
- 2.4.1
+ 2.4.3
@@ -0,0 +0,0 @@
shade
diff --git a/Spigot-Server-Patches/Pass-world-to-Village-creation.patch b/Spigot-Server-Patches/Pass-world-to-Village-creation.patch
index 069da46d9a..f1eb36dc2c 100644
--- a/Spigot-Server-Patches/Pass-world-to-Village-creation.patch
+++ b/Spigot-Server-Patches/Pass-world-to-Village-creation.patch
@@ -30,5 +30,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private Village() { // Paper - Nothing should call this - world needs to be set.
this.c = BlockPosition.ZERO;
this.d = BlockPosition.ZERO;
- this.j = new TreeMap();
+ this.j = Maps.newHashMap();
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Player-Exhaustion-Multipliers.patch b/Spigot-Server-Patches/Player-Exhaustion-Multipliers.patch
deleted file mode 100644
index 0a00e0c503..0000000000
--- a/Spigot-Server-Patches/Player-Exhaustion-Multipliers.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: gsand
-Date: Tue, 1 Mar 2016 13:43:16 -0600
-Subject: [PATCH] Player Exhaustion Multipliers
-
-
-diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-@@ -0,0 +0,0 @@ public class PaperWorldConfig {
- private void nerfedMobsShouldJump() {
- nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
- }
-+
-+ public float blockBreakExhaustion;
-+ public float playerSwimmingExhaustion;
-+ public void exhaustionValues() {
-+ blockBreakExhaustion = getFloat("player-exhaustion.block-break", 0.025F);
-+ playerSwimmingExhaustion = getFloat("player-exhaustion.swimming", 0.015F);
-+ log("Player exhaustion penalty for breaking blocks is " + blockBreakExhaustion);
-+ log("Player exhaustion penalty for swimming is " + playerSwimmingExhaustion);
-+ }
- }
-diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/Block.java
-+++ b/src/main/java/net/minecraft/server/Block.java
-@@ -0,0 +0,0 @@ public class Block {
-
- public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, @Nullable ItemStack itemstack) {
- entityhuman.b(StatisticList.a(this));
-- entityhuman.applyExhaustion(0.025F);
-+ entityhuman.applyExhaustion(world.paperConfig.blockBreakExhaustion); // Paper - Configurable block break exhaustion
- if (this.o() && EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) > 0) {
- ItemStack itemstack1 = this.u(iblockdata);
-
-diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityHuman.java
-+++ b/src/main/java/net/minecraft/server/EntityHuman.java
-@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
- i = Math.round(MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
- if (i > 0) {
- this.a(StatisticList.q, i);
-- this.applyExhaustion(0.015F * (float) i * 0.01F);
-+ this.applyExhaustion(world.paperConfig.playerSwimmingExhaustion); // Paper - Configurable swimming exhaustion
- }
- } else if (this.isInWater()) {
- i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
- if (i > 0) {
- this.a(StatisticList.m, i);
-- this.applyExhaustion(0.015F * (float) i * 0.01F);
-+ this.applyExhaustion(world.paperConfig.playerSwimmingExhaustion); // Paper - Configurable swimming exhaustion
- }
- } else if (this.m_()) {
- if (d1 > 0.0D) {
---
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch b/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch
index 8229a6d145..1021e9a67b 100644
--- a/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch
+++ b/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch
@@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet {
public void b(PacketDataSerializer packetdataserializer) throws IOException {
packetdataserializer.a((Enum) this.a);
- if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
+ if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE || this.a == PacketPlayOutTitle.EnumTitleAction.ACTIONBAR) {
- packetdataserializer.a(this.b);
+ // Paper start
+ if (this.components != null) {
diff --git a/Spigot-Server-Patches/Player-affects-spawning-API.patch b/Spigot-Server-Patches/Player-affects-spawning-API.patch
index 919fad3396..a040a99955 100644
--- a/Spigot-Server-Patches/Player-affects-spawning-API.patch
+++ b/Spigot-Server-Patches/Player-affects-spawning-API.patch
@@ -8,86 +8,34 @@ diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
-@@ -0,0 +0,0 @@
- package net.minecraft.server;
-
- import com.google.common.base.Charsets;
-+import com.google.common.base.Predicate; // Paper
- import com.google.common.collect.Lists;
- import com.mojang.authlib.GameProfile;
- import java.util.Arrays;
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
- private final ItemCooldown bW = this.l();
+ private final ItemCooldown bV;
+ @Nullable
public EntityFishingHook hookedFish;
++ public boolean affectsSpawning = true; // Paper - AffectsSpawning API
-+ // Paper start - affectsSpawning API
-+ public boolean affectsSpawning = true;
-+
-+ public static Predicate affectsSpawningFilter() {
-+ return new Predicate() {
-+ @Override
-+ public boolean apply(EntityHuman entityHuman) {
-+ return entityHuman.affectsSpawning;
-+ }
-+ };
-+ }
-+ // Paper end
-+
// CraftBukkit start
public boolean fauxSleeping;
- public String spawnWorld = "";
-diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
+diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityInsentient.java
-+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
-@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
- if (this.persistent) {
- this.ticksFarFromPlayer = 0;
- } else {
-- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
-+ EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
+--- a/src/main/java/net/minecraft/server/IEntitySelector.java
++++ b/src/main/java/net/minecraft/server/IEntitySelector.java
+@@ -0,0 +0,0 @@ public final class IEntitySelector {
+ };
+ public static final Predicate e = new Predicate() {
+ public boolean a(@Nullable Entity entity) {
+- return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator();
++ return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator() || !((EntityHuman) entity).affectsSpawning; // Paper - Affects Spawning API
+ }
- if (entityhuman != null) {
- double d0 = entityhuman.locX - this.locX;
-diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntitySilverfish.java
-+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
-@@ -0,0 +0,0 @@ public class EntitySilverfish extends EntityMonster {
+ public boolean apply(@Nullable Object object) {
+ return this.a((Entity) object);
+ }
+ };
++ public static final Predicate CAN_MOBS_TARGET = e; // Paper - OBFHELPER
- public boolean cK() {
- if (super.cK()) {
-- EntityHuman entityhuman = this.world.b(this, 5.0D);
-+ EntityHuman entityhuman = this.world.findNearbyPlayerNotInCreativeMode(this, 5.0D, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
-
- return entityhuman == null;
- } else {
-diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityZombie.java
-+++ b/src/main/java/net/minecraft/server/EntityZombie.java
-@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
-
- if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
- entityzombie.setPosition((double) i1, (double) j1, (double) k1);
-- if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
-+ if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D, EntityHuman.affectsSpawningFilter()) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { // Paper - affectsSpawning filter
- this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
- entityzombie.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true);
- entityzombie.prepare(this.world.D(new BlockPosition(entityzombie)), (GroupDataEntity) null);
-diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
-+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
-@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
- private boolean h() {
- BlockPosition blockposition = this.b();
-
-- return this.a().isPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange);
-+ return this.a().isPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
- }
-
- public void c() {
+ public static Predicate a(final double d0, final double d1, final double d2, double d3) {
+ final double d4 = d3 * d3;
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -96,93 +44,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next();
-+ if (!entityhuman.affectsSpawning) continue; // Paper - affectsSpawning check
-+
- if (!entityhuman.isSpectator()) {
+- if (!entityhuman.isSpectator()) {
++ if (!entityhuman.isSpectator() && entityhuman.affectsSpawning) { // Paper - AffectsSpawning API
int l = MathHelper.floor(entityhuman.locX / 16.0D);
-@@ -0,0 +0,0 @@ public final class SpawnerCreature {
- float f = (float) j3 + 0.5F;
- float f1 = (float) l3 + 0.5F;
-
-- if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) {
-+ if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D, EntityHuman.affectsSpawningFilter()) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) { // Paper - affectsSpawning filter
- if (biomebase_biomemeta == null) {
- biomebase_biomemeta = worldserver.a(enumcreaturetype, (BlockPosition) blockposition_mutableblockposition);
- if (biomebase_biomemeta == null) {
-diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/World.java
-+++ b/src/main/java/net/minecraft/server/World.java
-@@ -0,0 +0,0 @@
- import com.google.common.base.Function;
- import com.google.common.base.Objects;
- import com.google.common.base.Predicate;
-+import com.google.common.base.Predicates; // Paper
- import com.google.common.collect.Lists;
- import java.util.ArrayList;
- import java.util.Calendar;
-@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
-
- @Nullable
- public EntityHuman findNearbyPlayer(Entity entity, double d0) {
-- return this.a(entity.locX, entity.locY, entity.locZ, d0, false);
-+ // Paper start - Add filter parameter
-+ return findNearbyPlayer(entity, d0, Predicates.alwaysTrue());
-+ }
-+
-+ public EntityHuman findNearbyPlayer(Entity entity, double d0, Predicate filter) {
-+ return this.findNearbyPlayer(entity.locX, entity.locY, entity.locZ, d0, false, filter);
- }
-
- @Nullable
- public EntityHuman b(Entity entity, double d0) {
-- return this.a(entity.locX, entity.locY, entity.locZ, d0, true);
-+ return this.findNearbyPlayerNotInCreativeMode(entity, d0, Predicates.alwaysTrue());
-+ }
-+
-+ public EntityHuman findNearbyPlayerNotInCreativeMode(Entity entity, double d0, Predicate filter) {
-+ return this.findNearbyPlayer(entity.locX, entity.locY, entity.locZ, d0, true, filter);
- }
-
- @Nullable
- public EntityHuman a(double d0, double d1, double d2, double d3, boolean flag) {
-+ return findNearbyPlayer(d0, d1, d2, d3, flag, Predicates.alwaysTrue());
-+ }
-+
-+ public EntityHuman findNearbyPlayer(double d0, double d1, double d2, double d3, boolean flag, Predicate filter) {
-+ // FYI the flag means "exclude creative mode players"
-+ // Paper end
- double d4 = -1.0D;
- EntityHuman entityhuman = null;
-
-@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
- }
- // CraftBukkit end
-
-+ if (!filter.apply(entityhuman1)) continue; // Paper - check filter
-+
- if ((IEntitySelector.d.apply(entityhuman1) || !flag) && (IEntitySelector.e.apply(entityhuman1) || flag)) {
- double d5 = entityhuman1.e(d0, d1, d2);
-
-@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
- }
-
- public boolean isPlayerNearby(double d0, double d1, double d2, double d3) {
-+ // Paper start - add filter parameter
-+ return isPlayerNearby(d0, d1, d2, d3, Predicates.alwaysTrue());
-+ }
-+
-+ public boolean isPlayerNearby(double d0, double d1, double d2, double d3, Predicate filter) {
-+ // Paper end
- for (int i = 0; i < this.players.size(); ++i) {
- EntityHuman entityhuman = (EntityHuman) this.players.get(i);
-
-+ if (!filter.apply(entityhuman)) continue; // Paper - check filter
-+
- if (IEntitySelector.e.apply(entityhuman)) {
- double d4 = entityhuman.e(d0, d1, d2);
-
+ j = MathHelper.floor(entityhuman.locZ / 16.0D);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
diff --git a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch
index 11f3a9a40e..5d154d8e92 100644
--- a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch
+++ b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch
@@ -12,11 +12,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
});
if (this.world != null) {
-- CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock(), this.u());
+- CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock(), this.v());
+ // Paper start - Prevent TileEntity and Entity crashes
+ Block block = this.getBlock();
+ if (block != null) {
-+ CrashReportSystemDetails.a(crashreportsystemdetails, this.position, block, this.u());
++ CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock(), this.v());
+ }
+ // Paper end
crashreportsystemdetails.a("Actual block type", new CrashReportCallable() {
@@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
- ((ITickable) tileentity).E_();
+ ((ITickable) tileentity).F_();
this.methodProfiler.b();
} catch (Throwable throwable2) {
- crashreport1 = CrashReport.a(throwable2, "Ticking block entity");
diff --git a/Spigot-Server-Patches/Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch b/Spigot-Server-Patches/Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch
index 585af27f51..f6741ec6c0 100644
--- a/Spigot-Server-Patches/Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch
+++ b/Spigot-Server-Patches/Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch
@@ -29,26 +29,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public ItemStack(Item item, int i, int j, boolean convert) {
+ // Paper end
this.item = item;
+ this.damage = j;
this.count = i;
-
-@@ -0,0 +0,0 @@ public final class ItemStack {
- //if (this.damage < 0) {
- // this.damage = 0;
- //}
+ // CraftBukkit start - Pass to setData to do filtering
+ // Paper start
-+ if (convert) convertData();
++ if (convert) convertData(j);
+ }
-+ public final void convertData() {
++
++ public final void convertData(int data) {
+ // Paper end
if (MinecraftServer.getServer() != null) {
+- this.setData(j);
++ this.setData(data);
NBTTagCompound savedStack = new NBTTagCompound();
this.save(savedStack);
+ MinecraftServer.getServer().getDataConverterManager().a(DataConverterTypes.ITEM_INSTANCE, savedStack); // PAIL: convert
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack {
- return null;
+ return net.minecraft.server.ItemStack.a;
}
- net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability());
@@ -56,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (original.hasItemMeta()) {
setItemMeta(stack, original.getItemMeta());
}
-+ stack.convertData(); // Paper
++ stack.convertData(original.getDurability()); // Paper
return stack;
}
diff --git a/Spigot-Server-Patches/Raise-string-limit-for-packet-serialization.patch b/Spigot-Server-Patches/Raise-string-limit-for-packet-serialization.patch
index 3b8d497fa8..9d3196a773 100644
--- a/Spigot-Server-Patches/Raise-string-limit-for-packet-serialization.patch
+++ b/Spigot-Server-Patches/Raise-string-limit-for-packet-serialization.patch
@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
byte[] abyte = s.getBytes(Charsets.UTF_8);
- if (abyte.length > 32767) {
-- throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 32767 + ")");
+- throw new EncoderException("String too big (was " + abyte.length + " bytes encoded, max " + 32767 + ")");
+ if (abyte.length > 44767) { // Paper - raise limit a bit more as normal means can trigger this
+ throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 44767 + ")"); // Paper
} else {
diff --git a/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch
index 27cde96868..676cf46c49 100644
--- a/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch
+++ b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk {
- tileentity.z();
+ tileentity.A();
this.tileEntities.put(blockposition, tileentity);
// CraftBukkit start
+ // Paper start - Remove invalid mob spawner tile entities
diff --git a/Spigot-Server-Patches/Remove-the-item-from-the-correct-hand-when-spawn-egg.patch b/Spigot-Server-Patches/Remove-the-item-from-the-correct-hand-when-spawn-egg.patch
deleted file mode 100644
index 2013b14c08..0000000000
--- a/Spigot-Server-Patches/Remove-the-item-from-the-correct-hand-when-spawn-egg.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Aikar
-Date: Sat, 18 Jun 2016 01:49:22 -0400
-Subject: [PATCH] Remove the item from the correct hand when spawn egg depletes
-
-
-diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityAgeable.java
-+++ b/src/main/java/net/minecraft/server/EntityAgeable.java
-@@ -0,0 +0,0 @@ public abstract class EntityAgeable extends EntityCreature {
- --itemstack.count;
- // CraftBukkit start - allow less than 0 stacks as "infinite"
- if (itemstack.count == 0) {
-- entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
-+ entityhuman.setHeldItem(enumhand, null); // Paper
- }
- // CraftBukkit end
- }
-diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityLiving.java
-+++ b/src/main/java/net/minecraft/server/EntityLiving.java
-@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- }
- }
-
-+ public void setHeldItem(EnumHand enumhand, @Nullable ItemStack itemstack) { a(enumhand, itemstack); } // Paper - OBFHELPER
- public void a(EnumHand enumhand, @Nullable ItemStack itemstack) {
- if (enumhand == EnumHand.MAIN_HAND) {
- this.setSlot(EnumItemSlot.MAINHAND, itemstack);
---
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch
index 17d257467a..c3ee2d3c14 100644
--- a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch
+++ b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch
@@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// CraftBukkit end
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
- if (tileentity.x()) {
+ if (tileentity.y()) {
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
- this.tileEntityList.remove(tileentity);
diff --git a/Spigot-Server-Patches/SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch b/Spigot-Server-Patches/SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch
index 71b24f8dc5..c4af51e3d7 100644
--- a/Spigot-Server-Patches/SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch
+++ b/Spigot-Server-Patches/SPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patch
@@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ // Paper end
- public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) {
+ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
if (world.isClientSide) {
diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -48,6 +48,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ // Paper end
- public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) {
+ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
if (world.isClientSide) {
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch
index 8ea072fb69..a9359f6d2e 100644
--- a/Spigot-Server-Patches/Timings-v2.patch
+++ b/Spigot-Server-Patches/Timings-v2.patch
@@ -262,8 +262,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ @Nullable
-+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition) {
-+ return timedGenerator.findNearestMapFeature(world, s, blockposition);
++ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, boolean flag) {
++ return timedGenerator.findNearestMapFeature(world, s, blockposition, flag);
+ }
+
+ @Override
@@ -526,18 +526,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ world.timings.syncChunkLoadNBTTimer.startTiming(); // Spigot
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
- if (nbttaglist1 != null) {
+ for (int l = 0; l < nbttaglist1.size(); ++l) {
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
- chunk.g(true);
- }
+ a(nbttagcompound2, world, chunk);
+ chunk.g(true);
}
- world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot
- world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot
NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10);
- if (nbttaglist2 != null) {
+ for (int i1 = 0; i1 < nbttaglist2.size(); ++i1) {
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
- }
+ chunk.a(tileentity);
}
}
- world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot
@@ -546,7 +546,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (nbttagcompound.hasKeyOfType("TileTicks", 9)) {
NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10);
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
- }
+ world.b(new BlockPosition(nbttagcompound4.getInt("x"), nbttagcompound4.getInt("y"), nbttagcompound4.getInt("z")), block, nbttagcompound4.getInt("t"), nbttagcompound4.getInt("p"));
}
}
- world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot
@@ -570,7 +570,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
- public void aL() {
+ public void aM() {
- SpigotTimings.serverCommandTimer.startTiming(); // Spigot
+ MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
while (!this.serverCommandQueue.isEmpty()) {
@@ -611,10 +611,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
}
- public void move(double d0, double d1, double d2) {
+ public void move(EnumMoveType enummovetype, double d0, double d1, double d2) {
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
if (this.noclip) {
- this.a(this.getBoundingBox().c(d0, d1, d2));
+ this.a(this.getBoundingBox().d(d0, d1, d2));
this.recalcPosition();
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
@@ -640,10 +640,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
}
- public void m() {
+ public void A_() {
- SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
- super.m();
- this.cz();
+ super.A_();
+ this.cA();
if (!this.world.isClientSide) {
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
}
@@ -657,7 +657,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
float f = (float) (d0 * d0 + d1 * d1);
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
} else {
- this.bq = 0;
+ this.bp = 0;
}
-
- SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
@@ -669,9 +669,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world.methodProfiler.a("ai");
- SpigotTimings.timerEntityAI.startTiming(); // Spigot
- if (this.cj()) {
- this.be = false;
- this.bf = 0.0F;
+ if (this.isFrozen()) {
+ this.bd = false;
+ this.be = 0.0F;
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.doTick();
this.world.methodProfiler.b();
@@ -681,16 +681,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world.methodProfiler.b();
this.world.methodProfiler.a("jump");
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- this.bg *= 0.98F;
- this.bh *= 0.9F;
+ this.bf *= 0.98F;
+ this.bg *= 0.9F;
this.r();
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
- this.g(this.bf, this.bg);
+ this.g(this.be, this.bf);
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
this.world.methodProfiler.b();
this.world.methodProfiler.a("push");
- SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
- this.cs();
+ this.ct();
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.methodProfiler.b();
}
@@ -847,7 +847,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.methodProfiler.c("connection");
- SpigotTimings.connectionTimer.startTiming(); // Spigot
+ MinecraftTimings.connectionTimer.startTiming(); // Spigot
- this.am().c();
+ this.an().c();
- SpigotTimings.connectionTimer.stopTiming(); // Spigot
+ MinecraftTimings.connectionTimer.stopTiming(); // Spigot
this.methodProfiler.c("players");
@@ -861,7 +861,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- SpigotTimings.tickablesTimer.startTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.startTiming(); // Spigot
for (i = 0; i < this.o.size(); ++i) {
- ((ITickable) this.o.get(i)).E_();
+ ((ITickable) this.o.get(i)).F_();
}
- SpigotTimings.tickablesTimer.stopTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.stopTiming(); // Spigot
@@ -1051,8 +1051,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import co.aikar.timings.Timing;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
- import java.util.Iterator;
-@@ -0,0 +0,0 @@ import java.util.Random;
+ import it.unimi.dsi.fastutil.objects.ObjectIterator;
+@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public abstract class StructureGenerator extends WorldGenBase {
@@ -1100,8 +1100,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
+ public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
private static final Logger a = LogManager.getLogger();
- private static final Map> f = Maps.newHashMap();
- private static final Map, String> g = Maps.newHashMap();
+ private static final RegistryMaterials> f = new RegistryMaterials();
+ protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/World.java
@@ -1193,7 +1193,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
entity.N = entity.locY;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
entity.lastPitch = entity.pitch;
- if (flag && entity.ab) {
+ if (flag && entity.aa) {
++entity.ticksLived;
+ ++co.aikar.timings.TimingHistory.activatedEntityTicks; // Paper
if (entity.isPassenger()) {
@@ -1818,8 +1818,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
{
- SpigotTimings.checkIfActiveTimer.startTiming();
// Never safe to skip fireworks or entities not yet added to chunk
- // PAIL: inChunk
- if ( !entity.ab || entity instanceof EntityFireworks ) {
+ // PAIL: inChunk - boolean under datawatchers
+ if ( !entity.aa || entity instanceof EntityFireworks ) {
- SpigotTimings.checkIfActiveTimer.stopTiming();
return true;
}
diff --git a/Spigot-Server-Patches/Toggleable-Elytra-Wall-Damage.patch b/Spigot-Server-Patches/Toggleable-Elytra-Wall-Damage.patch
index 5e378a68aa..b47554a9e9 100644
--- a/Spigot-Server-Patches/Toggleable-Elytra-Wall-Damage.patch
+++ b/Spigot-Server-Patches/Toggleable-Elytra-Wall-Damage.patch
@@ -27,8 +27,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.motY = 0.30000001192092896D;
}
- } else if (this.cG()) {
-+ if(world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage
+ } else if (this.cH()) {
++ if (world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage
if (this.motY > -0.5D) {
this.fallDistance = 1.0F;
}
diff --git a/Spigot-Server-Patches/Undead-horse-leashing.patch b/Spigot-Server-Patches/Undead-horse-leashing.patch
index 6e5dac0642..0b5cb23b50 100644
--- a/Spigot-Server-Patches/Undead-horse-leashing.patch
+++ b/Spigot-Server-Patches/Undead-horse-leashing.patch
@@ -19,16 +19,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ allowLeashingUndeadHorse = getBoolean("allow-leashing-undead-horse", false);
+ }
}
-diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java
+diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityHorse.java
-+++ b/src/main/java/net/minecraft/server/EntityHorse.java
-@@ -0,0 +0,0 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener, IJu
+--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
++++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
+@@ -0,0 +0,0 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
}
public boolean a(EntityHuman entityhuman) {
-+ if (world.paperConfig.allowLeashingUndeadHorse) { return super.a(entityhuman); } // Paper
- return !this.getType().h() && super.a(entityhuman);
+- return super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD;
++ return world.paperConfig.allowLeashingUndeadHorse ? super.a(entityhuman) : super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD; // Paper
}
+ protected void q(float f) {
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Use-a-Shared-Random-for-Entities.patch b/Spigot-Server-Patches/Use-a-Shared-Random-for-Entities.patch
index 7335a3e6b6..e3e87b8733 100644
--- a/Spigot-Server-Patches/Use-a-Shared-Random-for-Entities.patch
+++ b/Spigot-Server-Patches/Use-a-Shared-Random-for-Entities.patch
@@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.ax = 1;
- this.random = new Random();
+ this.random = SHARED_RANDOM; // Paper
- this.maxFireTicks = 1;
+ this.fireTicks = -this.getMaxFireTicks();
this.justCreated = true;
this.uniqueID = MathHelper.a(this.random);
--
\ No newline at end of file
diff --git a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch
index e8a8ef2cd5..d6866ed291 100644
--- a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch
+++ b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch
@@ -28,20 +28,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
- movingobjectposition = new MovingObjectPosition(entity);
- }
-+ // Paper start - Allow fishing hooks to fly through vanished players the shooter can't see
-+ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && owner != null && owner instanceof EntityPlayer) {
-+ if (!((EntityPlayer) owner).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
-+ movingobjectposition = null;
-+ }
-+ }
-+ // Paper end
+ vec3d = new Vec3D(this.locX, this.locY, this.locZ);
+ vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
+
- if (movingobjectposition != null) {
- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
- if (movingobjectposition.entity != null) {
++ // Paper start - Allow fishing hooks to fly through vanished players the shooter can't see
++ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && owner != null && owner instanceof EntityPlayer) {
++ if (!((EntityPlayer) owner).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
++ movingobjectposition = null;
++ }
++ }
++ // Paper end
++
+ if (movingobjectposition != null) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
+ vec3d1 = new Vec3D(movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z);
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
@@ -66,11 +67,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/ItemBlock.java
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
@@ -0,0 +0,0 @@ public class ItemBlock extends Item {
- blockposition = blockposition.shift(enumdirection);
- }
-- if (itemstack.count != 0 && entityhuman.a(blockposition, enumdirection, itemstack) && world.a(this.a, blockposition, false, enumdirection, (Entity) null, itemstack)) {
-+ if (itemstack.count != 0 && entityhuman.a(blockposition, enumdirection, itemstack) && world.a(this.a, blockposition, false, enumdirection, entityhuman, itemstack)) { // Paper - Pass entityhuman instead of null
+ ItemStack itemstack = entityhuman.b(enumhand);
+
+- if (!itemstack.isEmpty() && entityhuman.a(blockposition, enumdirection, itemstack) && world.a(this.a, blockposition, false, enumdirection, (Entity) null)) {
++ if (!itemstack.isEmpty() && entityhuman.a(blockposition, enumdirection, itemstack) && world.a(this.a, blockposition, false, enumdirection, entityhuman)) { // Paper - Pass entityhuman instead of null
int i = this.filterData(itemstack.getData());
IBlockData iblockdata1 = this.a.getPlacedState(world, blockposition, enumdirection, f, f1, f2, i, entityhuman);
diff --git a/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch b/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch
index 2c9b376314..8476d8c91d 100644
--- a/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch
+++ b/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch
@@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
- }
+ }
+ }
- public boolean a(Entity entity, boolean flag) {
+ return this.mountEntity(entity, flag, false); // Paper - OBFHELPER
+ }
+
diff --git a/Spigot-Server-Patches/Water-mobs-should-only-spawn-in-the-water.patch b/Spigot-Server-Patches/Water-mobs-should-only-spawn-in-the-water.patch
index ccd6c68d5a..dc778546f7 100644
--- a/Spigot-Server-Patches/Water-mobs-should-only-spawn-in-the-water.patch
+++ b/Spigot-Server-Patches/Water-mobs-should-only-spawn-in-the-water.patch
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class EntityWaterAnimal extends EntityInsentient implements IAni
}
- public boolean cK() {
+ public boolean cM() {
- return true;
+ // Paper start - Don't let water mobs spawn in non-water blocks
+ // Based around EntityAnimal's implementation
diff --git a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch
index f461f3f9d6..3ed38c5a04 100644
--- a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch
+++ b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ SERVER = this; // Paper - better singleton
io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable
this.e = proxy;
- this.U = yggdrasilauthenticationservice;
+ this.V = yggdrasilauthenticationservice;
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
// CraftBukkit start
@Deprecated
diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh
index 13a7d13345..927f1de1a5 100755
--- a/scripts/importmcdev.sh
+++ b/scripts/importmcdev.sh
@@ -61,6 +61,7 @@ import EULA
import EntitySquid
import EntityWaterAnimal
import FileIOThread
+import IEntitySelector
import IHopper
import ItemBlock
import ItemMonsterEgg
diff --git a/work/BuildData b/work/BuildData
index f37e6395d8..77931c01e7 160000
--- a/work/BuildData
+++ b/work/BuildData
@@ -1 +1 @@
-Subproject commit f37e6395d8f7d4865df27a4ab77e0c0d45de8fb9
+Subproject commit 77931c01e72ff84c004a310b121a72b52f0efdd5
diff --git a/work/Bukkit b/work/Bukkit
index 570e0e6752..be7be5128d 160000
--- a/work/Bukkit
+++ b/work/Bukkit
@@ -1 +1 @@
-Subproject commit 570e0e67528698b67770ea12e22c82d937fd3080
+Subproject commit be7be5128d751e5c2f266b02f71b18404a0c37d7
diff --git a/work/CraftBukkit b/work/CraftBukkit
index 51263e9718..f15e07b1a9 160000
--- a/work/CraftBukkit
+++ b/work/CraftBukkit
@@ -1 +1 @@
-Subproject commit 51263e97187a84338f89698eef187284055a682a
+Subproject commit f15e07b1a9a4aedbcb77cb7776f168adcfebfa7e
diff --git a/work/Spigot b/work/Spigot
index de459a282d..16c940b067 160000
--- a/work/Spigot
+++ b/work/Spigot
@@ -1 +1 @@
-Subproject commit de459a282d9f494bbc5588b461b3e8eacd74f744
+Subproject commit 16c940b0677cc9065df920e1113c80b5a047ca32