1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-17 02:34:30 +01:00

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
Spigot-API-Patches
Spigot-Server-Patches
Add-BeaconEffectEvent.patchAdd-EntityZapEvent.patchAdd-PlayerUseUnknownEntityEvent.patchAdd-World-Util-Methods.patchAdd-configurable-despawn-distances-for-living-entiti.patchAdd-exception-reporting-event.patchAdd-getEntity-by-UUID-API.patchAdd-hit-entity-to-ProjectileHitEvent.patchAdd-methods-for-working-with-arrows-stuck-in-living-.patchAll-chunks-are-slime-spawn-chunks-toggle.patchAllow-nerfed-mobs-to-jump.patchAvoid-hopper-searches-if-there-are-no-items.patchChange-implementation-of-tile-entity-removal-list.patchChunk-Save-Reattempt.patchChunk-registration-fixes.patchConfigurable-Keep-Spawn-Loaded-range-per-world.patchConfigurable-Non-Player-Arrow-Despawn-Rate.patchConfigurable-Player-Collision.patchConfigurable-baby-zombie-movement-speed.patchConfigurable-fishing-time-ranges.patchConfigurable-spawn-chances-for-skeleton-horses.patchConfigurable-squid-spawn-ranges.patchCustom-replacement-for-eaten-items.patchDisable-explosion-knockback.patchDisable-ticking-of-snow-blocks.patchDon-t-spam-reload-spawn-chunks-in-nether-end.patchDrop-falling-block-and-tnt-entities-at-the-specified.patchEnsure-inv-drag-is-in-bounds.patchEntity-Origin-API.patchEntityRegainHealthEvent-isFastRegen-API.patchFix-Cancelling-BlockPlaceEvent-triggering-physics.patchFix-Chunk-Unload-Queue-Issues.patchFix-FallingBlocks-being-stuck-on-fences.patchFix-Furnace-cook-time-bug.patchFix-Old-Sign-Conversion.patchFix-reducedDebugInfo-not-initialized-on-client.patchGenerator-Settings.patchImplement-PlayerLocaleChangeEvent.patchImprove-Maps-in-item-frames-performance-and-bug-fixe.patchImprove-Minecraft-Hopper-Performance.patchLighting-Queue.patchLootTable-API-Replenishable-Lootables-Feature.patchMC-Dev-fixes.patchMake-entities-look-for-hoppers.patchMinecart-drop-name-workaround.patchOnly-send-Dragon-Wither-Death-sounds-to-same-world.patchOptimize-TileEntity-Ticking.patchOptimize-UserCache-Thread-Safe.patchOptimize-draining.patchOptimize-isValidLocation-getType-and-getBlockData-fo.patchOptimized-Light-Level-Comparisons.patchOption-to-disable-BlockPhysicsEvent-for-Redstone.patchOptional-old-TNT-cannon-behaviors.patchPOM-Changes.patchPass-world-to-Village-creation.patchPlayer-Exhaustion-Multipliers.patchPlayer-Tab-List-and-Title-APIs.patchPlayer-affects-spawning-API.patchPrevent-tile-entity-and-entity-crashes.patchProcess-NMS-Data-Conversion-post-ItemMeta-on-Copy.patchRaise-string-limit-for-packet-serialization.patchRemove-invalid-mob-spawner-tile-entities.patchRemove-the-item-from-the-correct-hand-when-spawn-egg.patchRemove-unused-World-Tile-Entity-List.patchSPIGOT-1401-Fix-dispenser-dropper-furnace-placement.patchTimings-v2.patchToggleable-Elytra-Wall-Damage.patchUndead-horse-leashing.patchUse-a-Shared-Random-for-Entities.patchVanished-players-don-t-have-rights.patchVehicle-Event-Cancellation-Changes.patchWater-mobs-should-only-spawn-in-the-water.patchremove-null-possibility-for-getServer-singleton.patch
scripts
work

View file

