Update Paper to MC 1.11

This commit is contained in:
Zach Brown 2016-11-16 20:23:38 -06:00
parent 502ade5e74
commit 4832b1a385
80 changed files with 453 additions and 658 deletions

View File

@ -14,11 +14,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final RegainReason regainReason; private final RegainReason regainReason;
+ private final boolean isFastRegen; // Paper + 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) { public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) {
+ // Paper start - Forward + // Paper start - Forward
+ this(entity, amount, regainReason, false); + this(entity, amount, regainReason, false);

View File

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>spigot-api</artifactId> - <artifactId>spigot-api</artifactId>
+ <groupId>com.destroystokyo.paper</groupId> + <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId> + <artifactId>paper-api</artifactId>
<version>1.10.2-R0.1-SNAPSHOT</version> <version>1.11-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
- <name>Spigot-API</name> - <name>Spigot-API</name>
@ -101,7 +101,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
<plugin> <plugin>
- <groupId>org.codehaus.mojo</groupId> - <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId> - <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.14</version> - <version>1.15</version>
- <executions> - <executions>
- <execution> - <execution>
- <phase>process-classes</phase> - <phase>process-classes</phase>
@ -121,5 +121,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <plugin> - <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version> <version>2.4.3</version>
-- --

View File

@ -59,12 +59,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
int i = getLevel(); int i = getLevel();
List list = getHumansInRange(); List list = getHumansInRange();
- applyEffect(list, this.l, i, b0); - applyEffect(list, this.primaryEffect, i, b0);
+ applyEffect(list, this.l, i, b0, true); // Paper - BeaconEffectEvent + applyEffect(list, this.primaryEffect, i, b0, true); // Paper - BeaconEffectEvent
if (hasSecondaryEffect()) { if (hasSecondaryEffect()) {
- applyEffect(list, this.m, i, 0); - applyEffect(list, this.secondaryEffect, i, 0);
+ applyEffect(list, this.m, i, 0, false); // Paper - BeaconEffectEvent + applyEffect(list, this.secondaryEffect, i, 0, false); // Paper - BeaconEffectEvent
} }
} }

View File

@ -25,7 +25,7 @@ diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/j
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java --- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/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) { if (!this.world.isClientSide && !this.dead) {
EntityWitch entitywitch = new EntityWitch(this.world); 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.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
entitywitch.prepare(this.world.D(new BlockPosition(entitywitch)), (GroupDataEntity) null); entitywitch.prepare(this.world.D(new BlockPosition(entitywitch)), (GroupDataEntity) null);
entitywitch.setAI(this.hasAI()); 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()); entitywitch.setCustomNameVisible(this.getCustomNameVisible());
} }
@ -64,6 +64,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end + // Paper end
+ +
public static HorseJumpEvent callHorseJumpEvent(Entity horse, float power) { 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); horse.getBukkitEntity().getServer().getPluginManager().callEvent(event);
-- --

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java --- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
+++ b/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<PacketListenerPlayIn> { public class PacketPlayInUseEntity implements Packet<PacketListenerPlayIn> {

View File

@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.c(blockposition, true); return this.c(blockposition, true);
} }
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -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 + // Paper start - reduces need to do isLoaded before getType

View File

@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -0,0 +0,0 @@ public class PaperWorldConfig {
log("Player exhaustion penalty for breaking blocks is " + blockBreakExhaustion); private void nerfedMobsShouldJump() {
log("Player exhaustion penalty for swimming is " + playerSwimmingExhaustion); nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
} }
+ +
+ public int softDespawnDistance; + public int softDespawnDistance;

View File

