Update to Minecraft 1.10

This commit is contained in:
Zach Brown 2016-06-08 22:57:14 -05:00
parent f53bec077b
commit 9b192b2708
75 changed files with 210 additions and 422 deletions

View file

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>spigot-api</artifactId>
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId>
<version>1.9.4-R0.1-SNAPSHOT</version>
<version>1.10-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Spigot-API</name>

View file

@ -284,7 +284,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.List;
import javax.annotation.Nullable;
@@ -0,0 +0,0 @@ public class VillageSiege {
entityzombie.clearVillagerType();
entityzombie.setVillagerType(EnumZombieType.NORMAL);
} catch (Exception exception) {
exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper

View file

@ -12,13 +12,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue();
}
+ public final int getStuckArrows() { return this.bY(); } // Paper // OBFHELPER
public final int bY() {
+ public final int getStuckArrows() { return this.cb(); } // Paper - OBFHELPER
public final int cb() {
return ((Integer) this.datawatcher.get(EntityLiving.h)).intValue();
}
+ public final void setStuckArrows(int arrows) { this.k(arrows); } // Paper - deobfuscation helper
public final void k(int i) {
+ 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));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java

View file

@ -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.cG();
return super.cK();
}
- 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) { // Paper
return super.cG();
+ if (this.random.nextInt(10) == 0 && isSlimeChunk && this.locY < 40.0D) {
return super.cK();
}
}
--

View file