@ -14,11 +14,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final RegainReason regainReason;
+ private final boolean isFastRegen; // Paper
@Deprecated
public EntityRegainHealthEvent(final Entity entity, final int amount, final RegainReason regainReason) {
@@ -0,0 +0,0 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
}
public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) {
+ // Paper start - Forward
+ this(entity, amount, regainReason, false);

View file

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>spigot-api</artifactId>
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId>
<version>1.10.2-R0.1-SNAPSHOT</version>
<version>1.11-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Spigot-API</name>
@ -101,7 +101,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.14</version>
- <version>1.15</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
@ -121,5 +121,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<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();
List list = getHumansInRange();
- applyEffect(list, this.l, i, b0);
+ applyEffect(list, this.l, i, b0, true); // Paper - BeaconEffectEvent
- applyEffect(list, this.primaryEffect, i, b0);
+ applyEffect(list, this.primaryEffect, i, b0, true); // Paper - BeaconEffectEvent
if (hasSecondaryEffect()) {
- applyEffect(list, this.m, i, 0);
+ applyEffect(list, this.m, i, 0, false); // Paper - BeaconEffectEvent
- applyEffect(list, this.secondaryEffect, i, 0);
+ applyEffect(list, this.secondaryEffect, i, 0, false); // Paper - BeaconEffectEvent
}
}

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

View file

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
@@ -0,0 +0,0 @@ import java.io.IOException;
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public class PacketPlayInUseEntity implements Packet<PacketListenerPlayIn> {

View file

@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.c(blockposition, true);
}
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
return this.worldProvider.n()[this.getLightLevel(blockposition)];
return this.worldProvider.o()[this.getLightLevel(blockposition)];
}
+ // Paper start - reduces need to do isLoaded before getType

View file

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

View file