@ -217,7 +217,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
@@ -0,0 +0,0 @@ public class RegionFile { @@ -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) { } catch (IOException ioexception) {
ioexception.printStackTrace(); ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception); // Paper + ServerInternalException.reportInternalException(ioexception); // Paper
@ -284,7 +284,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.List; import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -0,0 +0,0 @@ public class VillageSiege { @@ -0,0 +0,0 @@ public class VillageSiege {
entityzombie.setVillagerType(EnumZombieType.NORMAL); entityzombie.prepare(this.a.D(new BlockPosition(entityzombie)), (GroupDataEntity) null);
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper + ServerInternalException.reportInternalException(exception); // Paper

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/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 @@ -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 + public Entity getEntity(UUID uuid) { return this.a(uuid); } // Paper - OBFHELPER

View File

@ -40,9 +40,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (movingobjectposition != null) { if (movingobjectposition != null) {
- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event - 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 + org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Craftbukkit - Call event // Paper - Include entity in movingobjectposition
if (movingobjectposition.entity != null) { vec3d1 = new Vec3D(movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z);
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 diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityProjectile.java --- a/src/main/java/net/minecraft/server/EntityProjectile.java

View File

@ -12,14 +12,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue(); return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue();
} }
+ public final int getStuckArrows() { return this.cb(); } // Paper - OBFHELPER + public final int getStuckArrows() { return this.cc(); } // Paper - OBFHELPER
public final int cb() { public final int cc() {
return ((Integer) this.datawatcher.get(EntityLiving.h)).intValue(); return ((Integer) this.datawatcher.get(EntityLiving.bq)).intValue();
} }
+ public final void setStuckArrows(int arrows) { this.f(arrows); } // Paper - OBFHELPER + public final void setStuckArrows(int arrows) { this.f(arrows); } // Paper - OBFHELPER
public final void f(int i) { 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 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View File

@ -23,13 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntitySlime.java --- a/src/main/java/net/minecraft/server/EntitySlime.java
+++ b/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 { @@ -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) { - 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 + boolean isSlimeChunk = world.paperConfig.allChunksAreSlimeChunks || chunk.a(987234911L).nextInt(10) == 0; // Paper
+ if (this.random.nextInt(10) == 0 && isSlimeChunk && this.locY < 40.0D) { + if (this.random.nextInt(10) == 0 && isSlimeChunk && this.locY < 40.0D) {
return super.cK(); return super.cM();
} }
} }
-- --

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -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"); 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 --- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/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 { @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
private boolean bE; private boolean bD;
private Entity leashHolder; private Entity leashHolder;
private NBTTagCompound bG; private NBTTagCompound bF;
+ private NBTTagCompound bG;
+ public PathfinderGoalFloat goalFloat; // Paper + public PathfinderGoalFloat goalFloat; // Paper
public EntityInsentient(World world) { public EntityInsentient(World world) {

View File

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

View File

@ -12,15 +12,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final DataWatcherObject<Boolean> aB = DataWatcher.a(Entity.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> aB = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Boolean> aC = DataWatcher.a(Entity.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> aC = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Boolean> aD = DataWatcher.a(Entity.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> aD = DataWatcher.a(Entity.class, DataWatcherRegistry.h);
- public boolean ab; - public boolean aa;
- public int ab;
- public int ac; - public int ac;
- public int ad; - public int ad;
- public int ae; + public boolean aa; public boolean isAddedToChunk() { return aa; } // Paper - OBFHELPER
+ public boolean ab; public boolean isAddedToChunk() { return ab; } // Paper - OBFHELPER + public int ab; public int getChunkX() { return ab; } // Paper - OBFHELPER
+ public int ac; public int getChunkX() { return ac; } // Paper - OBFHELPER + public int ac; public int getChunkY() { return ac; } // Paper - OBFHELPER
+ public int ad; public int getChunkY() { return ad; } // Paper - OBFHELPER + public int ad; public int getChunkZ() { return ad; } // Paper - OBFHELPER
+ public int ae; public int getChunkZ() { return ae; } // Paper - OBFHELPER public boolean ah;
public boolean ai;
public boolean impulse; public boolean impulse;
public int portalCooldown; public int portalCooldown;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java 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) { - for (i = 0; i < this.f.size(); ++i) {
- entity = (Entity) this.f.get(i); - entity = (Entity) this.f.get(i);
- int k = entity.ac; - int k = entity.ab;
- -
- j = entity.ae; - j = entity.ad;
- if (entity.ab && this.isChunkLoaded(k, j, true)) { - if (entity.aa && this.isChunkLoaded(k, j, true)) {
- this.getChunkAt(k, j).b(entity); - this.getChunkAt(k, j).b(entity);
+ if (e.isAddedToChunk() && this.isChunkLoaded(k, j, true)) { + if (e.isAddedToChunk() && this.isChunkLoaded(k, j, true)) {
+ this.getChunkAt(k, j).b(e); + this.getChunkAt(k, j).b(e);

View File

@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile { @@ -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) { } catch (IOException ioexception) {
- ioexception.printStackTrace(); - ioexception.printStackTrace();
- ServerInternalException.reportInternalException(ioexception); // Paper - ServerInternalException.reportInternalException(ioexception); // Paper

View File

@ -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 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); 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) {
-- --

View File

@ -25,15 +25,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/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 @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
long j = av(); long j = aw();
i = 0; i = 0;
- for (int k = -192; k <= 192 && this.isRunning(); k += 16) { - for (int k = -192; k <= 192 && this.isRunning(); k += 16) {
- for (int l = -192; l <= 192 && this.isRunning(); l += 16) { - for (int l = -192; l <= 192 && this.isRunning(); l += 16) {
+ short radius = worldserver.paperConfig.keepLoadedRange; // Paper + // Paper start
+ for (int k = -radius; k <= radius && this.isRunning(); k += 16) { // Paper + short radius = worldserver.paperConfig.keepLoadedRange;
+ for (int l = -radius; l <= radius && this.isRunning(); l += 16) { // Paper + for (int k = -radius; k <= radius && this.isRunning(); k += 16) {
long i1 = av(); + for (int l = -radius; l <= radius && this.isRunning(); l += 16) {
+ // Paper end
long i1 = aw();
if (i1 - j > 1000L) { 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/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java

View File

@ -28,12 +28,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityArrow.java --- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/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 { @@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile {
this.ay = 0;
if (block == this.aw && i == this.ax) { } else {
++this.ay; ++this.ax;
- if (this.ay >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter - if (this.ax >= 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 + if (this.ax >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot - First int after shooter // Paper
this.die(); this.die();
} }
} else { }
-- --

View File

@ -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 + ")"); 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 { @@ -0,0 +0,0 @@ public abstract class PlayerList {
entityplayer.k_();// SPIGOT-924 // PAIL: rename - playerTick entityplayer.playerTick();// SPIGOT-924
// CraftBukkit end // CraftBukkit end
+ // Paper start - Remove from collideRule team if needed + // Paper start - Remove from collideRule team if needed

View File

@ -29,9 +29,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); 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 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 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> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> bw = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Integer> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> bz = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
if (this.world != null && !this.world.isClientSide) { if (this.world != null && !this.world.isClientSide) {
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);

View File

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public int fishingMaxTicks; + public int fishingMaxTicks;
+ private void fishingTickRange() { + private void fishingTickRange() {
+ fishingMinTicks = getInt("fishing-time-range.MinimumTicks", 100); + 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"); + 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 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/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 { @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
this.aw = MathHelper.nextInt(this.random, 20, 80); this.at = MathHelper.nextInt(this.random, 20, 80);
} }
} else { } else {
- this.av = MathHelper.nextInt(this.random, 100, 900); - this.h = MathHelper.nextInt(this.random, 100, 600);
+ this.av = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper - Configurable fishing time range + this.h = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper - Configurable fishing time range
this.av -= EnchantmentManager.g(this.owner) * 20 * 5; this.h -= EnchantmentManager.g(this.owner) * 20 * 5;
} }
} }
-- --

View File

@ -15,10 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ public double skeleHorseSpawnChance; + public double skeleHorseSpawnChance;
+ private void skeleHorseSpawnChance() { + private void skeleHorseSpawnChance() {
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", -1.0D); // -1.0D represents a "vanilla" state + skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state
+ if (skeleHorseSpawnChance < 0) {
+ skeleHorseSpawnChance = 0.05D; // Vanilla
+ }
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java 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)) { if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.D(blockposition); DifficultyDamageScaler difficultydamagescaler = this.D(blockposition);
- if (this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.05D) { - if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) {
+ if (this.random.nextDouble() < difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { // Paper - Configurable skeleton horse spawn chance + if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) {
EntityHorse entityhorse = new EntityHorse(this); EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
entityhorse.setType(EnumHorseType.SKELETON); entityhorseskeleton.p(true);
-- --

View File

@ -28,10 +28,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal { @@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal {
} }
public boolean cK() { public boolean cM() {
- return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cK(); - return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cM();
+ // Paper - Configurable squid spawn height range + return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cM(); // Paper - Configurable squid spawn height range
+ return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cK();
} }
public void b(float f, float f1, float f2) { public void b(float f, float f1, float f2) {

View File

@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/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 { @@ -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 // CraftBukkit end
+
+ // Paper start - save the default replacement item and change it if necessary + // Paper start - save the default replacement item and change it if necessary
+ final ItemStack defaultReplacement = itemstack; + final ItemStack defaultReplacement = itemstack;
+ if (event.getReplacement() != null) { + if (event.getReplacement() != null) {
@ -19,12 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
+ +
if (itemstack != null && itemstack.count == 0) { this.cF();
itemstack = null;
}
this.a(this.cy(), itemstack);
this.cE();
+ +
+ // Paper start - if the replacement is anything but the default, update the client inventory + // 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)) { + if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {

View File

@ -44,14 +44,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback + if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
+ +
if (this.getHealth() <= 0.0F) { 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 diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Explosion.java --- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion { @@ -0,0 +0,0 @@ public class Explosion {
double d14 = 1.0D; double d14 = d13;
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
- d14 = EnchantmentProtection.a((EntityLiving) entity, d13); - d14 = EnchantmentProtection.a((EntityLiving) entity, d13);

View File

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - snow blocks don't need to tick + // Paper start - snow blocks don't need to tick
+ /* + /*
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { 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); this.b(world, blockposition, world.getType(blockposition), 0);
@@ -0,0 +0,0 @@ public class BlockSnowBlock extends Block { @@ -0,0 +0,0 @@ public class BlockSnowBlock extends Block {
} }

View File

@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.N; return this.N;
} }
+ public boolean shouldStayLoaded(int i, int j) { return d(i, j); } // Paper - OBFHELPER + public boolean shouldStayLoaded(int i, int j) { return e(i, j); } // Paper - OBFHELPER
public boolean d(int i, int j) { public boolean e(int i, int j) {
BlockPosition blockposition = this.getSpawn(); BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX(); 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 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 --- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/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 { @@ -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; - 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 + return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds
} }
} }

View File

@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { @@ -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 + // Paper start - Configurable EntityFallingBlock height nerf
+ if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperConfig.fallingBlockHeightNerf) { + if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperConfig.fallingBlockHeightNerf) {
@ -41,7 +41,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.die(); + this.die();
+ } + }
+ // Paper end + // Paper end
+
this.motX *= 0.9800000190734863D; this.motX *= 0.9800000190734863D;
this.motY *= 0.9800000190734863D; this.motY *= 0.9800000190734863D;
this.motZ *= 0.9800000190734863D; this.motZ *= 0.9800000190734863D;
@ -52,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity { @@ -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 + // Paper start - Configurable TNT entity height nerf
+ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY > this.world.paperConfig.entityTNTHeightNerf) { + if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY > this.world.paperConfig.entityTNTHeightNerf) {

View File

@ -15,6 +15,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- Slot slot = (Slot) this.c.get(i); - Slot slot = (Slot) this.c.get(i);
+ Slot slot = i < this.c.size() ? this.c.get(i) : null; // Paper - Ensure drag in bounds + 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)) { itemstack1 = playerinventory.getCarried();
this.h.add(slot); if (slot != null && a(slot, itemstack1, true) && slot.isAllowed(itemstack1) && (this.dragType == 2 || itemstack1.getCount() > this.h.size()) && this.b(slot)) {
-- --

View File

@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end + // 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 diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
@ -122,11 +122,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingSand.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingSand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
@@ -0,0 +0,0 @@ public class CraftFallingSand extends CraftEntity implements FallingSand { @@ -0,0 +0,0 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock {
// Second field for EntityFallingBlock // Second field for EntityFallingBlock
getHandle().ticksLived = value; getHandle().ticksLived = value;
} }

View File

@ -33,10 +33,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java +++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -0,0 +0,0 @@ public class FoodMetaData { @@ -0,0 +0,0 @@ public class FoodMetaData {
if (this.foodTickTimer >= 10) { 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 / 6.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, true); // CraftBukkit - added RegainReason // Paper - This is fast regen
this.a(f); this.a(f);
this.foodTickTimer = 0; this.foodTickTimer = 0;
} }

View File

@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -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 + if (captureBlockStates) { return; } // Paper - Cancel all physics during placement
this.e(blockposition.west(), block); this.a(blockposition.west(), block, blockposition);
this.e(blockposition.east(), block); this.a(blockposition.east(), block, blockposition);
this.e(blockposition.down(), block); this.a(blockposition.down(), block, blockposition);
-- --

View File

@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class Chunk { @@ -0,0 +0,0 @@ public class Chunk {
private long w; private long w;
private int x; private int x;
private ConcurrentLinkedQueue<BlockPosition> y; private final ConcurrentLinkedQueue<BlockPosition> y;
- public boolean d; - 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<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot protected gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot

View File

@ -39,7 +39,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end + // Paper end
+ +
public void a_(World world, BlockPosition blockposition) {} 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 diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java

View File

@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.cookTime += elapsedTicks; this.cookTime += elapsedTicks;
if (this.cookTime >= this.cookTimeTotal) { if (this.cookTime >= this.cookTimeTotal) {
- this.cookTime = 0; - this.cookTime = 0;
+ this.cookTime -= this.a(this.items[0]); // Paper + this.cookTime -= this.a(this.items.get(0)); // Paper
this.cookTimeTotal = this.a(this.items[0]); this.cookTimeTotal = this.a((ItemStack) this.items.get(0));
this.burn(); this.burn();
flag1 = true; flag1 = true;
-- --

View File

@ -43,8 +43,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
+ boolean isLoadingStructure = false; // Paper + boolean isLoadingStructure = false; // Paper
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
private static final Map<String, Class<? extends TileEntity>> f = Maps.newHashMap(); private static final RegistryMaterials<MinecraftKey, Class<? extends TileEntity>> f = new RegistryMaterials();
private static final Map<Class<? extends TileEntity>, String> g = Maps.newHashMap(); protected World world;
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java --- a/src/main/java/net/minecraft/server/TileEntitySign.java

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/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 { @@ -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 PacketPlayOutAbilities(entityplayer.abilities));
playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); 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 + playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean("reducedDebugInfo") ? 22 : 23))); // Paper - fix this rule not being initialized on the client

View File

@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (i2 <= random.nextInt(5)) { - if (i2 <= random.nextInt(5)) {
+ if (i2 <= (world.paperConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock + if (i2 <= (world.paperConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock
chunksnapshot.a(l, i2, k, BiomeMesa.c); chunksnapshot.a(l, i2, k, BiomeMesa.c);
} else if (l1 < 15) { } else if (l1 < 15 || this.J) {
IBlockData iblockdata2 = chunksnapshot.a(l, i2, k); 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 diff --git a/src/main/java/net/minecraft/server/ChunkProviderFlat.java b/src/main/java/net/minecraft/server/ChunkProviderFlat.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -77,27 +77,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!map1.containsKey("size")) { if (!map1.containsKey("size")) {
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator { @@ -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")) {
+ if (map.containsKey("biome_1") && world.paperConfig.generateTemple) { // Paper + 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")) {
+ if (map.containsKey("mineshaft") && world.paperConfig.generateMineshaft) { // Paper + 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")) {
+ if (map.containsKey("stronghold") && world.paperConfig.generateStronghold) { // Paper + 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")) {
+ if (map.containsKey("oceanmonument") && world.paperConfig.generateMonument) { // Paper + 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 { @@ -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 +++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator { @@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
this.a(i, j, chunksnapshot); this.a(i, j, chunksnapshot);
this.C = this.n.getWorldChunkManager().getBiomeBlock(this.C, i * 16, j * 16, 16, 16); this.D = this.n.getWorldChunkManager().getBiomeBlock(this.D, i * 16, j * 16, 16, 16);
this.a(i, j, chunksnapshot, this.C); this.a(i, j, chunksnapshot, this.D);
- if (this.s.r) { - if (this.s.r) {
+ if (this.s.r && this.n.paperConfig.generateCaves) { // Paper + if (this.s.r && this.n.paperConfig.generateCaves) { // Paper
this.v.a(this.n, i, j, chunksnapshot); this.v.a(this.n, i, j, chunksnapshot);
} }
- if (this.s.z) { - if (this.s.A) {
+ if (this.s.z && this.n.paperConfig.generateCanyon) { // Paper + if (this.s.A && this.n.paperConfig.generateCanyon) { // Paper
this.A.a(this.n, i, j, chunksnapshot); this.A.a(this.n, i, j, chunksnapshot);
} }
@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper + if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, i, j, chunksnapshot); this.B.a(this.n, i, j, chunksnapshot);
} }
}
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator { @@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper + if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, this.i, chunkcoordintpair); this.B.a(this.n, this.i, chunkcoordintpair);
} }
}
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator { @@ -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 + if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, i, j, (ChunkSnapshot) null); 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 diff --git a/src/main/java/net/minecraft/server/ChunkProviderHell.java b/src/main/java/net/minecraft/server/ChunkProviderHell.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderHell.java --- 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 { @@ -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 + if (this.g == null) return false; // Paper
this.a(world); this.a(world);
Iterator iterator = this.c.values().iterator(); ObjectIterator objectiterator = this.c.values().iterator();
-- --

View File

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ import org.bukkit.inventory.MainHand; @@ -0,0 +0,0 @@ import org.bukkit.inventory.MainHand;
public class EntityPlayer extends EntityHuman implements ICrafting { 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 = "en_US"; // Spigot private -> public
+ public String locale = null; // Spigot private -> public // Paper - default to null + public String locale = null; // Spigot private -> public // Paper - default to null
public PlayerConnection playerConnection; public PlayerConnection playerConnection;
@ -30,9 +30,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent(); + new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent();
+ } + }
+ // Paper end + // Paper end
this.ch = packetplayinsettings.c(); this.cg = packetplayinsettings.c();
this.ci = packetplayinsettings.d(); this.ch = packetplayinsettings.d();
this.getDataWatcher().set(EntityPlayer.br, Byte.valueOf((byte) packetplayinsettings.e())); 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 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java

View File

@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
EntityItemFrame entityitemframe = (EntityItemFrame) this.tracker; EntityItemFrame entityitemframe = (EntityItemFrame) this.tracker;
ItemStack itemstack = entityitemframe.getItem(); 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 + if (itemstack != null && itemstack.getItem() instanceof ItemWorldMap) { // Paper - moved back up
WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, this.tracker.world); WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, this.tracker.world);
Iterator iterator = this.trackedPlayers.iterator(); // CraftBukkit Iterator iterator = this.trackedPlayers.iterator(); // CraftBukkit
@ -64,8 +64,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldMap.java --- a/src/main/java/net/minecraft/server/WorldMap.java
+++ b/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 { @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
public List<WorldMap.WorldMapHumanTracker> h = Lists.newArrayList(); public List<WorldMap.WorldMapHumanTracker> i = Lists.newArrayList();
public final Map<EntityHuman, WorldMap.WorldMapHumanTracker> j = Maps.newHashMap(); // Spigot public final Map<EntityHuman, WorldMap.WorldMapHumanTracker> k = Maps.newHashMap(); // Spigot private -> public
public Map<UUID, MapIcon> decorations = Maps.newLinkedHashMap(); // Spigot public Map<UUID, MapIcon> decorations = Maps.newLinkedHashMap(); // Spigot
+ private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper + 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 updateSeenPlayers(EntityHuman entityhuman, ItemStack itemstack) { a(entityhuman, itemstack); } // Paper - OBFHELPER
public void a(EntityHuman entityhuman, ItemStack itemstack) { 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); WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman);
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase { @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private boolean d = true; private boolean d = true;
private int e; private int e;
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase { @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
@Nullable
public Packet<?> a(ItemStack itemstack) { public Packet<?> a(ItemStack itemstack) {
// CraftBukkit start // CraftBukkit start
- org.bukkit.craftbukkit.map.RenderData render = WorldMap.this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) this.trackee.getBukkitEntity()); // CraftBukkit - org.bukkit.craftbukkit.map.RenderData render = WorldMap.this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) this.trackee.getBukkitEntity()); // CraftBukkit

View File

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/TileEntity.java --- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/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 { @@ -0,0 +0,0 @@ public abstract class TileEntity {
} return (MinecraftKey) TileEntity.f.b(oclass);
} }
+ static boolean IGNORE_TILE_UPDATES = false; // Paper + static boolean IGNORE_TILE_UPDATES = false; // Paper
@ -25,44 +25,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (IGNORE_TILE_UPDATES) return; // Paper + if (IGNORE_TILE_UPDATES) return; // Paper
IBlockData iblockdata = this.world.getType(this.position); 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 diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java --- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/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 @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
return true; boolean flag1 = iinventory1.w_();
}
}
+
return false;
} else {
return false;
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
boolean flag = false;
if (itemstack1 == null) { if (itemstack1.isEmpty()) {
+ IGNORE_TILE_UPDATES = true; // Paper + IGNORE_TILE_UPDATES = true; // Paper
iinventory.setItem(i, itemstack); iinventory1.setItem(i, itemstack);
+ IGNORE_TILE_UPDATES = false; // Paper + IGNORE_TILE_UPDATES = false; // Paper
itemstack = null; itemstack = ItemStack.a;
flag = true; flag = true;
} else if (a(itemstack1, itemstack)) { } else if (a(itemstack1, itemstack)) {
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
tileentityhopper.setCooldown(tileentityhopper.world.spigotConfig.hopperTransfer); // Spigot }
} }
- iinventory.update(); - iinventory1.update();
+ //iinventory.update(); // Paper + //iinventory1.update(); // Paper
}
} }
iinventory.update();
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
this.g = i; this.f = i;
} }
+ boolean isCooledDown() { return o(); } // Paper - OBFHELPER + boolean isCooledDown() { return J(); } // Paper - OBFHELPER
public boolean o() { private boolean J() {
return this.g > 0; return this.f > 0;
} }
-- --

View File

@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ long i = System.nanoTime(); long startTime = i; // Paper + long i = System.nanoTime(); long startTime = i; // Paper
++this.ticks; ++this.ticks;
if (this.S) { if (this.T) {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b(); this.methodProfiler.b();

View File

@ -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 {
+public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable, CraftLootableInventory { // Paper +public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable, CraftLootableInventory { // Paper
private ItemStack[] items = new ItemStack[27]; // CraftBukkit - 36 -> 27 private NonNullList<ItemStack> items;
private boolean b = true; private boolean b;
private MinecraftKey c; private MinecraftKey c;
- private long d; - private long d;
+ private long d;public long getLootTableSeed() { return d; } // Paper - OBFHELPER + private long d;public long getLootTableSeed() { return d; } // Paper - OBFHELPER
@ -457,22 +457,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
- } else { - } else {
+ } if (true) { // Paper - Always save the items, Table may stick around + } 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 @@ -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)) { if (nbttagcompound.hasKeyOfType("LootTable", 8)) {
this.c = new MinecraftKey(nbttagcompound.getString("LootTable")); this.c = new MinecraftKey(nbttagcompound.getString("LootTable"));
this.d = nbttagcompound.getLong("LootTableSeed"); this.d = nbttagcompound.getLong("LootTableSeed");
- } else { - } else {
+ } if (true) { // Paper - always load the items, table may still remain + } 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 @@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
} }
@ -487,7 +483,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.d == 0L) { if (this.d == 0L) {
@@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp @@ -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 + public void setLootTable(MinecraftKey key, long seed) { a(key, seed);} // Paper - OBFHELPER
@ -559,6 +555,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
protected MinecraftKey m; protected MinecraftKey m;
- protected long n; - protected long n;
+ protected long n; public long getLootTableSeed() { return n; } // Paper - OBFHELPER + protected long n; public long getLootTableSeed() { return n; } // Paper - OBFHELPER
protected String o;
public TileEntityLootable() {} 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 (this.m != null) {
+ if (lootableData.shouldReplenish(entityhuman)) { // Paper + if (lootableData.shouldReplenish(entityhuman)) { // Paper
LootTable loottable = this.world.ak().a(this.m); LootTable loottable = this.world.ak().a(this.m);
@ -612,7 +609,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void a(MinecraftKey minecraftkey, long i) { public void a(MinecraftKey minecraftkey, long i) {
this.m = minecraftkey; this.m = minecraftkey;
this.n = i; this.n = i;
@@ -0,0 +0,0 @@ public abstract class TileEntityLootable extends TileEntityContainer implements
} }
protected abstract NonNullList<ItemStack> q();
+ +
+ // Paper start - LootTable API + // Paper start - LootTable API
+ private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this); + private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this);
@ -650,6 +650,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.m = (MinecraftKey) null; + this.m = (MinecraftKey) null;
+ } + }
+ // Paper end + // Paper end
+
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -722,7 +723,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import net.minecraft.server.EntityMinecartChest; import net.minecraft.server.EntityMinecartChest;
import org.bukkit.craftbukkit.CraftServer; 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; import org.bukkit.inventory.Inventory;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")

View File

@ -54,8 +54,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- return (Entity) object; - return (Entity) object;
+ return (T) object; // Paper - fix decompile error + return (T) object; // Paper - fix decompile error
} else { } else {
throw new ExceptionEntityNotFound(); throw new ExceptionEntityNotFound(s);
} }
@@ -0,0 +0,0 @@ public abstract class CommandAbstract implements ICommand {
}
private static <T extends Comparable<T>> IBlockData a(IBlockData iblockdata, IBlockState<T> iblockstate, Comparable<?> comparable) {
- return iblockdata.set(iblockstate, comparable);
+ return iblockdata.set(iblockstate, (T) comparable); // Paper - fix decompiler error
}
public static Predicate<IBlockData> b(final Block block, String s) throws ExceptionInvalidBlockState {
@@ -0,0 +0,0 @@ public abstract class CommandAbstract implements ICommand {
@Nullable
private static <T extends Comparable<T>> T a(IBlockState<T> 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 { @@ -0,0 +0,0 @@ public abstract class CommandAbstract implements ICommand {
return this.getCommand().compareTo(icommand.getCommand()); return this.getCommand().compareTo(icommand.getCommand());
} }
@ -65,6 +83,66 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.a((ICommand) object); 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<Entity> 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 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
@ -79,5 +157,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
for (ZipEntry clazzEntry; (clazzEntry = nmsZipStream.getNextEntry()) != null; ) { for (ZipEntry clazzEntry; (clazzEntry = nmsZipStream.getNextEntry()) != null; ) {
final String entryName = clazzEntry.getName(); final String entryName = clazzEntry.getName();
-- --
2.7.4 (Apple Git-66)

View File

@ -99,8 +99,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
} }
+ public final boolean intersects(AxisAlignedBB intersecting) { return this.b(intersecting); } // Paper - OBFHELPER + public final boolean intersects(AxisAlignedBB intersecting) { return this.c(intersecting); } // Paper - OBFHELPER
public boolean b(AxisAlignedBB axisalignedbb) { public boolean c(AxisAlignedBB axisalignedbb) {
return this.a(axisalignedbb.a, axisalignedbb.b, axisalignedbb.c, axisalignedbb.d, axisalignedbb.e, axisalignedbb.f); 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 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 { +public class EntityItem extends Entity implements HopperPusher {
+ @Override + @Override
+ public boolean acceptItem(TileEntityHopper hopper) { + public boolean acceptItem(TileEntityHopper hopper) {
+ return TileEntityHopper.a(hopper, this); + return TileEntityHopper.putDropInInventory(null, hopper, this);
+ } + }
+// Paper end +// Paper end
private static final Logger b = LogManager.getLogger(); private static final Logger b = LogManager.getLogger();
private static final DataWatcherObject<Optional<ItemStack>> c = DataWatcher.a(EntityItem.class, DataWatcherRegistry.f); private static final DataWatcherObject<ItemStack> c = DataWatcher.a(EntityItem.class, DataWatcherRegistry.f);
@@ -0,0 +0,0 @@ public class EntityItem extends Entity { @@ -0,0 +0,0 @@ public class EntityItem extends Entity {
this.die(); this.die();
} else { } else {
super.m(); super.A_();
+ if (tryPutInHopper()) return; // Paper + if (tryPutInHopper()) return; // Paper
// CraftBukkit start - Use wall time for pickup and despawn timers // CraftBukkit start - Use wall time for pickup and despawn timers
int elapsedTicks = MinecraftServer.currentTick - this.lastTick; int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
@ -229,8 +229,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ @Override + @Override
+ public void m() { + public void A_() {
+ super.m(); + super.A_();
+ tryPutInHopper(); + tryPutInHopper();
+ } + }
+ +
@ -241,8 +241,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
private ItemStack[] items = new ItemStack[27]; // CraftBukkit - 36 -> 27 private NonNullList<ItemStack> items;
private boolean b = true; private boolean b;
diff --git a/src/main/java/net/minecraft/server/IHopper.java b/src/main/java/net/minecraft/server/IHopper.java diff --git a/src/main/java/net/minecraft/server/IHopper.java b/src/main/java/net/minecraft/server/IHopper.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/IHopper.java --- 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 @@ -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 + mayAcceptItems = false; // Paper - at the beginning of a tick, assume we can't accept items
if (this.world != null && !this.world.isClientSide) { if (this.world != null && !this.world.isClientSide) {
if (!this.o() && BlockHopper.f(this.u())) { if (!this.J() && BlockHopper.f(this.v())) {
boolean flag = false; boolean flag = false;
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
} }
@ -292,9 +292,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
+ +
private boolean q() { private boolean p() {
ItemStack[] aitemstack = this.items; Iterator iterator = this.items.iterator();
int i = aitemstack.length;
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
return true; return true;
} }
@ -323,9 +323,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityItem entityitem = (EntityItem) iterator.next(); 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 @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
private IInventory I() { 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()); - 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 + // Paper start - don't search for entities in push mode

View File

@ -1,22 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fabse <fabse@uwmc.info>
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());
}
--

View File

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/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 @@ -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 // CraftBukkit start - Use relative location for far away sounds
// this.world.a(1028, new BlockPosition(this), 0); // this.world.a(1028, new BlockPosition(this), 0);
- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; - int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;

View File

@ -12,10 +12,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
// CraftBukkit end // CraftBukkit end
-public class TileEntityChest extends TileEntityLootable implements ITickable, IInventory { -public class TileEntityChest extends TileEntityLootable implements ITickable {
+public class TileEntityChest extends TileEntityLootable implements IInventory { // Paper - Remove ITickable +public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITickable
private ItemStack[] items = new ItemStack[27]; private NonNullList<ItemStack> items;
public boolean a; public boolean a;
- public TileEntityChest f; - public TileEntityChest f;
- public TileEntityChest g; - public TileEntityChest g;
@ -30,19 +30,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public float k; public float k;
- public int l; - public int l;
+ public int l; // Paper - Number of viewers + public int l; // Paper - Number of viewers
private int p; private int q;
private BlockChest.Type q; private BlockChest.Type r;
private String r;
@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable implements ITickable, II @@ -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 + // Paper - Disable all of this, just in case this does get ticked
+ /* + /*
this.m(); this.o();
int i = this.position.getX(); int i = this.position.getX();
int j = this.position.getY(); 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; this.j = 0.0F;
} }
} }
@ -52,13 +52,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
public boolean c(int i, int j) { 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 int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
++this.l; ++this.l;
+ +
+ // Paper start - Move chest open sound out of the tick loop + // 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) { + if (this.l > 0 && this.j == 0.0F && this.f == null && this.h == null) {
+ this.j = 0.7F; + this.j = 0.7F;
@ -74,17 +74,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ d1 += 0.5D; + 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 + // Paper end
+ +
if (this.world == null) return; // CraftBukkit if (this.world == null) return; // CraftBukkit
this.world.playBlockAction(this.position, this.getBlock(), 1, this.l); 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 int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
--this.l; --this.l;
if (this.world == null) return; // CraftBukkit
+ +
+ // Paper start - Move chest close sound out of the tick loop + // 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) { + 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; + 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; + this.j = 0.0F;
+ } + }
+ // Paper end + // Paper end
+ +
this.world.playBlockAction(this.position, this.getBlock(), 1, this.l); 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 diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java --- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java
@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public TileEntityEnderChest() {} public TileEntityEnderChest() {}
public void E_() { public void F_() {
+ // Paper start - Disable all of this, just in case this does get ticked + // Paper start - Disable all of this, just in case this does get ticked
+ /* + /*
if (++this.h % 20 * 4 == 0) { if (++this.h % 20 * 4 == 0) {
@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class TileEntityEnderChest extends TileEntity implements ITickable { @@ -0,0 +0,0 @@ public class TileEntityEnderChest extends TileEntity implements ITickable {
public void d() { public void a() {
++this.g; ++this.g;
+ +
+ // Paper start - Move enderchest open sounds out of the tick loop + // 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 d1 = (double) this.getPosition().getX() + 0.5D;
+ double d0 = (double) this.getPosition().getZ() + 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 + // Paper end
+ +
@ -177,7 +177,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ double d0 = (double) this.getPosition().getX() + 0.5D; + double d0 = (double) this.getPosition().getX() + 0.5D;
+ double d2 = (double) this.getPosition().getZ() + 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; + this.a = 0.0F;
+ } + }
+ // Paper end + // Paper end

View File

@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot start // Spigot start
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
LOGGER.info("Saving usercache.json"); LOGGER.info("Saving usercache.json");
- this.X.c(); - this.Y.c();
+ this.X.c(false); // Paper + this.Y.c(false); // Paper
} }
// Spigot end // Spigot end
} }

View File

@ -1,26 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
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 {
--

View File

@ -241,8 +241,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
- if (!this.E(blockposition)) { - if (!this.E(blockposition)) {
+ if (!blockposition.isInvalidYLocation()) { // Paper + if (!blockposition.isInvalidYLocation()) {
if (tileentity != null && !tileentity.x()) { if (tileentity != null && !tileentity.y()) {
// CraftBukkit start // CraftBukkit start
if (captureBlockStates) { if (captureBlockStates) {
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {

View File

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
super.b(world, blockposition, iblockdata, random); super.b(world, blockposition, iblockdata, random);
- if (world.getLightLevel(blockposition.up()) >= 9) { - if (world.getLightLevel(blockposition.up()) >= 9) {
+ if (world.isLightLevel(blockposition.up(), 9)) { // Paper + if (world.isLightLevel(blockposition.up(), 9)) { // Paper
int i = this.x(iblockdata); int i = this.z(iblockdata);
if (i < this.g()) { if (i < this.g()) {
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java 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 --- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/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 { @@ -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; return false;
} else { } else {
- int i = this.world.getLightLevel(blockposition); - 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 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); 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)).r() && 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.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper
entityzombie.setPosition((double) i1, (double) j1, (double) k1); 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 this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
-- --

View File

@ -15,8 +15,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -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; + public boolean firePhysicsEventForRedstone = false;

View File

@ -31,12 +31,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
world.setAir(blockposition); world.setAir(blockposition);
+ // Paper start - Old TNT cannon behaviors + // Paper start - Old TNT cannon behaviors
+ if (world.paperConfig.oldCannonBehaviors) { + if (world.paperConfig.oldCannonBehaviors) {
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this); + world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this); + world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this); + world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this); + world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
+ return; + return;
+ } + }
+ // Paper end + // Paper end
@ -49,12 +49,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.d) { if (this.d) {
+ // Paper start - Old TNT cannon behaviors + // Paper start - Old TNT cannon behaviors
+ if (world.paperConfig.oldCannonBehaviors) { + if (world.paperConfig.oldCannonBehaviors) {
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this); + world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this); + world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this); + world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this); + world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
+ return; + return;
+ } + }
+ // Paper end + // Paper end
@ -97,12 +97,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Old TNT cannon behaviors + // Paper start - Old TNT cannon behaviors
+ private void shiftPositions(World world, BlockPosition blockposition) { + private void shiftPositions(World world, BlockPosition blockposition) {
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this); + world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this); + world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this); + world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this); + world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
+ } + }
+ // Paper end + // Paper end
+ +
@ -145,15 +145,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class BlockRedstoneWire extends Block { @@ -0,0 +0,0 @@ public class BlockRedstoneWire extends Block {
private void b(World world, BlockPosition blockposition) { private void b(World world, BlockPosition blockposition) {
if (world.getType(blockposition).getBlock() == this) { if (world.getType(blockposition).getBlock() == this) {
world.applyPhysics(blockposition, this); world.applyPhysics(blockposition, this, false);
+ // Paper start - Old TNT cannon behaviors
+ if (world.paperConfig.oldCannonBehaviors) { + if (world.paperConfig.oldCannonBehaviors) {
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this); + world.applyPhysics(blockposition.shift(EnumDirection.WEST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this); + world.applyPhysics(blockposition.shift(EnumDirection.EAST), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this); + world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this); + world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this, false);
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this); + world.applyPhysics(blockposition.shift(EnumDirection.UP), this, false);
+ return; + return;
+ } + }
+ // Paper end + // Paper end
@ -189,7 +188,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end + // Paper end
world.addEntity(entitytntprimed); 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 diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/DispenserRegistry.java --- 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 { @@ -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 + // Paper start - OBFHELPER
+ return this.getDistance(d0, d1, d2); + return this.getDistance(d0, d1, d2);
+ } + }
@ -240,13 +239,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { @@ -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 + // Paper start - OBFHELPER
+ this.addVelocity(d0, d1, d2); + this.addVelocity(d0, d1, d2);
+ } + }
+ +
+ public void addVelocity(double d0, double d1, double d2) { + public void addVelocity(double d0, double d1, double d2) {
+ // Paper end
this.motX += d0; this.motX += d0;
this.motY += d1; this.motY += d1;
this.motZ += d2; this.motZ += d2;

View File

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ <groupId>com.destroystokyo.paper</groupId> + <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper</artifactId> + <artifactId>paper</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.10.2-R0.1-SNAPSHOT</version> <version>1.11-R0.1-SNAPSHOT</version>
- <name>Spigot</name> - <name>Spigot</name>
- <url>http://www.spigotmc.org</url> - <url>http://www.spigotmc.org</url>
+ <name>Paper</name> + <name>Paper</name>
@ -26,9 +26,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
<minecraft_version>1_10_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix> <buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix> <buildtag.suffix></buildtag.suffix>
<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
- <maven.compiler.source>1.6</maven.compiler.source> - <maven.compiler.source>1.6</maven.compiler.source>
- <maven.compiler.target>1.6</maven.compiler.target> - <maven.compiler.target>1.6</maven.compiler.target>
+ <!--Paper - Bump to 1.8 - This will haunt me --> + <!--Paper - Bump to 1.8 - This will haunt me -->
@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
</executions> </executions>
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.6</version> <version>3.0.2</version>
<configuration> <configuration>
+ <forceCreation>true</forceCreation> <!-- Required to prevent shading the jar multiple times --> + <forceCreation>true</forceCreation> <!-- Required to prevent shading the jar multiple times -->
<archive> <archive>
@ -111,7 +111,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
<Implementation-Title>CraftBukkit</Implementation-Title> <Implementation-Title>CraftBukkit</Implementation-Title>
- <Implementation-Version>${spigot.desc}${craftbukkit.desc}</Implementation-Version> - <Implementation-Version>${spigot.desc}${craftbukkit.desc}</Implementation-Version>
+ <Implementation-Version>${describe}</Implementation-Version> + <Implementation-Version>${describe}</Implementation-Version>
<Implementation-Vendor>Bukkit Team</Implementation-Vendor> <Implementation-Vendor>${maven.build.timestamp}</Implementation-Vendor>
<Specification-Title>Bukkit</Specification-Title> <Specification-Title>Bukkit</Specification-Title>
<Specification-Version>${api.version}</Specification-Version> <Specification-Version>${api.version}</Specification-Version>
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
<plugin> <plugin>
- <groupId>org.codehaus.mojo</groupId> - <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId> - <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.14</version> - <version>1.15</version>
- <executions> - <executions>
- <execution> - <execution>
- <phase>process-classes</phase> - <phase>process-classes</phase>
@ -140,7 +140,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <plugin> - <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version> <version>2.4.3</version>
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>

View File

@ -30,5 +30,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private Village() { // Paper - Nothing should call this - world needs to be set. + private Village() { // Paper - Nothing should call this - world needs to be set.
this.c = BlockPosition.ZERO; this.c = BlockPosition.ZERO;
this.d = BlockPosition.ZERO; this.d = BlockPosition.ZERO;
this.j = new TreeMap(); this.j = Maps.newHashMap();
-- --

View File

@ -1,58 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com>
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) {
--

View File

@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> { @@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
public void b(PacketDataSerializer packetdataserializer) throws IOException { public void b(PacketDataSerializer packetdataserializer) throws IOException {
packetdataserializer.a((Enum) this.a); 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); - packetdataserializer.a(this.b);
+ // Paper start + // Paper start
+ if (this.components != null) { + if (this.components != null) {

View File

@ -8,86 +8,34 @@ diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java --- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/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 { @@ -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 EntityFishingHook hookedFish;
+ public boolean affectsSpawning = true; // Paper - AffectsSpawning API
+ // Paper start - affectsSpawning API
+ public boolean affectsSpawning = true;
+
+ public static Predicate<EntityHuman> affectsSpawningFilter() {
+ return new Predicate<EntityHuman>() {
+ @Override
+ public boolean apply(EntityHuman entityHuman) {
+ return entityHuman.affectsSpawning;
+ }
+ };
+ }
+ // Paper end
+
// CraftBukkit start // CraftBukkit start
public boolean fauxSleeping; public boolean fauxSleeping;
public String spawnWorld = ""; diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java --- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -0,0 +0,0 @@ public final class IEntitySelector {
if (this.persistent) { };
this.ticksFarFromPlayer = 0; public static final Predicate<Entity> e = new Predicate() {
} else { public boolean a(@Nullable Entity entity) {
- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); - return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator();
+ EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter + 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 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 boolean apply(@Nullable Object object) {
return this.a((Entity) object);
}
};
+ public static final Predicate<Entity> CAN_MOBS_TARGET = e; // Paper - OBFHELPER
public static <T extends Entity> Predicate<T> 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 diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java --- a/src/main/java/net/minecraft/server/SpawnerCreature.java
@ -96,93 +44,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next(); EntityHuman entityhuman = (EntityHuman) iterator.next();
+ if (!entityhuman.affectsSpawning) continue; // Paper - affectsSpawning check - if (!entityhuman.isSpectator()) {
+ + if (!entityhuman.isSpectator() && entityhuman.affectsSpawning) { // Paper - AffectsSpawning API
if (!entityhuman.isSpectator()) {
int l = MathHelper.floor(entityhuman.locX / 16.0D); int l = MathHelper.floor(entityhuman.locX / 16.0D);
@@ -0,0 +0,0 @@ public final class SpawnerCreature { j = MathHelper.floor(entityhuman.locZ / 16.0D);
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.<EntityHuman>alwaysTrue());
+ }
+
+ public EntityHuman findNearbyPlayer(Entity entity, double d0, Predicate<EntityHuman> 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.<EntityHuman>alwaysTrue());
+ }
+
+ public EntityHuman findNearbyPlayerNotInCreativeMode(Entity entity, double d0, Predicate<EntityHuman> 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.<EntityHuman>alwaysTrue());
+ }
+
+ public EntityHuman findNearbyPlayer(double d0, double d1, double d2, double d3, boolean flag, Predicate<EntityHuman> 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.<EntityHuman>alwaysTrue());
+ }
+
+ public boolean isPlayerNearby(double d0, double d1, double d2, double d3, Predicate<EntityHuman> 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);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java

View File

@ -12,11 +12,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
}); });
if (this.world != null) { 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 + // Paper start - Prevent TileEntity and Entity crashes
+ Block block = this.getBlock(); + Block block = this.getBlock();
+ if (block != null) { + if (block != null) {
+ CrashReportSystemDetails.a(crashreportsystemdetails, this.position, block, this.u()); + CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock(), this.v());
+ } + }
+ // Paper end + // Paper end
crashreportsystemdetails.a("Actual block type", new CrashReportCallable() { crashreportsystemdetails.a("Actual block type", new CrashReportCallable() {
@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
((ITickable) tileentity).E_(); ((ITickable) tileentity).F_();
this.methodProfiler.b(); this.methodProfiler.b();
} catch (Throwable throwable2) { } catch (Throwable throwable2) {
- crashreport1 = CrashReport.a(throwable2, "Ticking block entity"); - crashreport1 = CrashReport.a(throwable2, "Ticking block entity");

View File

@ -29,26 +29,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public ItemStack(Item item, int i, int j, boolean convert) { + public ItemStack(Item item, int i, int j, boolean convert) {
+ // Paper end + // Paper end
this.item = item; this.item = item;
this.damage = j;
this.count = i; this.count = i;
// CraftBukkit start - Pass to setData to do filtering
@@ -0,0 +0,0 @@ public final class ItemStack {
//if (this.damage < 0) {
// this.damage = 0;
//}
+ // Paper start + // Paper start
+ if (convert) convertData(); + if (convert) convertData(j);
+ } + }
+ public final void convertData() { +
+ public final void convertData(int data) {
+ // Paper end + // Paper end
if (MinecraftServer.getServer() != null) { if (MinecraftServer.getServer() != null) {
- this.setData(j);
+ this.setData(data);
NBTTagCompound savedStack = new NBTTagCompound(); NBTTagCompound savedStack = new NBTTagCompound();
this.save(savedStack); 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 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/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 { @@ -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()); - 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()) { if (original.hasItemMeta()) {
setItemMeta(stack, original.getItemMeta()); setItemMeta(stack, original.getItemMeta());
} }
+ stack.convertData(); // Paper + stack.convertData(original.getDurability()); // Paper
return stack; return stack;
} }

View File

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
byte[] abyte = s.getBytes(Charsets.UTF_8); byte[] abyte = s.getBytes(Charsets.UTF_8);
- if (abyte.length > 32767) { - 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 + 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 + throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 44767 + ")"); // Paper
} else { } else {

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk { @@ -0,0 +0,0 @@ public class Chunk {
tileentity.z(); tileentity.A();
this.tileEntities.put(blockposition, tileentity); this.tileEntities.put(blockposition, tileentity);
// CraftBukkit start // CraftBukkit start
+ // Paper start - Remove invalid mob spawner tile entities + // Paper start - Remove invalid mob spawner tile entities

View File

@ -1,32 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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);
--

View File

@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
// CraftBukkit end // CraftBukkit end
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
if (tileentity.x()) { if (tileentity.y()) {
tilesThisCycle--; tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--); this.tileEntityListTick.remove(tileTickPosition--);
- this.tileEntityList.remove(tileentity); - this.tileEntityList.remove(tileentity);

View File

@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */ + */
+ // Paper end + // 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) { if (world.isClientSide) {
diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -48,6 +48,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */ + */
+ // Paper end + // 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) { if (world.isClientSide) {
-- --

View File

@ -262,8 +262,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ @Override + @Override
+ @Nullable + @Nullable
+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition) { + public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, boolean flag) {
+ return timedGenerator.findNearestMapFeature(world, s, blockposition); + return timedGenerator.findNearestMapFeature(world, s, blockposition, flag);
+ } + }
+ +
+ @Override + @Override
@ -526,18 +526,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ world.timings.syncChunkLoadNBTTimer.startTiming(); // Spigot + world.timings.syncChunkLoadNBTTimer.startTiming(); // Spigot
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10); 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 { @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
a(nbttagcompound2, world, chunk);
chunk.g(true); chunk.g(true);
} }
}
- world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot
- world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot - world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot
NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10); 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 { @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
} chunk.a(tileentity);
} }
} }
- world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot
@ -546,7 +546,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (nbttagcompound.hasKeyOfType("TileTicks", 9)) { if (nbttagcompound.hasKeyOfType("TileTicks", 9)) {
NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10); NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10);
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -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 - world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot
@ -570,7 +570,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
} }
public void aL() { public void aM() {
- SpigotTimings.serverCommandTimer.startTiming(); // Spigot - SpigotTimings.serverCommandTimer.startTiming(); // Spigot
+ MinecraftTimings.serverCommandTimer.startTiming(); // Spigot + MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
while (!this.serverCommandQueue.isEmpty()) { while (!this.serverCommandQueue.isEmpty()) {
@ -611,10 +611,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { @@ -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 - org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
if (this.noclip) { if (this.noclip) {
this.a(this.getBoundingBox().c(d0, d1, d2)); this.a(this.getBoundingBox().d(d0, d1, d2));
this.recalcPosition(); this.recalcPosition();
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { @@ -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 { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
} }
public void m() { public void A_() {
- SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot - SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
super.m(); super.A_();
this.cz(); this.cA();
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
} }
@ -657,7 +657,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
float f = (float) (d0 * d0 + d1 * d1); float f = (float) (d0 * d0 + d1 * d1);
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
} else { } else {
this.bq = 0; this.bp = 0;
} }
- -
- SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot - SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
@ -669,9 +669,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world.methodProfiler.a("ai"); this.world.methodProfiler.a("ai");
- SpigotTimings.timerEntityAI.startTiming(); // Spigot - SpigotTimings.timerEntityAI.startTiming(); // Spigot
if (this.cj()) { if (this.isFrozen()) {
this.be = false; this.bd = false;
this.bf = 0.0F; this.be = 0.0F;
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.doTick(); this.doTick();
this.world.methodProfiler.b(); this.world.methodProfiler.b();
@ -681,16 +681,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world.methodProfiler.b(); this.world.methodProfiler.b();
this.world.methodProfiler.a("jump"); this.world.methodProfiler.a("jump");
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.bg *= 0.98F; this.bf *= 0.98F;
this.bh *= 0.9F; this.bg *= 0.9F;
this.r(); this.r();
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot - SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
this.g(this.bf, this.bg); this.g(this.be, this.bf);
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot - SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
this.world.methodProfiler.b(); this.world.methodProfiler.b();
this.world.methodProfiler.a("push"); this.world.methodProfiler.a("push");
- SpigotTimings.timerEntityAICollision.startTiming(); // Spigot - SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
this.cs(); this.ct();
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot - SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.methodProfiler.b(); this.world.methodProfiler.b();
} }
@ -847,7 +847,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.methodProfiler.c("connection"); this.methodProfiler.c("connection");
- SpigotTimings.connectionTimer.startTiming(); // Spigot - SpigotTimings.connectionTimer.startTiming(); // Spigot
+ MinecraftTimings.connectionTimer.startTiming(); // Spigot + MinecraftTimings.connectionTimer.startTiming(); // Spigot
this.am().c(); this.an().c();
- SpigotTimings.connectionTimer.stopTiming(); // Spigot - SpigotTimings.connectionTimer.stopTiming(); // Spigot
+ MinecraftTimings.connectionTimer.stopTiming(); // Spigot + MinecraftTimings.connectionTimer.stopTiming(); // Spigot
this.methodProfiler.c("players"); this.methodProfiler.c("players");
@ -861,7 +861,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- SpigotTimings.tickablesTimer.startTiming(); // Spigot - SpigotTimings.tickablesTimer.startTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.startTiming(); // Spigot + MinecraftTimings.tickablesTimer.startTiming(); // Spigot
for (i = 0; i < this.o.size(); ++i) { for (i = 0; i < this.o.size(); ++i) {
((ITickable) this.o.get(i)).E_(); ((ITickable) this.o.get(i)).F_();
} }
- SpigotTimings.tickablesTimer.stopTiming(); // Spigot - SpigotTimings.tickablesTimer.stopTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.stopTiming(); // Spigot + MinecraftTimings.tickablesTimer.stopTiming(); // Spigot
@ -1051,8 +1051,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import co.aikar.timings.Timing; +import co.aikar.timings.Timing;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import java.util.Iterator; import it.unimi.dsi.fastutil.objects.ObjectIterator;
@@ -0,0 +0,0 @@ import java.util.Random; @@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public abstract class StructureGenerator extends WorldGenBase { public abstract class StructureGenerator extends WorldGenBase {
@ -1100,8 +1100,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot - public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
+ public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper + public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
private static final Map<String, Class<? extends TileEntity>> f = Maps.newHashMap(); private static final RegistryMaterials<MinecraftKey, Class<? extends TileEntity>> f = new RegistryMaterials();
private static final Map<Class<? extends TileEntity>, String> g = Maps.newHashMap(); protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
@ -1193,7 +1193,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
entity.N = entity.locY; entity.N = entity.locY;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
entity.lastPitch = entity.pitch; entity.lastPitch = entity.pitch;
if (flag && entity.ab) { if (flag && entity.aa) {
++entity.ticksLived; ++entity.ticksLived;
+ ++co.aikar.timings.TimingHistory.activatedEntityTicks; // Paper + ++co.aikar.timings.TimingHistory.activatedEntityTicks; // Paper
if (entity.isPassenger()) { if (entity.isPassenger()) {
@ -1818,8 +1818,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
{ {
- SpigotTimings.checkIfActiveTimer.startTiming(); - SpigotTimings.checkIfActiveTimer.startTiming();
// Never safe to skip fireworks or entities not yet added to chunk // Never safe to skip fireworks or entities not yet added to chunk
// PAIL: inChunk // PAIL: inChunk - boolean under datawatchers
if ( !entity.ab || entity instanceof EntityFireworks ) { if ( !entity.aa || entity instanceof EntityFireworks ) {
- SpigotTimings.checkIfActiveTimer.stopTiming(); - SpigotTimings.checkIfActiveTimer.stopTiming();
return true; return true;
} }

View File

@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.motY = 0.30000001192092896D; this.motY = 0.30000001192092896D;
} }
} else if (this.cG()) { } else if (this.cH()) {
+ if (world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage + if (world.paperConfig.elytraHitWallDamage) { // Paper start - Toggleable Elytra Wall Damage
if (this.motY > -0.5D) { if (this.motY > -0.5D) {
this.fallDistance = 1.0F; this.fallDistance = 1.0F;

View File

@ -19,16 +19,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ allowLeashingUndeadHorse = getBoolean("allow-leashing-undead-horse", false); + 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java --- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
@@ -0,0 +0,0 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener, IJu @@ -0,0 +0,0 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
+ if (world.paperConfig.allowLeashingUndeadHorse) { return super.a(entityhuman); } // Paper - return super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD;
return !this.getType().h() && super.a(entityhuman); + return world.paperConfig.allowLeashingUndeadHorse ? super.a(entityhuman) : super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD; // Paper
} }
protected void q(float f) {
-- --

View File

@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.ax = 1; this.ax = 1;
- this.random = new Random(); - this.random = new Random();
+ this.random = SHARED_RANDOM; // Paper + this.random = SHARED_RANDOM; // Paper
this.maxFireTicks = 1; this.fireTicks = -this.getMaxFireTicks();
this.justCreated = true; this.justCreated = true;
this.uniqueID = MathHelper.a(this.random); this.uniqueID = MathHelper.a(this.random);
-- --

View File

@ -28,9 +28,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java --- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/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 { @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
movingobjectposition = new MovingObjectPosition(entity);
}
vec3d = new Vec3D(this.locX, this.locY, this.locZ);
vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
+
+ // Paper start - Allow fishing hooks to fly through vanished players the shooter can't see + // 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 (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && owner != null && owner instanceof EntityPlayer) {
+ if (!((EntityPlayer) owner).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) { + if (!((EntityPlayer) owner).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
@ -41,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
if (movingobjectposition != null) { if (movingobjectposition != null) {
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
if (movingobjectposition.entity != null) { 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 diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityProjectile.java --- 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 --- a/src/main/java/net/minecraft/server/ItemBlock.java
+++ b/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 { @@ -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)) { ItemStack itemstack = entityhuman.b(enumhand);
+ if (itemstack.count != 0 && entityhuman.a(blockposition, enumdirection, itemstack) && world.a(this.a, blockposition, false, enumdirection, entityhuman, itemstack)) { // Paper - Pass entityhuman instead of null
- 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()); int i = this.filterData(itemstack.getData());
IBlockData iblockdata1 = this.a.getPlacedState(world, blockposition, enumdirection, f, f1, f2, i, entityhuman); IBlockData iblockdata1 = this.a.getPlacedState(world, blockposition, enumdirection, f, f1, f2, i, entityhuman);

View File

@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/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 { @@ -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 + return this.mountEntity(entity, flag, false); // Paper - OBFHELPER
+ } + }
+ +

View File

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class EntityWaterAnimal extends EntityInsentient implements IAni @@ -0,0 +0,0 @@ public abstract class EntityWaterAnimal extends EntityInsentient implements IAni
} }
public boolean cK() { public boolean cM() {
- return true; - return true;
+ // Paper start - Don't let water mobs spawn in non-water blocks + // Paper start - Don't let water mobs spawn in non-water blocks
+ // Based around EntityAnimal's implementation + // Based around EntityAnimal's implementation

View File

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ SERVER = this; // Paper - better singleton + SERVER = this; // Paper - better singleton
io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable
this.e = proxy; this.e = proxy;
this.U = yggdrasilauthenticationservice; this.V = yggdrasilauthenticationservice;
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
// CraftBukkit start // CraftBukkit start
@Deprecated @Deprecated

View File

@ -61,6 +61,7 @@ import EULA
import EntitySquid import EntitySquid
import EntityWaterAnimal import EntityWaterAnimal
import FileIOThread import FileIOThread
import IEntitySelector
import IHopper import IHopper
import ItemBlock import ItemBlock
import ItemMonsterEgg import ItemMonsterEgg

@ -1 +1 @@
Subproject commit f37e6395d8f7d4865df27a4ab77e0c0d45de8fb9 Subproject commit 77931c01e72ff84c004a310b121a72b52f0efdd5

@ -1 +1 @@
Subproject commit 570e0e67528698b67770ea12e22c82d937fd3080 Subproject commit be7be5128d751e5c2f266b02f71b18404a0c37d7

@ -1 +1 @@
Subproject commit 51263e97187a84338f89698eef187284055a682a Subproject commit f15e07b1a9a4aedbcb77cb7776f168adcfebfa7e

@ -1 +1 @@
Subproject commit de459a282d9f494bbc5588b461b3e8eacd74f744 Subproject commit 16c940b0677cc9065df920e1113c80b5a047ca32