@ -23,9 +23,9 @@ 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 bD;
private boolean bE;
private Entity leashHolder;
private NBTTagCompound bF;
private NBTTagCompound bG;
+ public PathfinderGoalFloat goalFloat; // Paper
public EntityInsentient(World world) {

View file

@ -53,6 +53,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot start
private final Arrow.Spigot spigot = new Arrow.Spigot()
{
--
2.7.4 (Apple Git-66)
--

View file

@ -44,6 +44,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order
if ( org.spigotmc.SpigotConfig.playerShuffle > 0 && MinecraftServer.currentTick % org.spigotmc.SpigotConfig.playerShuffle == 0 )
{
--
2.7.4 (Apple Git-66)
--

View file

@ -32,8 +32,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private int neighbors = 0x1 << 12;
@@ -0,0 +0,0 @@ public class Chunk {
entity.ac = k;
entity.ad = this.locZ;
entity.ad = k;
entity.ae = this.locZ;
this.entitySlices[k].add(entity);
+ // Paper start - update count
+ if (entity instanceof EntityItem) {

View file

@ -11,14 +11,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
private static final DataWatcherObject<Boolean> aB = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Boolean> aC = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
public boolean aa;
- public int ab;
private static final DataWatcherObject<Boolean> aD = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
- public boolean ab;
- public int ac;
- public int ad;
+ public int ab;public int getChunkX() { return ab; } // Paper
+ public int ac;public int getChunkY() { return ac; } // Paper
+ public int ad;public int getChunkZ() { return ad; } // Paper
public boolean ah;
- 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 impulse;
public int portalCooldown;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
@ -52,22 +54,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public final List<Entity> j = Lists.newArrayList();
protected final IntHashMap<Entity> entitiesById = new IntHashMap();
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
this.entityList.removeAll(this.f);
int j;
+ // Paper start - Set based removal lists
+ for (Entity e : this.f) {
+ j = e.getChunkZ();
+ int k = e.getChunkX();
- for (i = 0; i < this.f.size(); ++i) {
- entity = (Entity) this.f.get(i);
- int k = entity.ab;
+ // Paper start - Set based removal lists
+ for (Entity e : this.f) {
+ j = e.getChunkX();
+ int k = e.getChunkZ();
- j = entity.ad;
- if (entity.aa && this.isChunkLoaded(k, j, true)) {
- int k = entity.ac;
-
- j = entity.ae;
- if (entity.ab && this.isChunkLoaded(k, j, true)) {
- this.getChunkAt(k, j).b(entity);
+ if (e.aa && this.isChunkLoaded(j, k, true)) {
+ this.getChunkAt(j, k).b(e);
+ if (e.isAddedToChunk() && this.isChunkLoaded(k, j, true)) {
+ this.getChunkAt(k, j).b(e);
}
}

View file

@ -1,71 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Fri, 22 Apr 2016 20:34:21 -0500
Subject: [PATCH] Check entity count additions and mark entities removed
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk {
k = this.entitySlices.length - 1;
}
+ // Paper start - Try to catch plugins doing indecent things
+ boolean ignoreAdd = false;
+ if (entity.aa && entity.getChunkX() == this.locX && entity.getChunkY() == k && entity.getChunkZ() == this.locZ) {
+ String chunkName = entity.getWorld().getWorld().getName() + ":" + entity.getChunkX() + "," + entity.getChunkY() + "," + entity.getChunkZ();
+ if (this.entitySlices[k].contains(entity)) {
+ new Throwable("Double Chunk Add to: " + chunkName).printStackTrace();
+ ignoreAdd = true;
+ } else {
+ boolean found = false;
+ for (int i1 = 0; i1 < this.entitySlices.length; i1++) {
+ if (this.entitySlices[i1].contains(entity)) {
+ new Throwable("Entity was found in another slice of this chunk, tried: " + k + ", was in: " + chunkName).printStackTrace();
+ found = true;
+ ignoreAdd = true;
+ }
+ }
+ if (!found) {
+ new Throwable("Improperly detected double chunk add. Was not actually in this chunk.").printStackTrace();
+ }
+ }
+ }
+ // Paper end
+
entity.aa = true;
entity.ab = this.locX;
entity.ac = k;
entity.ad = this.locZ;
this.entitySlices[k].add(entity);
// Paper start - update count
+ if (ignoreAdd) return;
if (entity instanceof EntityItem) {
itemCounts[k]++;
} else if (entity instanceof IInventory) {
@@ -0,0 +0,0 @@ public class Chunk {
} else if (entity instanceof IInventory) {
inventoryEntityCounts[i]--;
}
+ entity.aa = false; // You aren't added to chunk anymore
// Paper end
// Spigot start - decrement creature type count
// Keep this synced up with World.a(Class)
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 @@ public abstract class World implements IBlockAccess {
}
int k = MathHelper.floor(entity.locX / 16.0D);
- int l = MathHelper.floor(entity.locY / 16.0D);
+ 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.aa || entity.ab != k || entity.ac != l || entity.ad != i1) {
--
2.7.4 (Apple Git-66)

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
@@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
File file = new File(this.playerDir, entityhuman.bd() + ".dat");
File file = new File(this.playerDir, entityhuman.bf() + ".dat");
// Spigot Start
boolean usingWrongFile = false;
- if ( !file.exists() )

View file

@ -57,12 +57,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private ConcurrentLinkedQueue<QueuedChunk> queue = new ConcurrentLinkedQueue<>(); // Paper - Chunk queue improvements
+ private final Object lock = new Object(); // Paper - Chunk queue improvements
private static final Logger a = LogManager.getLogger();
private Map<ChunkCoordIntPair, NBTTagCompound> b = new ConcurrentHashMap();
- private Set<ChunkCoordIntPair> c = Collections.newSetFromMap(new ConcurrentHashMap());
+ //private Set<ChunkCoordIntPair> c = Collections.newSetFromMap(new ConcurrentHashMap()); // Paper - Chunk queue improvements
private final Map<ChunkCoordIntPair, NBTTagCompound> b = new ConcurrentHashMap();
- private final Set<ChunkCoordIntPair> c = Collections.newSetFromMap(new ConcurrentHashMap());
+ //private final Set<ChunkCoordIntPair> c = Collections.newSetFromMap(new ConcurrentHashMap()); // Paper - Chunk queue improvements
private final File d;
private final DataConverterManager e;
private boolean f = false;
private boolean f;
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
public boolean chunkExists(World world, int i, int j) {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);

View file

@ -4,19 +4,6 @@ Date: Sat, 4 Apr 2015 23:17:52 -0400
Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java b/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java
+++ b/src/main/java/net/minecraft/server/PacketPlayInResourcePackStatus.java
@@ -0,0 +0,0 @@ import java.io.IOException;
public class PacketPlayInResourcePackStatus implements Packet<PacketListenerPlayIn> {
- private String a;
+ public String a; // Paper - make public
public PacketPlayInResourcePackStatus.EnumResourcePackStatus status;
public PacketPlayInResourcePackStatus() {}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
@ -30,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.x());
+ final PlayerResourcePackStatusEvent.Status status = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];
+ this.getPlayer().setResourcePackStatus(status, packetplayinresourcepackstatus.a);
+ this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), status, packetplayinresourcepackstatus.a));
+ this.getPlayer().setResourcePackStatus(status);
+ this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), status));
+ // paper end
}
// CraftBukkit end
@ -77,9 +64,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return this.resourcePackStatus == org.bukkit.event.player.PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED;
+ }
+
+ public void setResourcePackStatus(org.bukkit.event.player.PlayerResourcePackStatusEvent.Status status, String hash) {
+ public void setResourcePackStatus(org.bukkit.event.player.PlayerResourcePackStatusEvent.Status status) {
+ this.resourcePackStatus = status;
+ this.resourcePackHash = hash;
+ }
+
// Spigot start

View file

@ -41,14 +41,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX();
int l = j * 16 + 8 - blockposition.getZ();
- short short0 = 128;
+ short short0 = paperConfig.keepLoadedRange; // Paper
boolean flag = true;
+ short keepLoadedRange = paperConfig.keepLoadedRange; // Paper
return k >= -short0 && k <= short0 && l >= -short0 && l <= short0 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory'
- return k >= -128 && k <= 128 && l >= -128 && l <= 128 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory'
+ return k >= -keepLoadedRange && k <= keepLoadedRange && l >= -keepLoadedRange && l <= keepLoadedRange && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' // Paper - Re-add range var
}
public void a(Packet<?> packet) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java

View file

@ -29,10 +29,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile {
if (block == this.av && i == this.aw) {
++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
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.die();
}
} else {

View file

@ -18,6 +18,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.i = iminecraftserver.e_();
if (0 == this.h) {
this.h = this.i + 10;
--
2.7.4 (Apple Git-66)
--

View file

@ -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<Boolean> bw = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Integer> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Integer> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> bz = 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);

View file

@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
@Nullable
public Entity c(int i) {
//this.ck = true; // CraftBukkit - Moved down and into PlayerList#changeDimension
// this.worldChangeInvuln = true; // CraftBukkit - Moved down and into PlayerList#changeDimension
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.world.kill(this);
if (!this.viewingCredits) {

View file

@ -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.ax = MathHelper.nextInt(this.random, 20, 80);
this.aw = MathHelper.nextInt(this.random, 20, 80);
}
} else {
- this.aw = MathHelper.nextInt(this.random, 100, 900);
+ this.aw = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper - Configurable fishing time range
this.aw -= EnchantmentManager.g(this.owner) * 20 * 5;
- 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;
}
}
--

View file

@ -28,10 +28,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal {
}
public boolean cG() {
- return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cG();
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.cG();
+ return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cK();
}
public void b(float f, float f1, float f2) {

View file

@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
public void U() {
this.world.methodProfiler.a("entityBaseTick");
if (this.isPassenger() && this.bz().dead) {
if (this.isPassenger() && this.bB().dead) {
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
this.fallDistance *= 0.5F;
}

View file

@ -9,7 +9,7 @@ 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.bn.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.bo.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
// CraftBukkit end
+ // Paper start - save the default replacement item and change it if necessary
@ -23,14 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
itemstack = null;
}
this.a(this.cu(), itemstack);
this.cA();
this.a(this.cy(), itemstack);
this.cE();
+
+ // 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)) {
+ ((EntityPlayer) this).getBukkitEntity().updateInventory();
+ }
+ // Paper end
}
}

View file

@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
+ if (!entity.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(entity instanceof EntityHuman)) { continue; } // Paper
String s2 = e(minecraftserver, icommandlistener, entity.bd());
String s2 = e(minecraftserver, icommandlistener, entity.bf());
if (scoreboard.addPlayerToTeam(s2, s)) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
@ -43,9 +43,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
@Nullable
public ScoreboardTeamBase aO() {
public ScoreboardTeamBase aQ() {
+ if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper
return this.world.getScoreboard().getPlayerTeam(this.bd());
return this.world.getScoreboard().getPlayerTeam(this.bf());
}
--

View file

@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
+
if (this.getHealth() <= 0.0F) {
SoundEffect soundeffect = this.bT();
SoundEffect soundeffect = this.bW();
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -63,8 +63,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (entity instanceof EntityHuman) {
EntityHuman entityhuman = (EntityHuman) entity;
- if (!entityhuman.isSpectator() && (!entityhuman.l_() || !entityhuman.abilities.isFlying)) {
+ if (!entityhuman.isSpectator() && (!entityhuman.l_() && !world.paperConfig.disableExplosionKnockback|| !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback
- if (!entityhuman.isSpectator() && (!entityhuman.z() || !entityhuman.abilities.isFlying)) {
+ if (!entityhuman.isSpectator() && (!entityhuman.z() && !world.paperConfig.disableExplosionKnockback || !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback
this.k.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
}
}

View file

@ -17,6 +17,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
--
2.7.4 (Apple Git-66)
--

View file

@ -108,6 +108,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (neighbor != null) {
neighbor.setNeighborLoaded(-x, -z);
chunk.setNeighborLoaded(x, z);
--
2.7.4 (Apple Git-66)
--

View file

@ -30,6 +30,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("Name", scoreboardteam.getName());
--
2.7.4 (Apple Git-66)
--

View file

@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.N;
}
+ public boolean shouldStayLoaded(int i, int j) { return c(i, j); } // Paper - OBFHELPER
public boolean c(int i, int j) {
+ public boolean shouldStayLoaded(int i, int j) { return d(i, j); } // Paper - OBFHELPER
public boolean d(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

View file

@ -16,5 +16,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable
private int a;
private int rotation;
public int rotation;
--

View file

@ -28,8 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
}
this.motY -= 0.03999999910593033D;
this.move(this.motX, this.motY, this.motZ);
+
+ // Paper start - Configurable EntityFallingBlock height nerf
@ -50,8 +50,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
this.lastZ = this.locZ;
this.motY -= 0.03999999910593033D;
}
this.move(this.motX, this.motY, this.motZ);
+
+ // Paper start - Configurable TNT entity height nerf

View file

@ -41,6 +41,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
queuedChunk.provider.originalGetChunkAt(queuedChunk.x, queuedChunk.z);
return;
}
--
2.7.4 (Apple Git-66)
--

View file

@ -44,9 +44,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
public void at() {}
protected abstract void b(NBTTagCompound nbttagcompound);
+ protected NBTTagList createList(double... adouble) { return a(adouble); } // Paper // OBFHELPER
+ protected NBTTagList createList(double... adouble) { return a(adouble); } // Paper - OBFHELPER
protected NBTTagList a(double... adouble) {
NBTTagList nbttaglist = new NBTTagList();
double[] adouble1 = adouble;

View file

@ -98,6 +98,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
--
2.7.4 (Apple Git-66)
--

View file

@ -10,28 +10,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public abstract class NavigationAbstract {
private static int f = 20;
- protected EntityInsentient a;
+ protected EntityInsentient a;public Entity getEntity() { return a; } // Paper
+ protected EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER
protected World b;
@Nullable
protected PathEntity c;
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
} else if (this.c != null && !this.c.b() && blockposition.equals(this.r)) {
} else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
return this.c;
} else {
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper
this.r = blockposition;
this.q = blockposition;
float f = this.h();
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
if (this.c != null && !this.c.b() && blockposition.equals(this.r)) {
if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
return this.c;
} else {
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper
this.r = blockposition;
this.q = blockposition;
float f = this.h();
--

View file

@ -40,6 +40,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.a(f);
this.foodTickTimer = 0;
}
--
2.7.4 (Apple Git-66)
--

View file

@ -38,6 +38,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public RedstoneUpdateInfo(BlockPosition blockposition, long i) {
this.a = blockposition;
--
2.7.4 (Apple Git-66)
--

View file

@ -1,33 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: chickeneer <emcchickeneer@gmail.com>
Date: Wed, 8 Jun 2016 20:39:19 -0400
Subject: [PATCH] Fix Potion Equals Bug
Will be in Spigot 1.10, but getting it in for 1.9 users
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
@@ -0,0 +0,0 @@ public class CraftPotionUtil {
.build();
public static String fromBukkit(PotionData data) {
+ String type;
if (data.isUpgraded()) {
- return upgradeable.get(data.getType());
+ type = upgradeable.get(data.getType());
+ } else if (data.isExtended()) {
+ type = extendable.get(data.getType());
+ } else {
+ type = regular.get(data.getType());
}
- if (data.isExtended()) {
- return extendable.get(data.getType());
- }
- return regular.get(data.getType());
+ return "minecraft:" + type;
}
public static PotionData toBukkit(String type) {
--

View file

@ -55,14 +55,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/BiomeMesa.java
+++ b/src/main/java/net/minecraft/server/BiomeMesa.java
@@ -0,0 +0,0 @@ public class BiomeMesa extends BiomeBase {
chunksnapshot.a(l, l1, k, BiomeMesa.a);
chunksnapshot.a(l, i2, k, BiomeMesa.a);
}
- if (l1 <= random.nextInt(5)) {
+ if (l1 <= (world.paperConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock
chunksnapshot.a(l, l1, k, BiomeMesa.c);
} else {
IBlockData iblockdata2 = chunksnapshot.a(l, l1, k);
- 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) {
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
--- a/src/main/java/net/minecraft/server/ChunkProviderFlat.java
@ -240,8 +240,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public void recreateStructures(Chunk chunk, int i, int j) {
- this.H.a(this.n, i, j, (ChunkSnapshot) null);
+ if (this.n.paperConfig.generateFortress) this.H.a(this.n, i, j, (ChunkSnapshot) null); // Paper
- this.I.a(this.n, i, j, (ChunkSnapshot) null);
+ if (this.n.paperConfig.generateFortress) this.I.a(this.n, i, j, (ChunkSnapshot) null);
}
}
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java

View file

@ -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 bR = LogManager.getLogger();
private static final Logger bS = 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.cg = packetplayinsettings.c();
this.ch = packetplayinsettings.d();
this.getDataWatcher().set(EntityPlayer.bq, Byte.valueOf((byte) packetplayinsettings.e()));
this.ch = packetplayinsettings.c();
this.ci = packetplayinsettings.d();
this.getDataWatcher().set(EntityPlayer.br, 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

View file

@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/WorldMap.java
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
public List<WorldMap.WorldMapHumanTracker> h = Lists.newArrayList();
public Map<EntityHuman, WorldMap.WorldMapHumanTracker> j = Maps.newHashMap(); // Spigot
public final Map<EntityHuman, WorldMap.WorldMapHumanTracker> j = Maps.newHashMap(); // Spigot
public Map<UUID, MapIcon> decorations = Maps.newLinkedHashMap(); // Spigot
+ private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper
@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper stop
public final EntityHuman trackee;
private boolean d = true;
private int e = 0;
private int e;
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
public Packet<?> a(ItemStack itemstack) {
@ -144,6 +144,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public final ArrayList<MapCursor> cursors;
public RenderData() {
--
2.7.4 (Apple Git-66)
--

View file

@ -562,7 +562,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public TileEntityLootable() {}
protected boolean d(NBTTagCompound nbttagcompound) {
protected boolean c(NBTTagCompound nbttagcompound) {
+ lootableData.loadNbt(nbttagcompound); // Paper
if (nbttagcompound.hasKeyOfType("LootTable", 8)) {
this.m = new MinecraftKey(nbttagcompound.getString("LootTable"));
@ -574,7 +574,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
protected boolean e(NBTTagCompound nbttagcompound) {
protected boolean d(NBTTagCompound nbttagcompound) {
+ lootableData.saveNbt(nbttagcompound); // Paper
if (this.m != null) {
nbttagcompound.setString("LootTable", this.m.toString());

View file

@ -28,6 +28,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Try to see if we're actually running in a terminal, disable jline if not
if (System.console() == null && System.getProperty("jline.terminal") == null) {
System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
--
2.7.4 (Apple Git-66)
--

View file

@ -3,7 +3,6 @@ From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
Collection of utils to help reduce NMS diff
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644
@ -204,8 +203,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public class NBTTagCompound extends NBTBase {
- private Map<String, NBTBase> map = Maps.newHashMap();
+ public Map<String, NBTBase> map = Maps.newHashMap(); // Paper
- private final Map<String, NBTBase> map = Maps.newHashMap();
+ public final Map<String, NBTBase> map = Maps.newHashMap(); // Paper
public NBTTagCompound() {}
@ -236,6 +235,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private byte type = 0;
public NBTTagList() {}
--
2.7.4 (Apple Git-66)
--

View file

@ -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.bG == 1) {
if (this.bH == 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;

View file

@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
public final Set<Long> unloadQueue = Sets.newHashSet(); // PAIL: private -> public
public final Set<Long> unloadQueue = Sets.newHashSet();
public final ChunkGenerator chunkGenerator;
private final IChunkLoader chunkLoader;
- public final Long2ObjectMap<Chunk> chunks = new Long2ObjectOpenHashMap(8192);

View file

@ -64,6 +64,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
}
--
2.7.4 (Apple Git-66)
--

View file

@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
PathEntity pathentity = this.a(entity);
- return pathentity != null ? this.a(pathentity, d0) : false;
- return pathentity != null && this.a(pathentity, d0);
+ if (pathentity != null && this.a(pathentity, d0)) {
+ this.lastFailure = 0;
+ this.pathfindFailures = 0;

View file

@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable, II
}
public void c() {
public void E_() {
+ // Paper - Disable all of this, just in case this does get ticked
+ /*
this.m();
@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public TileEntityEnderChest() {}
public void c() {
public void E_() {
+ // Paper start - Disable all of this, just in case this does get ticked
+ /*
if (++this.h % 20 * 4 == 0) {
@ -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.aM, 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.aN, 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.aL, 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.aM, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
+ this.a = 0.0F;
+ }
+ // Paper end

View file

@ -95,6 +95,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
--
2.7.4 (Apple Git-66)
--

View file

@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper Start - (Meh) Support for vanilla world scoreboard name coloring
+ String displayName = event.getPlayer().getDisplayName();
+ if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) {
+ displayName = ScoreboardTeam.getPlayerDisplayName(this.player.aO(), player.getDisplayName());
+ displayName = ScoreboardTeam.getPlayerDisplayName(this.player.aQ(), player.getDisplayName());
+ }
+
+ s = String.format(event.getFormat(), displayName, event.getMessage());

View file

@ -189,7 +189,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
world.addEntity(entitytntprimed);
world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gk, SoundCategory.BLOCKS, 1.0F, 1.0F);
world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gz, 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
@ -214,14 +214,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
}
public boolean aj() {
public boolean ak() {
+ // Paper start - OBFHELPER
+ return this.doWaterMovement();
+ }
+
+ public boolean doWaterMovement() {
+ // Paper end
if (this.bz() instanceof EntityBoat) {
if (this.bB() instanceof EntityBoat) {
this.inWater = false;
} else if (this.world.a(this.getBoundingBox().grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.001D), Material.WATER, this)) {
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
@ -253,7 +253,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
}
public boolean be() {
public boolean bg() {
+ // Paper start - OBFHELPER
+ return this.pushedByWater();
+ }
@ -268,7 +268,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
public boolean bs() {
public boolean bu() {
return true;
}
+

View file

@ -17,16 +17,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper</artifactId>
<packaging>jar</packaging>
<version>1.9.4-R0.1-SNAPSHOT</version>
<version>1.10-R0.1-SNAPSHOT</version>
- <name>Spigot</name>
- <url>http://www.spigotmc.org</url>
+ <name>Paper</name>
+ <url>https://github.com/PaperSpigot/Paper</url>
+ <url>https://github.com/PaperMC/Paper</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -0,0 +0,0 @@
<minecraft_version>1_9_R2</minecraft_version>
<minecraft_version>1_10_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix>
- <maven.compiler.source>1.6</maven.compiler.source>

View file

@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Village.java
+++ b/src/main/java/net/minecraft/server/Village.java
@@ -0,0 +0,0 @@ public class Village {
private List<Village.Aggressor> k;
private final List<Village.Aggressor> k;
private int l;
- public Village() {
@ -31,13 +31,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.c = BlockPosition.ZERO;
this.d = BlockPosition.ZERO;
this.j = new TreeMap();
@@ -0,0 +0,0 @@ public class Village {
NBTTagCompound nbttagcompound2 = nbttaglist1.get(j);
if (nbttagcompound2.hasKey("UUID")) {
- UserCache usercache = this.a.getMinecraftServer().getUserCache();
+ UserCache usercache = MinecraftServer.getServer().getUserCache(); // Paper - Bandaid for world being null
GameProfile gameprofile = usercache.a(UUID.fromString(nbttagcompound2.getString("UUID")));
if (gameprofile != null) {
--

View file

@ -53,6 +53,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- this.applyExhaustion(0.015F * (float) i * 0.01F);
+ this.applyExhaustion(world.paperConfig.playerSwimmingExhaustion); // Paper - Configurable swimming exhaustion
}
} else if (this.n_()) {
} else if (this.m_()) {
if (d1 > 0.0D) {
--

View file

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import com.mojang.authlib.GameProfile;
import java.util.Arrays;
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
private final ItemCooldown bV = this.l();
private final ItemCooldown bW = this.l();
public EntityFishingHook hookedFish;
+ // Paper start - affectsSpawning API
@ -55,8 +55,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
@@ -0,0 +0,0 @@ public class EntitySilverfish extends EntityMonster {
public boolean cG() {
if (super.cG()) {
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

View file

@ -44,6 +44,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
return i;
--
2.7.4 (Apple Git-66)
--

View file

@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private void flow(World world, BlockPosition blockposition, IBlockData iblockdata, int i) {
- if (world.isLoaded(blockposition) && this.h(world, blockposition, iblockdata)) { // CraftBukkit - add isLoaded check
+ if (/*world.isLoaded(blockposition) &&*/ this.h(world, blockposition, iblockdata)) { // CraftBukkit - add isLoaded check // Paper - Already checked before we get here for isLoaded
if (iblockdata.getBlock() != Blocks.AIR) {
if (iblockdata.getMaterial() != Material.AIR) {
if (this.material == Material.LAVA) {
this.fizz(world, blockposition);
--

View file

@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
((ITickable) tileentity).c();
((ITickable) tileentity).E_();
this.methodProfiler.b();
} catch (Throwable throwable2) {
- crashreport1 = CrashReport.a(throwable2, "Ticking block entity");

View file

@ -9,59 +9,45 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
ItemStack itemstack;
ItemStack itemstack1;
+ try { // Paper - Reimplement BookEditEvent
if ("MC|BEdit".equals(s)) {
packetdataserializer = new PacketDataSerializer(Unpooled.wrappedBuffer(packetplayincustompayload.b()));
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
if (itemstack1 != null) {
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
itemstack1.a("pages", (NBTBase) itemstack.getTag().getList("pages", 8));
+ CraftEventFactory.handleEditBookEvent(player, itemstack1); // Paper
}
return;
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
itemstack1.a("pages", (NBTBase) itemstack.getTag().getList("pages", 8));
+ CraftEventFactory.handleEditBookEvent(player, itemstack1); // Paper
}
} catch (Exception exception) {
PlayerConnection.LOGGER.error("Couldn\'t handle book info", exception);
+ this.disconnect("Invalid Book Data!"); // Paper
return;
} finally {
packetdataserializer.release();
}
} else {
String s1;
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
itemstack1.a("pages", (NBTBase) nbttaglist);
itemstack1.setItem(Items.WRITTEN_BOOK);
+ CraftEventFactory.handleEditBookEvent(player, itemstack1); // Paper
}
return;
itemstack1.a("pages", (NBTBase) nbttaglist);
itemstack1.setItem(Items.WRITTEN_BOOK);
+ CraftEventFactory.handleEditBookEvent(player, itemstack1); // Paper
}
} catch (Exception exception1) {
PlayerConnection.LOGGER.error("Couldn\'t sign book", exception1);
+ this.disconnect("Invalid Book Data!"); // Paper
return;
} finally {
packetdataserializer.release();
}
} else if ("MC|TrSel".equals(s)) {
try {
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
}
} catch (Exception exception3) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
+ this.disconnect("Invalid Command Block Data!"); // Paper
} finally {
packetdataserializer.release();
}
} else if ("MC|AutoCmd".equals(s)) {
if (!this.minecraftServer.getEnableCommandBlock()) {
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
}
} catch (Exception exception4) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
+ this.disconnect("Invalid Command Block Data!"); // Paper
} finally {
packetdataserializer.release();
}
} else {
int k;
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
}
} catch (Exception exception5) {
@ -70,20 +56,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
} else if ("MC|ItemName".equals(s)) {
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
}
}
}
+ // Paper start
+ } finally {
+ if (packetplayincustompayload.b().refCnt() > 0) {
+ packetplayincustompayload.b().release();
+ }
+ }
+ // Paper end
}
--
2.7.4 (Apple Git-66)
--

View file

@ -50,6 +50,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) {
if (world.isClientSide) {
--
2.7.4 (Apple Git-66)
--

View file

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private boolean x;
private boolean y;
public boolean b;
- public Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
- public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
+ // Paper start
+ // Replace trackedPlayers Set with a Map. The value is true until the player receives
+ // their first update (which is forced to have absolute coordinates), false afterward.
@ -23,38 +23,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public EntityTrackerEntry(Entity entity, int i, int j, int k, boolean flag) {
this.tracker = entity;
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
boolean flag = k1 * k1 + l1 * l1 + i2 * i2 >= 128L || this.a % 60 == 0;
boolean flag1 = Math.abs(i1 - this.yRot) >= 1 || Math.abs(j1 - this.xRot) >= 1;
boolean flag1 = l1 * l1 + i2 * i2 + j2 * j2 >= 128L || this.a % 60 == 0;
boolean flag2 = Math.abs(j1 - this.yRot) >= 1 || Math.abs(k1 - this.xRot) >= 1;
- // CraftBukkit start - Code moved from below
- if (flag) {
- this.xLoc = j;
- this.yLoc = k;
- this.zLoc = l;
- }
+ if (this.a > 0 || this.tracker instanceof EntityArrow) { // Paper - Moved up
+ // CraftBukkit start - Code moved from below
+ if (flag) {
+ this.xLoc = j;
+ this.yLoc = k;
+ this.zLoc = l;
+ }
- if (flag1) {
+ if (flag1) {
+ this.yRot = i1;
+ this.xRot = j1;
+ }
+ // CraftBukkit end
this.yRot = i1;
this.xRot = j1;
- }
// CraftBukkit start - Code moved from below
if (flag1) {
this.xLoc = k;
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
}
// CraftBukkit end
-
- if (this.a > 0 || this.tracker instanceof EntityArrow) {
if (k1 >= -32768L && k1 < 32768L && l1 >= -32768L && l1 < 32768L && i2 >= -32768L && i2 < 32768L && this.v <= 400 && !this.x && this.y == this.tracker.onGround) {
if ((!flag || !flag1) && !(this.tracker instanceof EntityArrow)) {
if (flag) {
if (l1 >= -32768L && l1 < 32768L && i2 >= -32768L && i2 < 32768L && j2 >= -32768L && j2 < 32768L && this.v <= 400 && !this.x && this.y == this.tracker.onGround) {
if ((!flag1 || !flag2) && !(this.tracker instanceof EntityArrow)) {
if (flag1) {
@@ -0,0 +0,0 @@ public class EntityTrackerEntry {
}

View file

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)." +
+ "\nand also agreeing that tacos are tasty."); // Paper - fix lag
} catch (Exception exception) {
EULA.a.warn("Failed to save " + this.b, exception);
EULA.a.warn("Failed to save {}", new Object[] { this.b, exception});
} finally {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View file

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.whitelist(minecraftserver, astring[1], true);
+ // Paper end
a(icommandlistener, (ICommand) this, "commands.whitelist.add.success", new Object[] { astring[1]});
} else if (astring[0].equals("remove")) {
} else if ("remove".equals(astring[0])) {
if (astring.length < 2) {
throw new ExceptionUsage("commands.whitelist.remove.usage", new Object[0]);
}
@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.whitelist(minecraftserver, astring[1], false);
+ // Paper end
a(icommandlistener, (ICommand) this, "commands.whitelist.remove.success", new Object[] { astring[1]});
} else if (astring[0].equals("reload")) {
} else if ("reload".equals(astring[0])) {
minecraftserver.getPlayerList().reloadWhitelist();
@@ -0,0 +0,0 @@ public class CommandWhitelist extends CommandAbstract {
return Collections.emptyList();

View file

@ -17,6 +17,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
{
Logger log = Bukkit.getServer().getLogger();
log.log( Level.SEVERE, "The server has stopped responding!" );
--
2.7.4 (Apple Git-66)
--

View file

@ -381,7 +381,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void m() {
- SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
super.m();
this.cv();
this.cz();
if (!this.world.isClientSide) {
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
}
@ -395,7 +395,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
float f = (float) (d0 * d0 + d1 * d1);
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
} else {
this.bp = 0;
this.bq = 0;
}
-
- SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
@ -407,9 +407,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world.methodProfiler.a("ai");
- SpigotTimings.timerEntityAI.startTiming(); // Spigot
if (this.cg()) {
this.bd = false;
this.be = 0.0F;
if (this.cj()) {
this.be = false;
this.bf = 0.0F;
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.doTick();
this.world.methodProfiler.b();
@ -419,16 +419,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world.methodProfiler.b();
this.world.methodProfiler.a("jump");
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.bf *= 0.98F;
this.bg *= 0.9F;
this.bg *= 0.98F;
this.bh *= 0.9F;
this.r();
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
this.g(this.be, this.bf);
this.g(this.bf, this.bg);
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
this.world.methodProfiler.b();
this.world.methodProfiler.a("push");
- SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
this.co();
this.cs();
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.methodProfiler.b();
}
@ -486,7 +486,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.server != null) {
this.server.disablePlugins();
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
protected void B() {}
public void B() {}
protected void C() throws ExceptionWorldConflict { // CraftBukkit - added throws
- SpigotTimings.serverTickTimer.startTiming(); // Spigot
@ -602,7 +602,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)).c();
((ITickable) this.o.get(i)).E_();
}
- SpigotTimings.tickablesTimer.stopTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.stopTiming(); // Spigot
@ -775,8 +775,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 Map<String, Class<? extends TileEntity>> f = Maps.newHashMap();
private static Map<Class<? extends TileEntity>, String> g = Maps.newHashMap();
private static final Map<String, Class<? extends TileEntity>> f = Maps.newHashMap();
private static final Map<Class<? extends TileEntity>, String> g = Maps.newHashMap();
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
@ -868,7 +868,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.aa) {
if (flag && entity.ab) {
++entity.ticksLived;
+ ++co.aikar.timings.TimingHistory.activatedEntityTicks; // Paper
if (entity.isPassenger()) {
@ -944,7 +944,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) {
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
if (this.areChunksLoadedBetween(nextticklistentry.a.a(-b0, -b0, -b0), nextticklistentry.a.a(b0, b0, b0))) {
if (this.areChunksLoadedBetween(nextticklistentry.a.a(0, 0, 0), nextticklistentry.a.a(0, 0, 0))) {
IBlockData iblockdata = this.getType(nextticklistentry.a);
+ co.aikar.timings.Timing timing = iblockdata.getBlock().getTiming(); // Paper
+ timing.startTiming(); // Paper
@ -1398,7 +1398,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- SpigotTimings.checkIfActiveTimer.startTiming();
// Never safe to skip fireworks or entities not yet added to chunk
// PAIL: inChunk
if ( !entity.aa || entity instanceof EntityFireworks ) {
if ( !entity.ab || entity instanceof EntityFireworks ) {
- SpigotTimings.checkIfActiveTimer.stopTiming();
return true;
}

View file

@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public class ChunkProviderServer implements IChunkProvider {
private static final Logger a = LogManager.getLogger();
- public final Set<Long> unloadQueue = Sets.newHashSet(); // PAIL: private -> public
- public final Set<Long> unloadQueue = Sets.newHashSet();
+ public final it.unimi.dsi.fastutil.longs.LongSet unloadQueue = new it.unimi.dsi.fastutil.longs.LongArraySet(); // PAIL: private -> public // Paper
public final ChunkGenerator chunkGenerator;
private final IChunkLoader chunkLoader;

View file

@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
this.width = 0.6F;
this.length = 1.8F;
this.aw = 1;
this.ax = 1;
- this.random = new Random();
+ this.random = SHARED_RANDOM; // Paper
this.maxFireTicks = 1;

View file

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public boolean a(Entity entity, boolean flag) {
+ return this.mountEntity(entity, flag, false); // Paper - forward
+ return this.mountEntity(entity, flag, false); // Paper - OBFHELPER
+ }
+
+ public boolean mountEntity(Entity entity, boolean flag, boolean suppressEvents) { // Paper
@ -22,9 +22,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
}
this.at = entity;
- this.at.o(this);
+ this.at.addRider(this, suppressEvents); // Paper
this.au = entity;
- this.au.o(this);
+ this.au.addRider(this, suppressEvents); // Paper
return true;
}
}
@ -32,13 +32,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
protected void o(Entity entity) {
+ // Paper start - Forward
+ // Paper start - OBFHELPER
+ this.addRider(entity, false);
+ }
+
+ private void addRider(Entity entity, boolean suppressEvents) {
+ // Paper end
if (entity.bz() != this) {
if (entity.bB() != this) {
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
} else {
// CraftBukkit start
@ -55,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot end
+ // =============================================================
+ } // Paper - end suppressible block
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bu() instanceof EntityHuman)) {
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bw() instanceof EntityHuman)) {
this.passengers.add(0, entity);
} else {
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
@ -87,8 +87,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
+
protected boolean q(Entity entity) {
return this.bv().size() < 1;
return this.bx().size() < 1;
}
--
2.7.4 (Apple Git-66)
--

View file

@ -5,13 +5,13 @@ Subject: [PATCH] Water mobs should only spawn in the water
diff --git a/src/main/java/net/minecraft/server/EntityWaterAnimal.java b/src/main/java/net/minecraft/server/EntityWaterAnimal.java
index 0000000000000000000000000000000000000000..00000000000000000000000000000000000000005 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityWaterAnimal.java
+++ b/src/main/java/net/minecraft/server/EntityWaterAnimal.java
@@ -0,0 +0,0 @@ public abstract class EntityWaterAnimal extends EntityInsentient implements IAni
}
public boolean cG() {
public boolean cK() {
- return true;
+ // Paper start - Don't let water mobs spawn in non-water blocks
+ // Based around EntityAnimal's implementation

View file

@ -34,6 +34,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// CraftBukkit end
--
2.7.4 (Apple Git-66)
--

View file

@ -62,7 +62,6 @@ import NavigationAbstract
import NBTTagCompound
import NBTTagList
import PersistentScoreboard
import PacketPlayInResourcePackStatus
import PacketPlayInUseEntity
import PacketPlayOutPlayerListHeaderFooter
import PacketPlayOutScoreboardTeam

@ -1 +1 @@
Subproject commit 9b100f8a6f0d86b5fd5f22f65dd6dd9eba6547d3
Subproject commit cede5450c952c76341e047b8d04f9894f16e596d

@ -1 +1 @@
Subproject commit c5bf6bc614bfd1e119e7fc067ff30cd8e8221cb2
Subproject commit a4fe2264e678cdc646098df61398ea8a10b0731a

@ -1 +1 @@
Subproject commit 0cd0397a8295992112ad3bf0d37795a04d22503e
Subproject commit 885f4dce9e238040777536ff34b5b7cee76d6d80

@ -1 +1 @@
Subproject commit 798f32dcaacf2cb2af0d4e17ff0d221dafe141ab
Subproject commit da278d16b469b98f961d0e8fbffe81f274a930db