@ -217,7 +217,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public class RegionFile {
this.b(i, j, (int) (MinecraftServer.av() / 1000L));
this.b(i, j, (int) (MinecraftServer.aw() / 1000L));
} catch (IOException ioexception) {
ioexception.printStackTrace();
+ ServerInternalException.reportInternalException(ioexception); // Paper
@ -284,7 +284,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.List;
import javax.annotation.Nullable;
@@ -0,0 +0,0 @@ public class VillageSiege {
entityzombie.setVillagerType(EnumZombieType.NORMAL);
entityzombie.prepare(this.a.D(new BlockPosition(entityzombie)), (GroupDataEntity) null);
} catch (Exception exception) {
exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.Y = 0L;
this.Z = 0L;
}
+ public Entity getEntity(UUID uuid) { return this.a(uuid); } // Paper - OBFHELPER

View file

@ -35,14 +35,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
// Paper end
// Paper end
if (movingobjectposition != null) {
- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Craftbukkit - Call event // Paper - Include entity in movingobjectposition
vec3d1 = new Vec3D(movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z);
}
if (movingobjectposition != null) {
- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Craftbukkit - Call event // Paper - Include entity in movingobjectposition
if (movingobjectposition.entity != null) {
this.hooked = movingobjectposition.entity;
this.getDataWatcher().set(EntityFishingHook.c, Integer.valueOf(this.hooked.getId() + 1));
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityProjectile.java

View file

@ -12,14 +12,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue();
}
+ public final int getStuckArrows() { return this.cb(); } // Paper - OBFHELPER
public final int cb() {
return ((Integer) this.datawatcher.get(EntityLiving.h)).intValue();
+ public final int getStuckArrows() { return this.cc(); } // Paper - OBFHELPER
public final int cc() {
return ((Integer) this.datawatcher.get(EntityLiving.bq)).intValue();
}
+ public final void setStuckArrows(int arrows) { this.f(arrows); } // Paper - OBFHELPER
public final void f(int i) {
this.datawatcher.set(EntityLiving.h, Integer.valueOf(i));
this.datawatcher.set(EntityLiving.bq, Integer.valueOf(i));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View file

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

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 900);
fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
}
+
@ -23,9 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
private boolean bE;
private boolean bD;
private Entity leashHolder;
private NBTTagCompound bG;
private NBTTagCompound bF;
+ private NBTTagCompound bG;
+ public PathfinderGoalFloat goalFloat; // Paper
public EntityInsentient(World world) {

View file

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

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

View file

@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile {
this.b(i, j, (int) (MinecraftServer.av() / 1000L));
this.b(i, j, (int) (MinecraftServer.aw() / 1000L));
} catch (IOException ioexception) {
- ioexception.printStackTrace();
- ServerInternalException.reportInternalException(ioexception); // Paper

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

View file

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

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

View file

@ -29,9 +29,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
- private static final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, 1);
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, 1); // Paper - Remove static - Make baby speed configurable
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Integer> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> bz = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Boolean> bw = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Integer> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
if (this.world != null && !this.world.isClientSide) {
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);

View file

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

View file

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

View file

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

View file

@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.bo.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.activeItem.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
this.a(this.cz(), itemstack);
// CraftBukkit end
+
+ // Paper start - save the default replacement item and change it if necessary
+ final ItemStack defaultReplacement = itemstack;
+ if (event.getReplacement() != null) {
@ -19,12 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
if (itemstack != null && itemstack.count == 0) {
itemstack = null;
}
this.a(this.cy(), itemstack);
this.cE();
this.cF();
+
+ // Paper start - if the replacement is anything but the default, update the client inventory
+ if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {

View file

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

View file

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

View file

@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.N;
}
+ public boolean shouldStayLoaded(int i, int j) { return d(i, j); } // Paper - OBFHELPER
public boolean d(int i, int j) {
+ public boolean shouldStayLoaded(int i, int j) { return e(i, j); } // Paper - OBFHELPER
public boolean e(int i, int j) {
BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX();
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
@ -21,12 +21,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldProvider.java
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
@@ -0,0 +0,0 @@ public abstract class WorldProvider {
public void s() {}
public void r() {}
- public boolean c(int i, int j) {
public boolean c(int i, int j) {
- return true;
+ public boolean c(int i, int j) { // Method is "can chunk unload"
+ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds
}
}

View file

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

View file

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

View file

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

View file

@ -33,10 +33,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -0,0 +0,0 @@ public class FoodMetaData {
if (this.foodTickTimer >= 10) {
float f = Math.min(this.saturationLevel, 4.0F);
float f = Math.min(this.saturationLevel, 6.0F);
- entityhuman.heal(f / 4.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
+ entityhuman.heal(f / 4.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen
- entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
+ entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen
this.a(f);
this.foodTickTimer = 0;
}

View file

@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
}
public void applyPhysics(BlockPosition blockposition, Block block) {
public void applyPhysics(BlockPosition blockposition, Block block, boolean flag) {
+ if (captureBlockStates) { return; } // Paper - Cancel all physics during placement
this.e(blockposition.west(), block);
this.e(blockposition.east(), block);
this.e(blockposition.down(), block);
this.a(blockposition.west(), block, blockposition);
this.a(blockposition.east(), block, blockposition);
this.a(blockposition.down(), block, blockposition);
--

View file

@ -15,9 +15,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class Chunk {
private long w;
private int x;
private ConcurrentLinkedQueue<BlockPosition> y;
private final ConcurrentLinkedQueue<BlockPosition> y;
- public boolean d;
+ public boolean d;public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER
+ public boolean d; public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER
protected gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot
// Paper start

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {
playerconnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities));
playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
+ playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean("reducedDebugInfo") ? 22 : 23))); // Paper - fix this rule not being initialized on the client

View file

@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (i2 <= random.nextInt(5)) {
+ if (i2 <= (world.paperConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock
chunksnapshot.a(l, i2, k, BiomeMesa.c);
} else if (l1 < 15) {
} else if (l1 < 15 || this.J) {
IBlockData iblockdata2 = chunksnapshot.a(l, i2, k);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderFlat.java b/src/main/java/net/minecraft/server/ChunkProviderFlat.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -77,27 +77,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!map1.containsKey("size")) {
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator {
this.e.add(new WorldGenVillage(map1));
this.e.put("Village", new WorldGenVillage(map1));
}
- if (map.containsKey("biome_1")) {
+ if (map.containsKey("biome_1") && world.paperConfig.generateTemple) { // Paper
this.e.add(new WorldGenLargeFeature((Map) map.get("biome_1")));
this.e.put("Temple", new WorldGenLargeFeature((Map) map.get("biome_1")));
}
- if (map.containsKey("mineshaft")) {
+ if (map.containsKey("mineshaft") && world.paperConfig.generateMineshaft) { // Paper
this.e.add(new WorldGenMineshaft((Map) map.get("mineshaft")));
this.e.put("Mineshaft", new WorldGenMineshaft((Map) map.get("mineshaft")));
}
- if (map.containsKey("stronghold")) {
+ if (map.containsKey("stronghold") && world.paperConfig.generateStronghold) { // Paper
this.e.add(new WorldGenStronghold((Map) map.get("stronghold")));
this.e.put("Stronghold", new WorldGenStronghold((Map) map.get("stronghold")));
}
- if (map.containsKey("oceanmonument")) {
+ if (map.containsKey("oceanmonument") && world.paperConfig.generateMonument) { // Paper
this.e.add(new WorldGenMonument((Map) map.get("oceanmonument")));
this.e.put("Monument", new WorldGenMonument((Map) map.get("oceanmonument")));
}
}
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator {
@ -115,15 +115,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
this.a(i, j, chunksnapshot);
this.C = this.n.getWorldChunkManager().getBiomeBlock(this.C, i * 16, j * 16, 16, 16);
this.a(i, j, chunksnapshot, this.C);
this.D = this.n.getWorldChunkManager().getBiomeBlock(this.D, i * 16, j * 16, 16, 16);
this.a(i, j, chunksnapshot, this.D);
- if (this.s.r) {
+ if (this.s.r && this.n.paperConfig.generateCaves) { // Paper
this.v.a(this.n, i, j, chunksnapshot);
}
- if (this.s.z) {
+ if (this.s.z && this.n.paperConfig.generateCanyon) { // Paper
- if (this.s.A) {
+ if (this.s.A && this.n.paperConfig.generateCanyon) { // Paper
this.A.a(this.n, i, j, chunksnapshot);
}
@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, i, j, chunksnapshot);
}
}
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, this.i, chunkcoordintpair);
}
}
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
}
}
@ -219,7 +219,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
this.B.a(this.n, i, j, (ChunkSnapshot) null);
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderHell.java b/src/main/java/net/minecraft/server/ChunkProviderHell.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderHell.java
@ -259,9 +259,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class StructureGenerator extends WorldGenBase {
}
public synchronized boolean b(World world, BlockPosition blockposition) { // CraftBukkit - synchronized
public boolean a(World world, BlockPosition blockposition) {
+ if (this.g == null) return false; // Paper
this.a(world);
Iterator iterator = this.c.values().iterator();
ObjectIterator objectiterator = this.c.values().iterator();
--

View file

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

View file

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

View file

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

View file

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

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

View file

@ -54,8 +54,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- return (Entity) object;
+ return (T) object; // Paper - fix decompile error
} else {
throw new ExceptionEntityNotFound();
throw new ExceptionEntityNotFound(s);
}
@@ -0,0 +0,0 @@ public abstract class CommandAbstract implements ICommand {
}
private static <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 {
return this.getCommand().compareTo(icommand.getCommand());
}
@ -65,6 +83,66 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.a((ICommand) object);
}
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -0,0 +0,0 @@ public final class IEntitySelector {
}
public boolean apply(@Nullable Object object) {
- return this.a((Entity) object);
+ return this.a((T) object); // Paper - Fix decompile error
}
};
}
@@ -0,0 +0,0 @@ public final class IEntitySelector {
final ScoreboardTeamBase.EnumTeamPush scoreboardteambase_enumteampush = scoreboardteambase == null ? ScoreboardTeamBase.EnumTeamPush.ALWAYS : scoreboardteambase.getCollisionRule();
return scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER ? Predicates.alwaysFalse() : Predicates.and(IEntitySelector.e, new Predicate() {
- public boolean a(@Nullable Entity entity) {
+ public boolean a(@Nullable Entity entity1) { // Paper - fix decompile error
if (!entity.isCollidable()) {
return false;
} else if (entity1.world.isClientSide && (!(entity instanceof EntityHuman) || !((EntityHuman) entity).cR())) {
@@ -0,0 +0,0 @@ public final class IEntitySelector {
if (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER) {
return false;
} else {
- boolean flag = scoreboardteambase1 != null && scoreboardteambase1.isAlly(scoreboardteambase);
+ boolean flag = scoreboardteambase != null && scoreboardteambase.isAlly(scoreboardteambase); // Paper - fix decompile error
- return (scoreboardteambase_enumteampush1 == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM || scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM) && flag ? false : scoreboardteambase_enumteampush1 != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS && scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS || flag;
+ // Paper - fix decompiler error
+ return (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM || scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM) && flag ? false : scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS && scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS || flag;
}
}
}
@@ -0,0 +0,0 @@ public final class IEntitySelector {
public static Predicate<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
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
@ -78,6 +156,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
final Collection<String> names = new HashSet<String>();
for (ZipEntry clazzEntry; (clazzEntry = nmsZipStream.getNextEntry()) != null; ) {
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 boolean b(AxisAlignedBB axisalignedbb) {
+ public final boolean intersects(AxisAlignedBB intersecting) { return this.c(intersecting); } // Paper - OBFHELPER
public boolean c(AxisAlignedBB axisalignedbb) {
return this.a(axisalignedbb.a, axisalignedbb.b, axisalignedbb.c, axisalignedbb.d, axisalignedbb.e, axisalignedbb.f);
}
diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java
@ -182,16 +182,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+public class EntityItem extends Entity implements HopperPusher {
+ @Override
+ public boolean acceptItem(TileEntityHopper hopper) {
+ return TileEntityHopper.a(hopper, this);
+ return TileEntityHopper.putDropInInventory(null, hopper, this);
+ }
+// Paper end
private static final Logger b = LogManager.getLogger();
private static final DataWatcherObject<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 {
this.die();
} else {
super.m();
super.A_();
+ if (tryPutInHopper()) return; // Paper
// CraftBukkit start - Use wall time for pickup and despawn timers
int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
@ -229,8 +229,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public void m() {
+ super.m();
+ public void A_() {
+ super.A_();
+ tryPutInHopper();
+ }
+
@ -241,8 +241,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
private ItemStack[] items = new ItemStack[27]; // CraftBukkit - 36 -> 27
private boolean b = true;
private NonNullList<ItemStack> items;
private boolean b;
diff --git a/src/main/java/net/minecraft/server/IHopper.java b/src/main/java/net/minecraft/server/IHopper.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/IHopper.java
@ -267,10 +267,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
}
public boolean m() {
private boolean o() {
+ mayAcceptItems = false; // Paper - at the beginning of a tick, assume we can't accept items
if (this.world != null && !this.world.isClientSide) {
if (!this.o() && BlockHopper.f(this.u())) {
if (!this.J() && BlockHopper.f(this.v())) {
boolean flag = false;
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
}
@ -292,9 +292,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
private boolean q() {
ItemStack[] aitemstack = this.items;
int i = aitemstack.length;
private boolean p() {
Iterator iterator = this.items.iterator();
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
return true;
}
@ -323,9 +323,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) {
EntityItem entityitem = (EntityItem) iterator.next();
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
return false;
}
+ public static boolean putDropInInventory(IInventory iinventory, IInventory iinventory1, EntityItem entityitem) { return a(iinventory, iinventory1, entityitem); } // Paper - OBFHELPER
public static boolean a(IInventory iinventory, IInventory iinventory1, EntityItem entityitem) {
boolean flag = false;
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
private IInventory I() {
EnumDirection enumdirection = BlockHopper.e(this.u());
EnumDirection enumdirection = BlockHopper.e(this.v());
- return b(this.getWorld(), this.E() + (double) enumdirection.getAdjacentX(), this.F() + (double) enumdirection.getAdjacentY(), this.G() + (double) enumdirection.getAdjacentZ());
+ // Paper start - don't search for entities in push mode

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
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
if (this.bH == 1) {
if (this.bG == 1) {
// CraftBukkit start - Use relative location for far away sounds
// this.world.a(1028, new BlockPosition(this), 0);
- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;

View file

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

View file

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

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) {
- if (!this.E(blockposition)) {
+ if (!blockposition.isInvalidYLocation()) { // Paper
if (tileentity != null && !tileentity.x()) {
+ if (!blockposition.isInvalidYLocation()) {
if (tileentity != null && !tileentity.y()) {
// CraftBukkit start
if (captureBlockStates) {
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {

View file

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
super.b(world, blockposition, iblockdata, random);
- if (world.getLightLevel(blockposition.up()) >= 9) {
+ if (world.isLightLevel(blockposition.up(), 9)) { // Paper
int i = this.x(iblockdata);
int i = this.z(iblockdata);
if (i < this.g()) {
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
@@ -0,0 +0,0 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
if (this.world.b(EnumSkyBlock.SKY, blockposition) > this.random.nextInt(32)) {
if (this.world.getBrightness(EnumSkyBlock.SKY, blockposition) > this.random.nextInt(32)) {
return false;
} else {
- int i = this.world.getLightLevel(blockposition);
@ -125,9 +125,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
int j1 = j + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1);
int k1 = k + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1);
- if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
+ if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && !this.world.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper
- if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).r() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
+ if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).r() && !this.world.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper
entityzombie.setPosition((double) i1, (double) j1, (double) k1);
if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D, EntityHuman.affectsSpawningFilter()) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { // Paper - affectsSpawning filter
if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
--

View file

@ -15,8 +15,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
skeleHorseSpawnChance = 0.05D; // Vanilla
}
private void skeleHorseSpawnChance() {
skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state
}
+
+ public boolean firePhysicsEventForRedstone = false;

View file

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

View file

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

View file

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

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> {
public void b(PacketDataSerializer packetdataserializer) throws IOException {
packetdataserializer.a((Enum) this.a);
if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE) {
if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE || this.a == PacketPlayOutTitle.EnumTitleAction.ACTIONBAR) {
- packetdataserializer.a(this.b);
+ // Paper start
+ if (this.components != null) {

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
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@
package net.minecraft.server;
import com.google.common.base.Charsets;
+import com.google.common.base.Predicate; // Paper
import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile;
import java.util.Arrays;
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
private final ItemCooldown bW = this.l();
private final ItemCooldown bV;
@Nullable
public EntityFishingHook hookedFish;
+ public boolean affectsSpawning = true; // Paper - AffectsSpawning API
+ // Paper start - affectsSpawning API
+ public boolean affectsSpawning = true;
+
+ public static Predicate<EntityHuman> affectsSpawningFilter() {
+ return new Predicate<EntityHuman>() {
+ @Override
+ public boolean apply(EntityHuman entityHuman) {
+ return entityHuman.affectsSpawning;
+ }
+ };
+ }
+ // Paper end
+
// CraftBukkit start
public boolean fauxSleeping;
public String spawnWorld = "";
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
if (this.persistent) {
this.ticksFarFromPlayer = 0;
} else {
- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
+ EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -0,0 +0,0 @@ public final class IEntitySelector {
};
public static final Predicate<Entity> e = new Predicate() {
public boolean a(@Nullable Entity entity) {
- return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator();
+ return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator() || !((EntityHuman) entity).affectsSpawning; // Paper - Affects Spawning API
}
if (entityhuman != null) {
double d0 = entityhuman.locX - this.locX;
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntitySilverfish.java
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
@@ -0,0 +0,0 @@ public class EntitySilverfish extends EntityMonster {
public boolean apply(@Nullable Object object) {
return this.a((Entity) object);
}
};
+ public static final Predicate<Entity> CAN_MOBS_TARGET = e; // Paper - OBFHELPER
public boolean cK() {
if (super.cK()) {
- EntityHuman entityhuman = this.world.b(this, 5.0D);
+ EntityHuman entityhuman = this.world.findNearbyPlayerNotInCreativeMode(this, 5.0D, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
return entityhuman == null;
} else {
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
entityzombie.setPosition((double) i1, (double) j1, (double) k1);
- if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
+ if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D, EntityHuman.affectsSpawningFilter()) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { // Paper - affectsSpawning filter
this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
entityzombie.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true);
entityzombie.prepare(this.world.D(new BlockPosition(entityzombie)), (GroupDataEntity) null);
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
private boolean h() {
BlockPosition blockposition = this.b();
- return this.a().isPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange);
+ return this.a().isPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
}
public void c() {
public static <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
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
@ -96,93 +44,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next();
+ if (!entityhuman.affectsSpawning) continue; // Paper - affectsSpawning check
+
if (!entityhuman.isSpectator()) {
- if (!entityhuman.isSpectator()) {
+ if (!entityhuman.isSpectator() && entityhuman.affectsSpawning) { // Paper - AffectsSpawning API
int l = MathHelper.floor(entityhuman.locX / 16.0D);
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
float f = (float) j3 + 0.5F;
float f1 = (float) l3 + 0.5F;
- if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) {
+ if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D, EntityHuman.affectsSpawningFilter()) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) { // Paper - affectsSpawning filter
if (biomebase_biomemeta == null) {
biomebase_biomemeta = worldserver.a(enumcreaturetype, (BlockPosition) blockposition_mutableblockposition);
if (biomebase_biomemeta == null) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
+import com.google.common.base.Predicates; // Paper
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Calendar;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
@Nullable
public EntityHuman findNearbyPlayer(Entity entity, double d0) {
- return this.a(entity.locX, entity.locY, entity.locZ, d0, false);
+ // Paper start - Add filter parameter
+ return findNearbyPlayer(entity, d0, Predicates.<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);
j = MathHelper.floor(entityhuman.locZ / 16.0D);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java

View file

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

View file

@ -29,26 +29,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public ItemStack(Item item, int i, int j, boolean convert) {
+ // Paper end
this.item = item;
this.damage = j;
this.count = i;
@@ -0,0 +0,0 @@ public final class ItemStack {
//if (this.damage < 0) {
// this.damage = 0;
//}
// CraftBukkit start - Pass to setData to do filtering
+ // Paper start
+ if (convert) convertData();
+ if (convert) convertData(j);
+ }
+ public final void convertData() {
+
+ public final void convertData(int data) {
+ // Paper end
if (MinecraftServer.getServer() != null) {
- this.setData(j);
+ this.setData(data);
NBTTagCompound savedStack = new NBTTagCompound();
this.save(savedStack);
MinecraftServer.getServer().getDataConverterManager().a(DataConverterTypes.ITEM_INSTANCE, savedStack); // PAIL: convert
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack {
return null;
return net.minecraft.server.ItemStack.a;
}
- net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability());
@ -56,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (original.hasItemMeta()) {
setItemMeta(stack, original.getItemMeta());
}
+ stack.convertData(); // Paper
+ stack.convertData(original.getDurability()); // Paper
return stack;
}

View file

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
byte[] abyte = s.getBytes(Charsets.UTF_8);
- if (abyte.length > 32767) {
- throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 32767 + ")");
- throw new EncoderException("String too big (was " + abyte.length + " bytes encoded, max " + 32767 + ")");
+ if (abyte.length > 44767) { // Paper - raise limit a bit more as normal means can trigger this
+ throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 44767 + ")"); // Paper
} else {

View file

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

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
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
if (tileentity.x()) {
if (tileentity.y()) {
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
- this.tileEntityList.remove(tileentity);

View file

@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ // Paper end
public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) {
public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
if (world.isClientSide) {
diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -48,6 +48,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ // Paper end
public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) {
public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
if (world.isClientSide) {
--

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
}
}
}
public boolean a(Entity entity, boolean flag) {
+ return this.mountEntity(entity, flag, false); // Paper - OBFHELPER
+ }
+

View file

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

View file

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

View file

@ -61,6 +61,7 @@ import EULA
import EntitySquid
import EntityWaterAnimal
import FileIOThread
import IEntitySelector
import IHopper
import ItemBlock
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