mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Current progress - Leaf, tag your it
This commit is contained in:
parent
175f83e9d0
commit
5287c1ba7c
29 changed files with 585 additions and 665 deletions
|
@ -63,7 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
protected abstract void a(NBTTagCompound nbttagcompound);
|
||||
protected abstract void loadData(NBTTagCompound nbttagcompound);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
|
@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
+ public boolean isPersistable() { return a(); } // Paper - OBFHELPER
|
||||
public boolean a() {
|
||||
return this.bc;
|
||||
return this.bh;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
|
||||
new file mode 100644
|
||||
|
|
|
@ -34,16 +34,19 @@ 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 {
|
||||
if (entityhuman != null) {
|
||||
double d0 = entityhuman.h(this);
|
||||
int i = this.getEntityType().e().f();
|
||||
int j = i * i;
|
||||
|
||||
- if (d0 > 16384.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
+ if (d0 > world.paperConfig.hardDespawnDistance) { // CraftBukkit - remove isTypeNotPersistent() check // Paper - custom despawn distances
|
||||
- if (d0 > (double) j) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
+ if (d0 > (double) world.paperConfig.hardDespawnDistance) { // CraftBukkit - remove isTypeNotPersistent() check // Paper - custom despawn distances
|
||||
this.die();
|
||||
}
|
||||
|
||||
- if (this.ticksFarFromPlayer > 600 && this.random.nextInt(800) == 0 && d0 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
int k = this.getEntityType().e().g();
|
||||
int l = k * k;
|
||||
|
||||
- if (this.ticksFarFromPlayer > 600 && this.random.nextInt(800) == 0 && d0 > (double) l) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
+ if (this.ticksFarFromPlayer > 600 && this.random.nextInt(800) == 0 && d0 > world.paperConfig.softDespawnDistance) { // CraftBukkit - remove isTypeNotPersistent() check // Paper - custom despawn distances
|
||||
this.die();
|
||||
} else if (d0 < 1024.0D) {
|
||||
} else if (d0 < (double) l) {
|
||||
this.ticksFarFromPlayer = 0;
|
||||
|
|
|
@ -202,4 +202,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
// Paper end
|
||||
|
||||
this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
|
||||
this.setPVP(dedicatedserverproperties.pvp);
|
||||
|
|
|
@ -23,11 +23,11 @@ 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 {
|
||||
}
|
||||
}
|
||||
|
||||
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition);
|
||||
- boolean flag = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), generatoraccess.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot
|
||||
+ boolean flag = generatoraccess.getMinecraftWorld().paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), generatoraccess.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
|
||||
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition);
|
||||
- boolean flag = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, ((GeneratorAccessSeed) generatoraccess).getSeed(), generatoraccess.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot
|
||||
+ boolean flag = generatoraccess.getMinecraftWorld().paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, ((GeneratorAccessSeed) generatoraccess).getSeed(), generatoraccess.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
|
||||
|
||||
if (random.nextInt(10) == 0 && flag && blockposition.getY() < 40) {
|
||||
return a(entitytypes, generatoraccess, enummobspawn, blockposition, random);
|
||||
if (random.nextInt(10) == 0 && flag && blockposition.getY() < 40) {
|
||||
return a(entitytypes, generatoraccess, enummobspawn, blockposition, random);
|
||||
|
|
|
@ -38,23 +38,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return this.isInWater() || this.isInRain();
|
||||
}
|
||||
|
||||
+ public boolean isInWaterOrRainOrBubble() { return ay(); } // Paper - OBFHELPER
|
||||
public boolean ay() {
|
||||
return this.isInWater() || this.isInRain() || this.l();
|
||||
+ public boolean isInWaterOrRainOrBubble() { return aC(); } // Paper - OBFHELPER
|
||||
public boolean aC() {
|
||||
return this.isInWater() || this.isInRain() || this.k();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
if (this.ay()) {
|
||||
- this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
+ this.damageEntity(DamageSource.DROWN, 1.0F); // Paper - copied in patch 13 (allow nerfed mobs to jump, float and take water damage)
|
||||
}
|
||||
|
||||
if (this.world.isDay() && this.ticksLived >= this.bA + 600) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
|
@ -66,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ @Nullable public PathfinderGoalFloat goalFloat; // Paper
|
||||
public PathfinderGoalSelector targetSelector;
|
||||
private EntityLiving goalTarget;
|
||||
private final EntitySenses bw;
|
||||
private final EntitySenses bv;
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@Override
|
||||
protected final void doTick() {
|
||||
|
@ -84,7 +71,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end
|
||||
this.world.getMethodProfiler().enter("sensing");
|
||||
this.bw.a();
|
||||
this.bv.a();
|
||||
this.world.getMethodProfiler().exit();
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -102,9 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER
|
||||
@Override
|
||||
public boolean a() {
|
||||
double d0 = (double) this.a.getHeadHeight() < 0.4D ? 0.2D : 0.4D;
|
||||
@@ -0,0 +0,0 @@ public class PathfinderGoalFloat extends PathfinderGoal {
|
||||
return this.a.isInWater() && this.a.co() > d0 || this.a.aH();
|
||||
return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aN();
|
||||
}
|
||||
|
||||
+ public void update() { this.e(); } // Paper - OBFHELPER
|
||||
|
|
|
@ -194,13 +194,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public boolean complete(boolean textures, boolean onlineMode) {
|
||||
+ MinecraftServer server = MinecraftServer.getServer();
|
||||
+
|
||||
+ boolean isCompleteFromCache = this.completeFromCache(false, onlineMode);
|
||||
+ boolean isCompleteFromCache = this.completeFromCache(true, onlineMode);
|
||||
+ if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) {
|
||||
+ GameProfile result = server.getSessionService().fillProfileProperties(profile, true);
|
||||
+ if (result != null) {
|
||||
+ copyProfileProperties(result, this.profile, true);
|
||||
+ }
|
||||
+ server.getUserCache().saveProfile(this.profile);
|
||||
+ if (this.profile.isComplete()) {
|
||||
+ server.getUserCache().saveProfile(this.profile);
|
||||
+ }
|
||||
+ }
|
||||
+ return profile.isComplete() && (!onlineMode || !textures || hasTextures());
|
||||
+ }
|
||||
|
|
|
@ -16,5 +16,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- protected final List<TileEntity> tileEntityListUnload = Lists.newArrayList();
|
||||
+ protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet();
|
||||
public final Thread serverThread;
|
||||
private int c;
|
||||
protected int i = (new Random()).nextInt();
|
||||
private final boolean debugWorld;
|
||||
private int d;
|
||||
|
|
|
@ -8,12 +8,12 @@ diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
@@ -0,0 +0,0 @@ public class WorldNBTStorage implements IPlayerFileData {
|
||||
@@ -0,0 +0,0 @@ public class WorldNBTStorage {
|
||||
File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat");
|
||||
// Spigot Start
|
||||
boolean usingWrongFile = false;
|
||||
- if ( !file.exists() )
|
||||
+ if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
|
||||
{
|
||||
file = new File( this.playerDir, UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||
if ( file.exists() )
|
||||
|
|
|
@ -28,24 +28,24 @@ diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/jav
|
|||
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 {
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityTransformEvent;
|
||||
public class EntityZombie extends EntityMonster {
|
||||
|
||||
protected static final IAttribute d = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
|
||||
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, AttributeModifier.Operation.MULTIPLY_BASE);
|
||||
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementModifier, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.c; // Paper - remove static - Make baby speed configurable
|
||||
private static final DataWatcherObject<Boolean> bw = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
|
||||
private static final DataWatcherObject<Integer> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
|
||||
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.c; // Paper - remove static - Make baby speed configurable
|
||||
private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
|
||||
private static final DataWatcherObject<Integer> bv = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
|
||||
public static final DataWatcherObject<Boolean> DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
|
||||
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
|
||||
if (this.world != null && !this.world.isClientSide) {
|
||||
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
|
||||
- attributeinstance.removeModifier(EntityZombie.c);
|
||||
+ attributeinstance.removeModifier(this.babyModifier); // Paper
|
||||
- attributemodifiable.removeModifier(EntityZombie.c);
|
||||
+ attributemodifiable.removeModifier(this.babyModifier); // Paper
|
||||
if (flag) {
|
||||
- attributeinstance.addModifier(EntityZombie.c);
|
||||
+ attributeinstance.addModifier(this.babyModifier); // Paper
|
||||
- attributemodifiable.b(EntityZombie.c);
|
||||
+ attributemodifiable.b(this.babyModifier); // Paper
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,14 +27,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
@@ -0,0 +0,0 @@ public class BlockCactus extends Block {
|
||||
;
|
||||
}
|
||||
;
|
||||
}
|
||||
|
||||
- if (i < 3) {
|
||||
- if (i < 3) {
|
||||
+ if (i < worldserver.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height
|
||||
int j = (Integer) iblockdata.get(BlockCactus.AGE);
|
||||
int j = (Integer) iblockdata.get(BlockCactus.AGE);
|
||||
|
||||
if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
|
||||
if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockReed.java
|
||||
|
|
|
@ -24,19 +24,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
private long cj = SystemUtils.getMonotonicMillis();
|
||||
private long ch = SystemUtils.getMonotonicMillis();
|
||||
private Entity spectatedEntity;
|
||||
public boolean worldChangeInvuln;
|
||||
- private boolean cm;
|
||||
+ private boolean cm; private void setHasSeenCredits(boolean has) { this.cm = has; } // Paper - OBFHELPER
|
||||
private final RecipeBookServer recipeBook;
|
||||
private Vec3D co;
|
||||
private int cp;
|
||||
- private boolean ck;
|
||||
+ private boolean ck; private void setHasSeenCredits(boolean has) { this.ck = has; } // Paper - OBFHELPER
|
||||
private final RecipeBookServer recipeBook = new RecipeBookServer();
|
||||
private Vec3D cm;
|
||||
private int cn;
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.getWorldServer().removePlayer(this);
|
||||
if (!this.viewingCredits) {
|
||||
this.viewingCredits = true;
|
||||
+ if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits
|
||||
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cm ? 0.0F : 1.0F));
|
||||
this.cm = true;
|
||||
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, this.ck ? 0.0F : 1.0F));
|
||||
this.ck = true;
|
||||
}
|
||||
|
|
|
@ -25,14 +25,14 @@ diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/mai
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- 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.aq = MathHelper.nextInt(this.random, 20, 80);
|
||||
@@ -0,0 +0,0 @@ public class EntityFishingHook extends IProjectile {
|
||||
this.ap = MathHelper.nextInt(this.random, 20, 80);
|
||||
}
|
||||
} else {
|
||||
- this.ap = MathHelper.nextInt(this.random, 100, 600);
|
||||
+ this.ap = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper
|
||||
this.ap -= this.au * 20 * 5;
|
||||
+ this.ap = Math.max(0, this.ap); // Paper - Don't allow negative values
|
||||
- this.ao = MathHelper.nextInt(this.random, 100, 600);
|
||||
+ this.ao = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper
|
||||
this.ao -= this.av * 20 * 5;
|
||||
+ this.ao = Math.max(0, this.ao); // Paper - Don't allow negative values;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Extracted to own function
|
||||
+ /*
|
||||
if (this.locY() < -64.0D) {
|
||||
this.af();
|
||||
this.ai();
|
||||
}
|
||||
+ */
|
||||
+ this.performVoidDamage();
|
||||
|
@ -55,9 +55,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
+ // Paper start
|
||||
+ protected void performVoidDamage() {
|
||||
+ if (this.locY < -64.0D || (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
|
||||
+ if (this.locY() < -64.0D || (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
|
||||
+ && world.paperConfig.doNetherTopVoidDamage()
|
||||
+ && this.locY >= world.paperConfig.netherVoidTopDamageHeight)) {
|
||||
+ && this.locY() >= world.paperConfig.netherVoidTopDamageHeight)) {
|
||||
+
|
||||
+ this.doVoidDamage();
|
||||
+ }
|
||||
|
@ -68,11 +68,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
if (this.portalCooldown > 0) {
|
||||
--this.portalCooldown;
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.fireTicks = 0;
|
||||
this.setFireTicks(0);
|
||||
}
|
||||
|
||||
+ protected final void doVoidDamage() { this.af(); } // Paper - OBFHELPER
|
||||
protected void af() {
|
||||
+ protected final void doVoidDamage() { this.ai(); } // Paper - OBFHELPER
|
||||
protected void ai() {
|
||||
this.die();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
||||
|
@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Extracted to own function
|
||||
+ /*
|
||||
if (this.locY() < -64.0D) {
|
||||
this.af();
|
||||
this.ai();
|
||||
}
|
||||
+ */
|
||||
+ this.performVoidDamage();
|
||||
|
|
|
@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
}
|
||||
|
||||
+ boolean knockbackCancelled = world.paperConfig.disableExplosionKnockback && damagesource.isExplosion() && this instanceof EntityHuman; // Paper - Disable explosion knockback
|
||||
+ boolean knockbackCancelled = world.paperConfig.disableExplosionKnockback && damagesource.isExplosion() && this instanceof EntityHuman; // Paper - Disable explosion knockback
|
||||
if (flag1) {
|
||||
if (flag) {
|
||||
this.world.broadcastEntityEffect(this, (byte) 29);
|
||||
|
@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
b0 = 2;
|
||||
}
|
||||
|
||||
+ if (!knockbackCancelled) // Paper - Disable explosion knockback
|
||||
+ if (!knockbackCancelled) // Paper - Disable explosion knockback
|
||||
this.world.broadcastEntityEffect(this, b0);
|
||||
}
|
||||
|
||||
|
@ -42,9 +42,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
}
|
||||
|
||||
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
|
||||
+
|
||||
if (this.getHealth() <= 0.0F) {
|
||||
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
|
||||
if (this.dk()) {
|
||||
if (!this.f(damagesource)) {
|
||||
SoundEffect soundeffect = this.getSoundDeath();
|
||||
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
|
||||
|
@ -64,7 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
EntityHuman entityhuman = (EntityHuman) entity;
|
||||
|
||||
- if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.abilities.isFlying)) {
|
||||
+ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() && !world.paperConfig.disableExplosionKnockback || !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback
|
||||
this.l.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
|
||||
+ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.abilities.isFlying) && !world.paperConfig.disableExplosionKnockback) { // Paper - Disable explosion knockback
|
||||
this.m.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
|
||||
gameprofilerfiller.exitEnter("iceandsnow");
|
||||
|
|
|
@ -22,12 +22,12 @@ diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
gameprofilerfiller.enter("thunder");
|
||||
BlockPosition blockposition;
|
||||
|
||||
- if (flag && this.U() && this.random.nextInt(100000) == 0) {
|
||||
+ if (!this.paperConfig.disableThunder && flag && this.U() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder
|
||||
- if (flag && this.T() && this.random.nextInt(100000) == 0) {
|
||||
+ if (!this.paperConfig.disableThunder && flag && this.T() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder
|
||||
blockposition = this.a(this.a(j, 0, k, 15));
|
||||
if (this.isRainingAt(blockposition)) {
|
||||
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
|
||||
|
|
|
@ -55,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end
|
||||
if (!this.world.isClientSide) {
|
||||
blockposition = new BlockPosition(this);
|
||||
blockposition = this.getChunkCoordinates();
|
||||
boolean flag = this.block.getBlock() instanceof BlockConcretePowder;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
|
|
@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
||||
protected abstract void b(NBTTagCompound nbttagcompound);
|
||||
protected abstract void saveData(NBTTagCompound nbttagcompound);
|
||||
|
||||
+ protected NBTTagList createList(double... adouble) { return a(adouble); } // Paper - OBFHELPER
|
||||
protected NBTTagList a(double... adouble) {
|
||||
|
@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
@Override
|
||||
protected void a(NBTTagCompound nbttagcompound) {
|
||||
protected void loadData(NBTTagCompound nbttagcompound) {
|
||||
this.setFuseTicks(nbttagcompound.getShort("Fuse"));
|
||||
+ // Paper start - Try and load origin location from the old NBT tags for backwards compatibility
|
||||
+ if (nbttagcompound.hasKey("SourceLoc_x")) {
|
||||
|
@ -104,7 +104,7 @@ diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
this.navigators.add(((EntityInsentient) entity).getNavigation());
|
||||
}
|
||||
entity.valid = true; // CraftBukkit
|
||||
|
|
|
@ -9,18 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- 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 {
|
||||
int i1 = MathHelper.floor(this.posY + (double) f3 + 1.0D);
|
||||
int j1 = MathHelper.floor(this.posZ - (double) f3 - 1.0D);
|
||||
int k1 = MathHelper.floor(this.posZ + (double) f3 + 1.0D);
|
||||
int i1 = MathHelper.floor(this.posY + (double) f2 + 1.0D);
|
||||
int j1 = MathHelper.floor(this.posZ - (double) f2 - 1.0D);
|
||||
int k1 = MathHelper.floor(this.posZ + (double) f2 + 1.0D);
|
||||
- List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1));
|
||||
+ // Paper start - Fix lag from explosions processing dead entities
|
||||
+ List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), new com.google.common.base.Predicate<Entity>() {
|
||||
+ @Override
|
||||
+ public boolean apply(Entity entity) {
|
||||
+ return IEntitySelector.canAITarget().test(entity) && !entity.dead;
|
||||
+ }
|
||||
+ });
|
||||
+ // Paper end
|
||||
+ List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), (com.google.common.base.Predicate<Entity>) entity -> IEntitySelector.canAITarget().test(entity) && !entity.dead); // Paper - Fix lag from explosions processing dead entities
|
||||
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
|
||||
|
||||
for (int l1 = 0; l1 < list.size(); ++l1) {
|
||||
|
|
|
@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper End
|
||||
// Spigot End
|
||||
|
||||
public void run() {
|
||||
protected void v() {
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
||||
// Spigot start
|
||||
|
@ -137,8 +137,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
|
||||
+ lastTick = curTime;
|
||||
this.nextTick += 50L;
|
||||
if (this.T) {
|
||||
this.T = false;
|
||||
GameProfilerTick gameprofilertick = GameProfilerTick.a("Server");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
|
|
|
@ -54,61 +54,150 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/BehaviorFindPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BehaviorFindPosition.java
|
||||
@@ -0,0 +0,0 @@ public class BehaviorFindPosition extends Behavior<EntityCreature> {
|
||||
villageplace.a(this.a.c(), (blockposition1) -> {
|
||||
villageplace.a(this.b.c(), (blockposition1) -> {
|
||||
return blockposition1.equals(blockposition);
|
||||
}, blockposition, 1);
|
||||
- entitycreature.getBehaviorController().setMemory(this.b, (Object) GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition));
|
||||
+ entitycreature.getBehaviorController().setMemory(this.b, GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition));
|
||||
- entitycreature.getBehaviorController().setMemory(this.c, (Object) GlobalPos.create(worldserver.getDimensionKey(), blockposition));
|
||||
+ entitycreature.getBehaviorController().setMemory(this.c, GlobalPos.create(worldserver.getDimensionKey(), blockposition)); // Paper - decompile fix
|
||||
this.f.clear();
|
||||
PacketDebug.c(worldserver, blockposition);
|
||||
});
|
||||
} else if (this.f < 5) {
|
||||
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
public class BiomeBase {
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger();
|
||||
- public static final Codec<BiomeBase> b = RecordCodecBuilder.create((instance) -> {
|
||||
- RecordCodecBuilder recordcodecbuilder = BiomeBase.Precipitation.d.fieldOf("precipitation").forGetter((biomebase) -> {
|
||||
- return biomebase.o;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder1 = BiomeBase.Geography.r.fieldOf("category").forGetter((biomebase) -> {
|
||||
- return biomebase.n;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder2 = Codec.FLOAT.fieldOf("depth").forGetter((biomebase) -> {
|
||||
- return biomebase.h;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder3 = Codec.FLOAT.fieldOf("scale").forGetter((biomebase) -> {
|
||||
- return biomebase.i;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder4 = Codec.FLOAT.fieldOf("temperature").forGetter((biomebase) -> {
|
||||
- return biomebase.j;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder5 = Codec.FLOAT.fieldOf("downfall").forGetter((biomebase) -> {
|
||||
- return biomebase.k;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder6 = BiomeFog.a.fieldOf("effects").forGetter((biomebase) -> {
|
||||
- return biomebase.p;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder7 = Codec.INT.fieldOf("sky_color").forGetter((biomebase) -> {
|
||||
- return biomebase.t;
|
||||
- });
|
||||
- RecordCodecBuilder recordcodecbuilder8 = WorldGenSurfaceComposite.a.fieldOf("surface_builder").forGetter((biomebase) -> {
|
||||
- return biomebase.m;
|
||||
- });
|
||||
- Codec codec = WorldGenStage.Features.c;
|
||||
- Codec codec1 = WorldGenCarverWrapper.a.listOf();
|
||||
- Logger logger = BiomeBase.LOGGER;
|
||||
-
|
||||
- logger.getClass();
|
||||
- RecordCodecBuilder recordcodecbuilder9 = Codec.simpleMap(codec, codec1.promotePartial(SystemUtils.a("Carver: ", logger::error)), INamable.a(WorldGenStage.Features.values())).fieldOf("carvers").forGetter((biomebase) -> {
|
||||
- return biomebase.q;
|
||||
- });
|
||||
-
|
||||
- codec1 = WorldGenStage.Decoration.k;
|
||||
- Codec codec2 = WorldGenFeatureConfigured.b.listOf();
|
||||
- Logger logger1 = BiomeBase.LOGGER;
|
||||
-
|
||||
- logger1.getClass();
|
||||
- RecordCodecBuilder recordcodecbuilder10 = Codec.simpleMap(codec1, codec2.promotePartial(SystemUtils.a("Feature: ", logger1::error)), INamable.a(WorldGenStage.Decoration.values())).fieldOf("features").forGetter((biomebase) -> {
|
||||
- return biomebase.r;
|
||||
- });
|
||||
-
|
||||
- codec2 = StructureFeature.a.listOf();
|
||||
- logger1 = BiomeBase.LOGGER;
|
||||
- logger1.getClass();
|
||||
- RecordCodecBuilder recordcodecbuilder11 = codec2.promotePartial(SystemUtils.a("Structure start: ", logger1::error)).fieldOf("starts").forGetter((biomebase) -> {
|
||||
- return (List) biomebase.u.values().stream().sorted(Comparator.comparing((structurefeature) -> {
|
||||
- return IRegistry.STRUCTURE_FEATURE.getKey(structurefeature.b);
|
||||
- })).collect(Collectors.toList());
|
||||
- });
|
||||
- Codec codec3 = EnumCreatureType.g;
|
||||
- Codec codec4 = BiomeBase.BiomeMeta.b.listOf();
|
||||
- Logger logger2 = BiomeBase.LOGGER;
|
||||
-
|
||||
- logger2.getClass();
|
||||
- return instance.group(recordcodecbuilder, recordcodecbuilder1, recordcodecbuilder2, recordcodecbuilder3, recordcodecbuilder4, recordcodecbuilder5, recordcodecbuilder6, recordcodecbuilder7, recordcodecbuilder8, recordcodecbuilder9, recordcodecbuilder10, recordcodecbuilder11, Codec.simpleMap(codec3, codec4.promotePartial(SystemUtils.a("Spawn data: ", logger2::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter((biomebase) -> {
|
||||
- return biomebase.v;
|
||||
- }), BiomeBase.d.a.listOf().fieldOf("climate_parameters").forGetter((biomebase) -> {
|
||||
- return biomebase.x;
|
||||
- }), Codec.STRING.optionalFieldOf("parent").forGetter((biomebase) -> {
|
||||
- return Optional.ofNullable(biomebase.l);
|
||||
- })).apply(instance, BiomeBase::new);
|
||||
+ // Paper decompile error - Spigots stupid decompiler
|
||||
+ public static final Codec<BiomeBase> b = RecordCodecBuilder.create(i -> {
|
||||
+ Codec k1 = WorldGenStage.Decoration.k; // Erase type - WorldGenstage.Decoration has wrong type
|
||||
+ return i.group(
|
||||
+ Precipitation.d.fieldOf("precipitation").forGetter(biome -> biome.o),
|
||||
+ Geography.r.fieldOf("category").forGetter(biome -> biome.n),
|
||||
+ Codec.FLOAT.fieldOf("depth").forGetter(biome -> biome.h),
|
||||
+ Codec.FLOAT.fieldOf("scale").forGetter(biome -> biome.i),
|
||||
+ Codec.FLOAT.fieldOf("temperature").forGetter(biome -> biome.j),
|
||||
+ Codec.FLOAT.fieldOf("downfall").forGetter(biome -> biome.k),
|
||||
+ BiomeFog.a.fieldOf("effects").forGetter(biome -> biome.p),
|
||||
+ Codec.INT.fieldOf("sky_color").forGetter(biome -> biome.t),
|
||||
+ WorldGenSurfaceComposite.a.fieldOf("surface_builder").forGetter(biome -> biome.m),
|
||||
+ Codec.simpleMap(WorldGenStage.Features.c, WorldGenCarverWrapper.a.listOf().promotePartial(SystemUtils.a("Carver: ", LOGGER::error)), INamable.a(WorldGenStage.Features.values())).fieldOf("carvers").forGetter(biome -> biome.q),
|
||||
+ Codec.simpleMap((Codec<WorldGenStage.Decoration>) k1, WorldGenFeatureConfigured.b.listOf().promotePartial(SystemUtils.a("Feature: ", LOGGER::error)), INamable.a(WorldGenStage.Decoration.values())).fieldOf("features").forGetter(biome -> biome.r),
|
||||
+ StructureFeature.a.listOf().promotePartial(SystemUtils.a("Structure start: ", LOGGER::error)).fieldOf("starts").forGetter(biome -> biome.u.values().stream().sorted(Comparator.comparing(cf -> IRegistry.STRUCTURE_FEATURE.getKey(cf.b))).collect(Collectors.toList())),
|
||||
+ Codec.simpleMap(EnumCreatureType.g, BiomeMeta.b.listOf().promotePartial(SystemUtils.a("Spawn data: ", LOGGER::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter(biome -> biome.v),
|
||||
+ d.a.listOf().fieldOf("climate_parameters").forGetter(biome -> biome.x),
|
||||
+ Codec.STRING.optionalFieldOf("parent").forGetter(biome -> Optional.ofNullable(biome.l))
|
||||
+ ).apply(i, BiomeBase::new);
|
||||
+ // Paper end
|
||||
});
|
||||
public static final Set<BiomeBase> c = Sets.newHashSet();
|
||||
- public static final RegistryBlockID<BiomeBase> d = new RegistryBlockID<>();
|
||||
- protected static final NoiseGenerator3 e = new NoiseGenerator3(new SeededRandom(1234L), ImmutableList.of(0));
|
||||
+ public static final RegistryBlockID<BiomeBase> reg = new RegistryBlockID<>(); // Paper - decompile error - rename
|
||||
+ protected static final NoiseGenerator3 NOISE_GENERATOR_3 = new NoiseGenerator3(new SeededRandom(1234L), ImmutableList.of(0)); // Paper - decompile error - rename
|
||||
public static final NoiseGenerator3 f = new NoiseGenerator3(new SeededRandom(2345L), ImmutableList.of(0));
|
||||
@Nullable
|
||||
protected String g;
|
||||
@@ -0,0 +0,0 @@ public class BiomeBase {
|
||||
|
||||
@Nullable
|
||||
public static BiomeBase a(BiomeBase biomebase) {
|
||||
- return (BiomeBase) BiomeBase.c.fromId(IRegistry.BIOME.a((Object) biomebase));
|
||||
+ return (BiomeBase) BiomeBase.c.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix
|
||||
- return (BiomeBase) BiomeBase.d.fromId(IRegistry.BIOME.a((Object) biomebase));
|
||||
+ return (BiomeBase) BiomeBase.reg.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix / rename
|
||||
}
|
||||
|
||||
public static <C extends WorldGenCarverConfiguration> WorldGenCarverWrapper<C> a(WorldGenCarverAbstract<C> worldgencarverabstract, C c0) {
|
||||
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
||||
@@ -0,0 +0,0 @@ public class BiomeBase {
|
||||
}, Function.identity()));
|
||||
this.v = map2;
|
||||
this.x = list1;
|
||||
- this.l = (String) optional.orElse((Object) null);
|
||||
+ this.l = (String) optional.orElse(null); // Paper - decompile fix
|
||||
Stream stream = map1.values().stream().flatMap(Collection::stream).filter((worldgenfeatureconfigured) -> {
|
||||
return worldgenfeatureconfigured.d == WorldGenerator.DECORATED_FLOWER;
|
||||
});
|
||||
@@ -0,0 +0,0 @@ public class BiomeBase {
|
||||
|
||||
@Nullable
|
||||
public <C extends WorldGenFeatureConfiguration> C b(StructureGenerator<C> structuregenerator) {
|
||||
- return (WorldGenFeatureConfiguration) this.t.get(structuregenerator);
|
||||
+ return (C) this.t.get(structuregenerator); // Paper - decompile fix
|
||||
}
|
||||
protected float a(BlockPosition blockposition) {
|
||||
if (blockposition.getY() > 64) {
|
||||
- float f = (float) (BiomeBase.e.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D);
|
||||
+ float f = (float) (BiomeBase.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - decompile error - rename
|
||||
|
||||
public List<WorldGenFeatureConfigured<?, ?>> g() {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
OfInt ofint = dynamic.asIntStream().spliterator();
|
||||
int[] aint = new int[3];
|
||||
|
||||
- if (ofint.tryAdvance((i) -> {
|
||||
+ if (ofint.tryAdvance((Consumer<? super Integer>) (i) -> { // Paper - decomile fix
|
||||
aint[0] = i;
|
||||
- }) && ofint.tryAdvance((i) -> {
|
||||
+ }) && ofint.tryAdvance((Consumer<? super Integer>) (i) -> { // Paper - decompile fix
|
||||
aint[1] = i;
|
||||
})) {
|
||||
- ofint.tryAdvance((i) -> {
|
||||
+ ofint.tryAdvance((Consumer<? super Integer>) (i) -> { // Paper - decompile fix
|
||||
aint[2] = i;
|
||||
});
|
||||
}
|
||||
return this.getTemperature() - (f + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
@@ -0,0 +0,0 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends BlockState<T>
|
||||
@@ -0,0 +0,0 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends IBlockState<T>
|
||||
protected BlockStateEnum(String s, Class<T> oclass, Collection<T> collection) {
|
||||
super(s, oclass);
|
||||
this.a = ImmutableSet.copyOf(collection);
|
||||
|
@ -160,19 +249,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
diff --git a/src/main/java/net/minecraft/server/Fluid.java b/src/main/java/net/minecraft/server/Fluid.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Fluid.java
|
||||
+++ b/src/main/java/net/minecraft/server/Fluid.java
|
||||
@@ -0,0 +0,0 @@ public interface Fluid extends IBlockDataHolder<Fluid> {
|
||||
if (immutablemap.isEmpty()) {
|
||||
object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString())));
|
||||
} else {
|
||||
- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString()), dynamicops.createString("Properties"), dynamicops.createMap((Map) immutablemap.entrySet().stream().map((entry) -> {
|
||||
+ object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString()), dynamicops.createString("Properties"), dynamicops.createMap(immutablemap.entrySet().stream().map((entry) -> { // Paper - decompile fix
|
||||
return Pair.of(dynamicops.createString(((IBlockState) entry.getKey()).a()), dynamicops.createString(IBlockDataHolder.b((IBlockState) entry.getKey(), (Comparable) entry.getValue())));
|
||||
}).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond)))));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
||||
|
@ -203,67 +279,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return true;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IBlockData.java
|
||||
+++ b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
|
||||
public static <T> Dynamic<T> a(DynamicOps<T> dynamicops, IBlockData iblockdata) {
|
||||
ImmutableMap<IBlockState<?>, Comparable<?>> immutablemap = iblockdata.getStateMap();
|
||||
- Object object;
|
||||
+ T object; // Paper - decompile fix
|
||||
|
||||
if (immutablemap.isEmpty()) {
|
||||
object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString())));
|
||||
} else {
|
||||
- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()), dynamicops.createString("Properties"), dynamicops.createMap((Map) immutablemap.entrySet().stream().map((entry) -> {
|
||||
+ object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()), dynamicops.createString("Properties"), dynamicops.createMap(immutablemap.entrySet().stream().map((entry) -> { // Paper - decompile fix
|
||||
return Pair.of(dynamicops.createString(((IBlockState) entry.getKey()).a()), dynamicops.createString(IBlockDataHolder.b((IBlockState) entry.getKey(), (Comparable) entry.getValue())));
|
||||
}).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond)))));
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
if (!iblockdata.o()) {
|
||||
this.f = null;
|
||||
} else {
|
||||
- this.f = new VoxelShape[IBlockData.a.a.length];
|
||||
+ this.f = new VoxelShape[a.length]; // Paper - decompile fix
|
||||
VoxelShape voxelshape = block.i(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
||||
- EnumDirection[] aenumdirection = IBlockData.a.a;
|
||||
+ EnumDirection[] aenumdirection = a; // Paper - decompile fix
|
||||
|
||||
i = aenumdirection.length;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
return this.g.b(enumdirection_enumaxis) < 0.0D || this.g.c(enumdirection_enumaxis) > 1.0D;
|
||||
});
|
||||
this.i = new boolean[6];
|
||||
- EnumDirection[] aenumdirection1 = IBlockData.a.a;
|
||||
+ EnumDirection[] aenumdirection1 = a; // Paper - decompile fix
|
||||
int k = aenumdirection1.length;
|
||||
|
||||
for (i = 0; i < k; ++i) {
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
||||
return Stream.empty();
|
||||
} else {
|
||||
AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D);
|
||||
- Stream stream = this.getEntities(entity, axisalignedbb1).stream().filter((entity1) -> {
|
||||
+ Stream<AxisAlignedBB> stream = this.getEntities(entity, axisalignedbb1).stream().filter((entity1) -> { // Paper - decompile fix
|
||||
return !set.contains(entity1);
|
||||
}).filter((entity1) -> {
|
||||
return entity == null || !entity.isSameVehicle(entity1);
|
||||
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
||||
return Stream.of(entity1.au(), entity == null ? null : entity.j(entity1));
|
||||
}).filter(Objects::nonNull);
|
||||
|
||||
- axisalignedbb1.getClass();
|
||||
return stream.filter(axisalignedbb1::c).map(VoxelShapes::a);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
||||
|
||||
@Nullable
|
||||
|
@ -309,41 +328,30 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/IOWorker.java
|
||||
+++ b/src/main/java/net/minecraft/server/IOWorker.java
|
||||
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
||||
if (throwable != null) {
|
||||
completablefuture.completeExceptionally(throwable);
|
||||
} else {
|
||||
- completablefuture.complete((Object) null);
|
||||
+ completablefuture.complete(null); // Paper - Decompile fix
|
||||
}
|
||||
|
||||
});
|
||||
return this.a(() -> {
|
||||
try {
|
||||
this.d.a();
|
||||
- return Either.left((Object) null);
|
||||
+ return Either.left(null); // Paper - decompile error
|
||||
} catch (Exception exception) {
|
||||
IOWorker.LOGGER.warn("Failed to synchronized chunks", exception);
|
||||
return Either.right(exception);
|
||||
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
||||
}));
|
||||
}
|
||||
|
||||
private void c() {
|
||||
- this.c.a((Object) (new PairedQueue.b(IOWorker.Priority.LOW.ordinal(), this::b)));
|
||||
+ this.c.a((new PairedQueue.b(IOWorker.Priority.LOW.ordinal(), this::b))); // Paper - decompile error
|
||||
}
|
||||
|
||||
completablefuture1.whenComplete((object, throwable) -> {
|
||||
- completablefuture.complete((Object) null);
|
||||
+ completablefuture.complete(null); // Paper - decompile fix
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
||||
private void a(ChunkCoordIntPair chunkcoordintpair, IOWorker.a ioworker_a) {
|
||||
try {
|
||||
this.e.write(chunkcoordintpair, ioworker_a.a);
|
||||
this.d.write(chunkcoordintpair, ioworker_a.a);
|
||||
- ioworker_a.b.complete((Object) null);
|
||||
+ ioworker_a.b.complete(null); // Paper - decompile fix
|
||||
} catch (Exception exception) {
|
||||
IOWorker.LOGGER.error("Failed to store chunk {}", chunkcoordintpair, exception);
|
||||
ioworker_a.b.completeExceptionally(exception);
|
||||
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
||||
private void g() {
|
||||
try {
|
||||
this.e.close();
|
||||
- this.h.complete((Object) null);
|
||||
+ this.h.complete(null); // Paper - decompile fix
|
||||
} catch (Exception exception) {
|
||||
IOWorker.LOGGER.error("Failed to close storage", exception);
|
||||
this.h.completeExceptionally(exception);
|
||||
diff --git a/src/main/java/net/minecraft/server/LightEngineStorageSky.java b/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
||||
|
@ -365,15 +373,6 @@ diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/m
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
||||
+++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
||||
@@ -0,0 +0,0 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
|
||||
}
|
||||
|
||||
private void a(int i, int j, IntSupplier intsupplier, LightEngineThreaded.Update lightenginethreaded_update, Runnable runnable) {
|
||||
- this.e.a((Object) ChunkTaskQueueSorter.a(() -> {
|
||||
+ this.e.a(ChunkTaskQueueSorter.a(() -> { // Paper - decompile error
|
||||
this.c.add(Pair.of(lightenginethreaded_update, runnable));
|
||||
if (this.c.size() >= this.f) {
|
||||
this.b();
|
||||
@@ -0,0 +0,0 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
|
||||
|
||||
public void queueUpdate() {
|
||||
|
@ -388,13 +387,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
|
||||
@@ -0,0 +0,0 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional
|
||||
}
|
||||
public b() {}
|
||||
|
||||
public void a(JsonObject jsonobject, LootItemFunctionExplorationMap lootitemfunctionexplorationmap, JsonSerializationContext jsonserializationcontext) {
|
||||
- super.a(jsonobject, (LootItemFunctionConditional) lootitemfunctionexplorationmap, jsonserializationcontext);
|
||||
+ super.a(jsonobject, lootitemfunctionexplorationmap, jsonserializationcontext); // Paper - decompile fix
|
||||
if (!lootitemfunctionexplorationmap.d.equals("Buried_Treasure")) {
|
||||
jsonobject.add("destination", jsonserializationcontext.serialize(lootitemfunctionexplorationmap.d));
|
||||
if (!lootitemfunctionexplorationmap.e.equals(LootItemFunctionExplorationMap.a)) {
|
||||
jsonobject.add("destination", jsonserializationcontext.serialize(lootitemfunctionexplorationmap.e.i()));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -472,31 +471,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
});
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFileSection.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFileSection.java
|
||||
@@ -0,0 +0,0 @@ public class RegionFileSection<R extends MinecraftSerializable> implements AutoC
|
||||
Optional<R> optional = this.d(i);
|
||||
|
||||
if (optional.isPresent()) {
|
||||
- return (MinecraftSerializable) optional.get();
|
||||
+ return optional.get(); // Paper - decompile fix
|
||||
} else {
|
||||
- R r0 = (MinecraftSerializable) this.f.apply(() -> {
|
||||
+ R r0 = this.f.apply(() -> { // Paper - decompile fix
|
||||
this.a(i);
|
||||
});
|
||||
|
||||
@@ -0,0 +0,0 @@ public class RegionFileSection<R extends MinecraftSerializable> implements AutoC
|
||||
for (int l = 0; l < 16; ++l) {
|
||||
long i1 = SectionPosition.a(chunkcoordintpair, l).v();
|
||||
Optional<R> optional = optionaldynamic.get(Integer.toString(l)).get().map((dynamic2) -> {
|
||||
- return (MinecraftSerializable) this.e.apply(() -> {
|
||||
+ return this.e.apply(() -> { // Paper - decompile fix
|
||||
this.a(i1);
|
||||
}, dynamic2);
|
||||
});
|
||||
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||
|
@ -567,7 +541,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public class SystemUtils {
|
||||
}
|
||||
|
||||
public static <K> Strategy<K> i() {
|
||||
public static <K> Strategy<K> k() {
|
||||
- return SystemUtils.IdentityHashingStrategy.INSTANCE;
|
||||
+ return (Strategy<K>) SystemUtils.IdentityHashingStrategy.INSTANCE; // Paper - decompile fix
|
||||
}
|
||||
|
@ -629,19 +603,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
private static boolean a(ChunkSection chunksection) {
|
||||
- Stream stream = VillagePlaceType.e();
|
||||
+ Stream<IBlockData> stream = VillagePlaceType.e(); // Paper - decompile fix
|
||||
- Set set = VillagePlaceType.x;
|
||||
+ Set<IBlockData> set = VillagePlaceType.x; // Paper - decompile error
|
||||
|
||||
- set.getClass();
|
||||
+ //set.getClass(); // Paper - decompile error
|
||||
return chunksection.a(set::contains);
|
||||
}
|
||||
|
||||
chunksection.getClass();
|
||||
return stream.anyMatch(chunksection::a);
|
||||
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
||||
SectionPosition.b(new ChunkCoordIntPair(blockposition), Math.floorDiv(i, 16)).map((sectionposition) -> {
|
||||
return Pair.of(sectionposition, this.d(sectionposition.v()));
|
||||
return Pair.of(sectionposition, this.d(sectionposition.s()));
|
||||
}).filter((pair) -> {
|
||||
- return !(Boolean) ((Optional) pair.getSecond()).map(VillagePlaceSection::a).orElse(false);
|
||||
+ return !(Boolean) (pair.getSecond()).map(VillagePlaceSection::a).orElse(false); // Paper - decompile fix
|
||||
}).map((pair) -> {
|
||||
return ((SectionPosition) pair.getFirst()).u();
|
||||
return ((SectionPosition) pair.getFirst()).r();
|
||||
}).filter((chunkcoordintpair) -> {
|
||||
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
||||
|
||||
|
@ -663,15 +640,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- public static final Map<VillagerProfession, Int2ObjectMap<VillagerTrades.IMerchantRecipeOption[]>> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
||||
+ public static final Map<VillagerProfession, Int2ObjectMap<VillagerTrades.IMerchantRecipeOption[]>> a = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Paper - decompile fix
|
||||
hashmap.put(VillagerProfession.FARMER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHEAT, 20, 16, 2), new VillagerTrades.b(Items.POTATO, 26, 16, 2), new VillagerTrades.b(Items.CARROT, 22, 16, 2), new VillagerTrades.b(Items.BEETROOT, 15, 16, 2), new VillagerTrades.h(Items.BREAD, 1, 6, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.PUMPKIN, 6, 12, 10), new VillagerTrades.h(Items.PUMPKIN_PIE, 1, 4, 5), new VillagerTrades.h(Items.APPLE, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.COOKIE, 3, 18, 10), new VillagerTrades.b(Blocks.MELON, 4, 12, 20)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Blocks.CAKE, 1, 1, 12, 15), new VillagerTrades.i(MobEffects.NIGHT_VISION, 100, 15), new VillagerTrades.i(MobEffects.JUMP, 160, 15), new VillagerTrades.i(MobEffects.WEAKNESS, 140, 15), new VillagerTrades.i(MobEffects.BLINDNESS, 120, 15), new VillagerTrades.i(MobEffects.POISON, 280, 15), new VillagerTrades.i(MobEffects.SATURATION, 7, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GOLDEN_CARROT, 3, 3, 30), new VillagerTrades.h(Items.GLISTERING_MELON_SLICE, 4, 3, 30)})));
|
||||
- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.pT, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())})));
|
||||
+ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.pT, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.<VillagerType, Item>builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); // Paper - decompile fix
|
||||
- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rm, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())})));
|
||||
+ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rm, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.<VillagerType, Item>builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); // <VillagerType, Item>
|
||||
hashmap.put(VillagerProfession.SHEPHERD, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.WHITE_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BROWN_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BLACK_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.GRAY_WOOL, 18, 16, 2), new VillagerTrades.h(Items.SHEARS, 2, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHITE_DYE, 12, 16, 10), new VillagerTrades.b(Items.GRAY_DYE, 12, 16, 10), new VillagerTrades.b(Items.BLACK_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIGHT_BLUE_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIME_DYE, 12, 16, 10), new VillagerTrades.h(Blocks.WHITE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.ORANGE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.YELLOW_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIME_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PINK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.CYAN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PURPLE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BROWN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GREEN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.RED_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLACK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.WHITE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.ORANGE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.YELLOW_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIME_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PINK_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.CYAN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PURPLE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BROWN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GREEN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.RED_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLACK_CARPET, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.YELLOW_DYE, 12, 16, 20), new VillagerTrades.b(Items.LIGHT_GRAY_DYE, 12, 16, 20), new VillagerTrades.b(Items.ORANGE_DYE, 12, 16, 20), new VillagerTrades.b(Items.RED_DYE, 12, 16, 20), new VillagerTrades.b(Items.PINK_DYE, 12, 16, 20), new VillagerTrades.h(Blocks.WHITE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.YELLOW_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.RED_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLACK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BROWN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.CYAN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GREEN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIME_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.MAGENTA_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.ORANGE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PINK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PURPLE_BED, 3, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BROWN_DYE, 12, 16, 30), new VillagerTrades.b(Items.PURPLE_DYE, 12, 16, 30), new VillagerTrades.b(Items.BLUE_DYE, 12, 16, 30), new VillagerTrades.b(Items.GREEN_DYE, 12, 16, 30), new VillagerTrades.b(Items.MAGENTA_DYE, 12, 16, 30), new VillagerTrades.b(Items.CYAN_DYE, 12, 16, 30), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 12, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.PAINTING, 2, 3, 30)})));
|
||||
hashmap.put(VillagerProfession.FLETCHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STICK, 32, 16, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 12, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FLINT, 26, 12, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 14, 16, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FEATHER, 24, 16, 30), new VillagerTrades.e(Items.BOW, 2, 3, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.dE, 8, 12, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 3, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 12, 30)})));
|
||||
- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pR, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build()));
|
||||
+ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.<Integer, VillagerTrades.IMerchantRecipeOption[]>builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pR, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Paper - decompile fix
|
||||
hashmap.put(VillagerProfession.CARTOGRAPHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.h(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.df, 11, 16, 10), new VillagerTrades.k(13, "Monument", MapIcon.Type.MONUMENT, 12, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COMPASS, 1, 12, 20), new VillagerTrades.k(14, "Mansion", MapIcon.Type.MANSION, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.ITEM_FRAME, 7, 1, 15), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GLOBE_BANNER_PATTERN, 8, 1, 30)})));
|
||||
hashmap.put(VillagerProfession.FLETCHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STICK, 32, 16, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 12, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FLINT, 26, 12, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 14, 16, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FEATHER, 24, 16, 30), new VillagerTrades.e(Items.BOW, 2, 3, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.es, 8, 12, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 3, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 12, 30)})));
|
||||
- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rj, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build()));
|
||||
+ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.<Integer, IMerchantRecipeOption[]>builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rj, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Integer, IMerchantRecipeOption[]
|
||||
hashmap.put(VillagerProfession.CARTOGRAPHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.h(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.dP, 11, 16, 10), new VillagerTrades.k(13, StructureGenerator.MONUMENT, MapIcon.Type.MONUMENT, 12, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COMPASS, 1, 12, 20), new VillagerTrades.k(14, StructureGenerator.MANSION, MapIcon.Type.MANSION, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.ITEM_FRAME, 7, 1, 15), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GLOBE_BANNER_PATTERN, 8, 1, 30)})));
|
||||
hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 16, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.GOLD_INGOT, 3, 12, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.RABBIT_FOOT, 2, 12, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SCUTE, 4, 12, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 12, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.NETHER_WART, 22, 12, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)})));
|
||||
hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COAL, 15, 16, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 12, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.IRON_INGOT, 4, 12, 10), new VillagerTrades.h(new ItemStack(Items.pQ), 36, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 12, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.LAVA_BUCKET, 1, 12, 20), new VillagerTrades.b(Items.DIAMOND, 1, 12, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 12, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 3, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 3, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 3, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 3, 30, 0.2F)})));
|
||||
hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COAL, 15, 16, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 12, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.IRON_INGOT, 4, 12, 10), new VillagerTrades.h(new ItemStack(Items.ri), 36, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 12, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.LAVA_BUCKET, 1, 12, 20), new VillagerTrades.b(Items.DIAMOND, 1, 12, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 12, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 3, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 3, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 3, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 3, 30, 0.2F)})));
|
||||
diff --git a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java b/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
|
||||
|
@ -685,18 +662,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.b.add(i - 1);
|
||||
this.c.add(j - 1);
|
||||
this.a.add(d1);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
|
||||
@@ -0,0 +0,0 @@ public class WorldGenFeatureStateProviderWeighted extends WorldGenFeatureStatePr
|
||||
builder.put(dynamicops.createString("type"), dynamicops.createString(IRegistry.t.getKey(this.a).toString())).put(dynamicops.createString("entries"), this.b.a(dynamicops, (iblockdata) -> {
|
||||
return IBlockData.a(dynamicops, iblockdata);
|
||||
}));
|
||||
- return (new Dynamic(dynamicops, dynamicops.createMap(builder.build()))).getValue();
|
||||
+ return (new Dynamic<T>(dynamicops, dynamicops.createMap(builder.build()))).getValue(); // Paper - decompile fix
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
|
||||
|
|
|
@ -2291,8 +2291,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return this.distanceSquared(iposition.getX(), iposition.getY(), iposition.getZ(), true) < d0 * d0;
|
||||
}
|
||||
|
||||
+ public final double distanceSquared(BaseBlockPosition baseblockposition) { return m(baseblockposition); } // Paper - OBFHELPER
|
||||
public double m(BaseBlockPosition baseblockposition) {
|
||||
+ public final double distanceSquared(BaseBlockPosition baseblockposition) { return j(baseblockposition); } // Paper - OBFHELPER
|
||||
public double j(BaseBlockPosition baseblockposition) {
|
||||
return this.distanceSquared((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ(), true);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockAccessAir.java b/src/main/java/net/minecraft/server/BlockAccessAir.java
|
||||
|
@ -2318,23 +2318,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public IBlockData getType(BlockPosition blockposition) {
|
||||
return Blocks.AIR.getBlockData();
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockData.java b/src/main/java/net/minecraft/server/BlockData.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockDataAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockDataAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract static class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
|
||||
return Collections.unmodifiableCollection(this.d.keySet());
|
||||
}
|
||||
|
||||
+ public final <T extends Comparable<T>> boolean hasProperty(IBlockState<T> iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER
|
||||
public <T extends Comparable<T>> boolean b(IBlockState<T> iblockstate) {
|
||||
return this.d.containsKey(iblockstate);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
return d0 == 0.0D && d1 == 0.0D && d2 == 0.0D ? this : new BlockPosition((double) this.getX() + d0, (double) this.getY() + d1, (double) this.getZ() + d2);
|
||||
}
|
||||
|
||||
|
@ -2342,7 +2330,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public BlockPosition b(int i, int j, int k) {
|
||||
return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
return new BlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX());
|
||||
}
|
||||
|
||||
|
@ -2351,58 +2339,66 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public BlockPosition immutableCopy() {
|
||||
return this;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
super(i, j, k);
|
||||
}
|
||||
|
||||
+ public static BlockPosition.PooledBlockPosition acquire() { return r(); } // Paper - OBFHELPER
|
||||
public static BlockPosition.PooledBlockPosition r() {
|
||||
return f(0, 0, 0);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
return this.d;
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
return super.a(enumblockrotation).immutableCopy();
|
||||
}
|
||||
|
||||
+ public BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER
|
||||
public BlockPosition.MutableBlockPosition d(int i, int j, int k) {
|
||||
this.b = i;
|
||||
this.c = j;
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
return this.c(entity.locX(), entity.locY(), entity.locZ());
|
||||
this.o(i);
|
||||
this.p(j);
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
return this;
|
||||
}
|
||||
|
||||
+ public BlockPosition.MutableBlockPosition setValues(double d0, double d1, double d2) { return c(d0, d1, d2);} // Paper - OBFHELPER
|
||||
public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) {
|
||||
return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
return this.d(this.b + i, this.c + j, this.d + k);
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
}
|
||||
}
|
||||
|
||||
+ public final void setX(final int x) { this.o(x); } // Paper - OBFHELPER
|
||||
+ public final void setX(final int x) { super.o(x); } // Paper - OBFHELPER
|
||||
@Override
|
||||
public void o(int i) {
|
||||
this.b = i;
|
||||
super.o(i);
|
||||
}
|
||||
|
||||
+ public final void setY(final int y) { this.p(y); } // Paper - OBFHELPER
|
||||
+ public final void setY(final int y) { super.p(y); } // Paper - OBFHELPER
|
||||
@Override
|
||||
public void p(int i) {
|
||||
this.c = i;
|
||||
super.p(i);
|
||||
}
|
||||
|
||||
+ public final void setZ(final int z) { this.q(z); } // Paper - OBFHELPER
|
||||
+ public final void setZ(final int z) { super.q(z); } // Paper - OBFHELPER
|
||||
@Override
|
||||
public void q(int i) {
|
||||
this.d = i;
|
||||
super.q(i);
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
return new BlockPosition(this);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ public static class PooledBlockPosition extends BlockPosition.MutableBlockPosition implements AutoCloseable {
|
||||
+ @Deprecated
|
||||
+ public void close() {}
|
||||
+ @Deprecated
|
||||
+ public static BlockPosition.PooledBlockPosition acquire() { return new PooledBlockPosition(); }
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
public class Chunk implements IChunkAccess {
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@Nullable
|
||||
- public static final ChunkSection a = null;
|
||||
+ public static final ChunkSection a = null; public static final ChunkSection EMPTY_CHUNK_SECTION = Chunk.a; // Paper - OBFHELPER
|
||||
+ public static final ChunkSection a = null; public static final ChunkSection EMPTY_CHUNK_SECTION = a; // Paper - OBFHELPER
|
||||
private final ChunkSection[] sections;
|
||||
private BiomeStorage d;
|
||||
private final Map<BlockPosition, NBTTagCompound> e;
|
||||
|
@ -2418,7 +2414,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
this.n = new ShortList[16];
|
||||
this.entitySlices = (List[]) (new List[16]); // Spigot
|
||||
this.world = world;
|
||||
this.world = (WorldServer) world; // CraftBukkit - type
|
||||
- this.loc = chunkcoordintpair;
|
||||
+ this.loc = chunkcoordintpair; this.coordinateKey = MCUtil.getCoordinateKey(chunkcoordintpair); // Paper - cache coordinate key
|
||||
this.i = chunkconverter;
|
||||
|
@ -2734,7 +2730,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
private final ChunkMapDistance chunkMapDistance;
|
||||
public final ChunkGenerator<?> chunkGenerator;
|
||||
public final ChunkGenerator chunkGenerator;
|
||||
private final WorldServer world;
|
||||
- private final Thread serverThread;
|
||||
+ public final Thread serverThread; // Paper - private -> public
|
||||
|
@ -2742,9 +2738,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
private final ChunkProviderServer.a serverThreadQueue;
|
||||
public final PlayerChunkMap playerChunkMap;
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
private final ChunkStatus[] cacheStatus = new ChunkStatus[4];
|
||||
private final IChunkAccess[] cacheChunk = new IChunkAccess[4];
|
||||
|
||||
@Nullable
|
||||
private SpawnerCreature.d p;
|
||||
+ // Paper start
|
||||
+ final com.destroystokyo.paper.util.concurrent.WeakSeqLock loadedChunkMapSeqLock = new com.destroystokyo.paper.util.concurrent.WeakSeqLock();
|
||||
+ final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<Chunk> loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
|
||||
|
@ -2863,7 +2859,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(x, z);
|
||||
+ Long identifier = Long.valueOf(this.chunkFutureAwaitCounter++);
|
||||
+ this.addTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
|
||||
+ this.chunkMapDistance.addTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
|
||||
+ this.tickDistanceManager();
|
||||
+
|
||||
+ PlayerChunk chunk = this.playerChunkMap.getUpdatingChunk(chunkPos.pair());
|
||||
|
@ -2900,17 +2896,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ } finally {
|
||||
+ // due to odd behaviour with CB unload implementation we need to have these AFTER the load callback.
|
||||
+ ChunkProviderServer.this.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos);
|
||||
+ ChunkProviderServer.this.removeTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
|
||||
+ ChunkProviderServer.this.chunkMapDistance.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos);
|
||||
+ ChunkProviderServer.this.chunkMapDistance.removeTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
|
||||
+ }
|
||||
+ }, this.serverThreadQueue);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
+
|
||||
public ChunkProviderServer(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator<?> chunkgenerator, int i, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) {
|
||||
|
||||
public ChunkProviderServer(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, boolean flag, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) {
|
||||
this.world = worldserver;
|
||||
this.serverThreadQueue = new ChunkProviderServer.a(worldserver);
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.cacheChunk[0] = ichunkaccess;
|
||||
}
|
||||
|
@ -2961,6 +2955,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Nullable
|
||||
@Override
|
||||
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
|
||||
this.p = spawnercreature_d;
|
||||
this.world.getMethodProfiler().exit();
|
||||
- List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f());
|
||||
-
|
||||
- Collections.shuffle(list);
|
||||
- list.forEach((playerchunk) -> {
|
||||
+ //List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
|
||||
+ //Collections.shuffle(list); // Paper
|
||||
+ this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
||||
if (optional.isPresent()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
|
@ -2978,12 +2986,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/DataBits.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataBits.java
|
||||
@@ -0,0 +0,0 @@ public class DataBits {
|
||||
}
|
||||
return (int) (k >> l & this.d);
|
||||
}
|
||||
|
||||
+ public long[] getDataBits() { return this.a(); } // Paper - OBFHELPER
|
||||
public long[] a() {
|
||||
return this.a;
|
||||
return this.b;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -2996,7 +3004,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ default int getOrCreateIdFor(T object) { return this.a(object); } // Paper - OBFHELPER
|
||||
int a(T t0);
|
||||
|
||||
boolean b(T t0);
|
||||
boolean a(Predicate<T> predicate);
|
||||
|
||||
+ @Nullable default T getObject(int dataBits) { return this.a(dataBits); } // Paper - OBFHELPER
|
||||
@Nullable
|
||||
|
@ -3044,18 +3052,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public void b(PacketDataSerializer packetdataserializer) {
|
||||
this.a();
|
||||
packetdataserializer.writeByte(this.i);
|
||||
diff --git a/src/main/java/net/minecraft/server/DimensionManager.java b/src/main/java/net/minecraft/server/DimensionManager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/DimensionManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/DimensionManager.java
|
||||
@@ -0,0 +0,0 @@ public class DimensionManager implements MinecraftSerializable {
|
||||
return this.folder.isEmpty() ? file : new File(file, this.folder);
|
||||
}
|
||||
|
||||
+ public WorldServer world; // Paper - store ref to world this manager is for
|
||||
public WorldProvider getWorldProvider(World world) {
|
||||
return (WorldProvider) this.providerFactory.apply(world, this);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
|
@ -3064,12 +3060,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
}
|
||||
|
||||
+ public final AxisAlignedBB getCollisionBox(){return au();} //Paper - OBFHELPER
|
||||
@Nullable
|
||||
public AxisAlignedBB au() {
|
||||
- @Nullable
|
||||
- public AxisAlignedBB ay() {
|
||||
+
|
||||
+ @Nullable public final AxisAlignedBB getCollisionBox(){return ay();} //Paper - OBFHELPER
|
||||
+ @Nullable public AxisAlignedBB ay() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
|
||||
return false;
|
||||
return EnumInteractionResult.PASS;
|
||||
}
|
||||
|
||||
+ public final AxisAlignedBB getHardCollisionBox(Entity entity){ return j(entity);}//Paper - OBFHELPER
|
||||
|
@ -3106,8 +3106,8 @@ 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 {
|
||||
public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||
public boolean collides = true;
|
||||
public Set<UUID> collidableExemptions = new HashSet<>();
|
||||
public boolean canPickUpLoot;
|
||||
+ public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
|
||||
|
||||
|
@ -3136,11 +3136,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleHashSet; // Paper
|
||||
+
|
||||
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
|
||||
super((World) worldserver, gameprofile);
|
||||
playerinteractmanager.player = this;
|
||||
super(worldserver, worldserver.getSpawn(), gameprofile);
|
||||
this.spawnDimension = World.OVERWORLD;
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.H = 1.0F;
|
||||
this.a(worldserver);
|
||||
this.G = 1.0F;
|
||||
this.b(worldserver);
|
||||
|
||||
+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
||||
+
|
||||
|
@ -3151,8 +3151,8 @@ diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -0,0 +0,0 @@ import com.mojang.datafixers.DataFixUtils;
|
||||
import java.util.Collections;
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set; // Paper
|
||||
+import java.util.Map; // Paper
|
||||
|
@ -3160,14 +3160,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
@@ -0,0 +0,0 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bj.height;
|
||||
return this.bq.height;
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- public T a(World world) {
|
||||
+ public T create(World world) { return this.a(world); } // Paper - OBFHELPER
|
||||
+ @Nullable public T a(World world) { // Paper - OBFHELPER
|
||||
return this.ba.create(this, world);
|
||||
return this.be.create(this, world);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
||||
|
@ -3217,33 +3217,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
+
|
||||
default int h(BlockPosition blockposition) {
|
||||
return this.getType(blockposition).h();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IBlockData.java
|
||||
+++ b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
return this.c != null && this.c.f != null ? this.c.f[enumdirection.ordinal()] : VoxelShapes.a(this.j(iblockaccess, blockposition), enumdirection);
|
||||
}
|
||||
|
||||
+ public final boolean exceedsCube(){ return f();} // Paper - OBFHELPER
|
||||
public boolean f() {
|
||||
return this.c == null || this.c.h;
|
||||
return this.getType(blockposition).f();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IOWorker.java
|
||||
+++ b/src/main/java/net/minecraft/server/IOWorker.java
|
||||
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
||||
private final Thread b;
|
||||
private final AtomicBoolean c = new AtomicBoolean();
|
||||
private final Queue<Runnable> d = Queues.newConcurrentLinkedQueue();
|
||||
- private final RegionFileCache e;
|
||||
+ private final RegionFileCache e; public RegionFileCache getRegionFileCache() { return e; } // Paper - OBFHELPER
|
||||
private final Map<ChunkCoordIntPair, IOWorker.a> f = Maps.newLinkedHashMap();
|
||||
private boolean g = true;
|
||||
private CompletableFuture<Void> h = new CompletableFuture();
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private final AtomicBoolean b = new AtomicBoolean();
|
||||
private final ThreadedMailbox<PairedQueue.b> c;
|
||||
- private final RegionFileCache d;
|
||||
+ private final RegionFileCache d;public RegionFileCache getRegionFileCache() { return d; } // Paper - OBFHELPER
|
||||
private final Map<ChunkCoordIntPair, IOWorker.a> e = Maps.newLinkedHashMap();
|
||||
|
||||
protected IOWorker(File file, boolean flag, String s) {
|
||||
diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IWorldReader.java
|
||||
|
@ -3260,27 +3248,15 @@ diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/n
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.event.world.StructureGrowEvent;
|
||||
public final class ItemStack {
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class ItemStack {
|
||||
})).apply(instance, ItemStack::new);
|
||||
});
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
- public static final ItemStack a = new ItemStack((Item) null);
|
||||
+ public static final ItemStack a = new ItemStack((Item) null);public static final ItemStack NULL_ITEM = a; // Paper - OBFHELPER
|
||||
public static final DecimalFormat b = H();
|
||||
private int count;
|
||||
private int e;
|
||||
+ // Paper start
|
||||
+ private org.bukkit.craftbukkit.inventory.CraftItemStack bukkitStack;
|
||||
+ public org.bukkit.inventory.ItemStack getBukkitStack() {
|
||||
+ if (bukkitStack == null || bukkitStack.getHandle() != this) {
|
||||
+ bukkitStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this);
|
||||
+ }
|
||||
+ return bukkitStack;
|
||||
+ }
|
||||
+ // Paper end
|
||||
@Deprecated
|
||||
private Item item;
|
||||
private NBTTagCompound tag;
|
||||
- public static final ItemStack b = new ItemStack((Item) null);
|
||||
+ public static final ItemStack b = new ItemStack((Item) null);public static final ItemStack NULL_ITEM = b; // Paper - OBFHELPER
|
||||
public static final DecimalFormat c = (DecimalFormat) SystemUtils.a((new DecimalFormat("#.##")), (decimalformat) -> { // CraftBukkit - decompile error
|
||||
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
|
||||
});
|
||||
@@ -0,0 +0,0 @@ public final class ItemStack {
|
||||
return this.tag != null ? this.tag.getList("Enchantments", 10) : new NBTTagList();
|
||||
}
|
||||
|
@ -3295,6 +3271,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public static ItemStack fromBukkitCopy(org.bukkit.inventory.ItemStack itemstack) {
|
||||
+ return CraftItemStack.asNMSCopy(itemstack);
|
||||
+ }
|
||||
+ private org.bukkit.craftbukkit.inventory.CraftItemStack bukkitStack;
|
||||
+ public org.bukkit.inventory.ItemStack getBukkitStack() {
|
||||
+ if (bukkitStack == null || bukkitStack.getHandle() != this) {
|
||||
+ bukkitStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this);
|
||||
+ }
|
||||
+ return bukkitStack;
|
||||
+ }
|
||||
+ // Paper end
|
||||
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
|
||||
this.tag = nbttagcompound;
|
||||
|
@ -3782,24 +3765,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ asyncExecutor.execute(run);
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public static TileEntityHopper getHopper(World world, BlockPosition pos) {
|
||||
+ Chunk chunk = world.getChunkIfLoaded(pos.getX() >> 4, pos.getZ() >> 4);
|
||||
+ if (chunk != null && chunk.getType(new BlockPosition(pos.getX(), pos.getY(), pos.getZ())).getBlock() == Blocks.HOPPER) {
|
||||
+ TileEntity tileEntity = chunk.getTileEntityImmediately(pos);
|
||||
+ if (tileEntity instanceof TileEntityHopper) {
|
||||
+ return (TileEntityHopper) tileEntity;
|
||||
+ }
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ @Nonnull
|
||||
+ public static World getNMSWorld(@Nonnull org.bukkit.World world) {
|
||||
+ public static WorldServer getNMSWorld(@Nonnull org.bukkit.World world) {
|
||||
+ return ((CraftWorld) world).getHandle();
|
||||
+ }
|
||||
+
|
||||
+ public static World getNMSWorld(@Nonnull org.bukkit.entity.Entity entity) {
|
||||
+ public static WorldServer getNMSWorld(@Nonnull org.bukkit.entity.Entity entity) {
|
||||
+ return getNMSWorld(entity.getWorld());
|
||||
+ }
|
||||
+
|
||||
|
@ -3840,8 +3811,8 @@ 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 extends IAsyncTaskHandlerReentrant<TickTas
|
||||
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.convertable.getLevelName(), ioexception1);
|
||||
}
|
||||
|
||||
// Spigot start
|
||||
+ MCUtil.asyncExecutor.shutdown(); // Paper
|
||||
+ try { MCUtil.asyncExecutor.awaitTermination(30, java.util.concurrent.TimeUnit.SECONDS); // Paper
|
||||
|
@ -3860,7 +3831,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- private final Map<String, NBTBase> map;
|
||||
+ public final Map<String, NBTBase> map; // Paper
|
||||
|
||||
private NBTTagCompound(Map<String, NBTBase> map) {
|
||||
protected NBTTagCompound(Map<String, NBTBase> map) {
|
||||
this.map = map;
|
||||
@@ -0,0 +0,0 @@ public class NBTTagCompound implements NBTBase {
|
||||
this.map.put(s, NBTTagLong.a(i));
|
||||
|
@ -3868,15 +3839,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
+ public void setUUID(String prefix, UUID uuid) { a(prefix, uuid); } // Paper - OBFHELPER
|
||||
public void a(String s, UUID uuid) {
|
||||
this.setLong(s + "Most", uuid.getMostSignificantBits());
|
||||
this.setLong(s + "Least", uuid.getLeastSignificantBits());
|
||||
this.map.put(s, GameProfileSerializer.a(uuid));
|
||||
}
|
||||
|
||||
+
|
||||
+ @Nullable public UUID getUUID(String prefix) { return a(prefix); } // Paper - OBFHELPER
|
||||
+ @Nullable
|
||||
public UUID a(String s) {
|
||||
return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least"));
|
||||
return GameProfileSerializer.a(this.get(s));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -3946,7 +3916,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ private byte[] f; private byte[] getData() { return this.f; } // Paper - OBFHELPER
|
||||
private List<NBTTagCompound> g;
|
||||
private boolean h;
|
||||
|
||||
private boolean i;
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
return bytebuf;
|
||||
}
|
||||
|
@ -4171,12 +4141,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ int chunkZ = MCUtil.getChunkCoordinate(player.locZ());
|
||||
+ // Note: players need to be explicitly added to distance maps before they can be updated
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ // Paper end
|
||||
+
|
||||
public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) {
|
||||
super(new File(worldserver.getWorldProvider().getDimensionManager().a(file), "region"), datafixer);
|
||||
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
|
||||
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
|
||||
this.visibleChunks = this.updatingChunks.clone();
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
};
|
||||
|
@ -4199,7 +4167,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
+ this.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
|
||||
} else {
|
||||
SectionPosition sectionposition = entityplayer.K();
|
||||
SectionPosition sectionposition = entityplayer.N();
|
||||
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
if (!flag2) {
|
||||
|
@ -4299,8 +4267,8 @@ diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
|
||||
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccess {
|
||||
return i >= ichunkaccess.getPos().x && i <= ichunkaccess1.getPos().x && j >= ichunkaccess.getPos().z && j <= ichunkaccess1.getPos().z;
|
||||
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
|
||||
return i >= this.n.x && i <= this.o.x && j >= this.n.z && j <= this.o.z;
|
||||
}
|
||||
|
||||
+ // Paper start - if loaded util
|
||||
|
@ -4393,13 +4361,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
// CraftBukkit end
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
|
||||
|
||||
protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
|
||||
- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
|
||||
+ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper
|
||||
this.generator = gen;
|
||||
+ if (dimensionmanager.world == null) dimensionmanager.world = (WorldServer) this; // Paper
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL);
|
||||
}
|
||||
|
@ -4408,7 +4377,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ @Nullable
|
||||
+ @Override
|
||||
+ public IChunkAccess getChunkIfLoadedImmediately(int x, int z) {
|
||||
+ return ((ChunkProviderServer)this.chunkProvider).getChunkAtIfLoadedImmediately(x, z);
|
||||
+ return ((WorldServer)this).chunkProvider.getChunkAtIfLoadedImmediately(x, z);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
@ -4439,7 +4408,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
@Override
|
||||
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
|
||||
IChunkAccess ichunkaccess = this.chunkProvider.getChunkAt(i, j, chunkstatus, flag);
|
||||
IChunkAccess ichunkaccess = this.getChunkProvider().getChunkAt(i, j, chunkstatus, flag);
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
|
||||
|
@ -4460,11 +4429,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return this.b(entity.locX(), entity.locZ());
|
||||
}
|
||||
|
||||
+ public final VoxelShape asVoxelShape(){ return a();} // Paper - OBFHELPER
|
||||
+
|
||||
public VoxelShape a() {
|
||||
return this.i.m();
|
||||
+ public final VoxelShape asVoxelShape(){ return c();} // Paper - OBFHELPER
|
||||
public VoxelShape c() {
|
||||
return this.j.m();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap();
|
||||
private final Queue<Entity> entitiesToAdd = Queues.newArrayDeque();
|
||||
private final List<EntityPlayer> players = Lists.newArrayList();
|
||||
- private final ChunkProviderServer chunkProvider;
|
||||
+ public final ChunkProviderServer chunkProvider; // Paper - public
|
||||
boolean tickingEntities;
|
||||
private final MinecraftServer server;
|
||||
public final WorldDataServer worldDataServer; // CraftBukkit - type
|
||||
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
|
||||
|
@ -4670,7 +4651,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
|
||||
@@ -0,0 +0,0 @@ public class DummyGeneratorAccess implements GeneratorAccess {
|
||||
public boolean a(BlockPosition blockposition, boolean flag, Entity entity) {
|
||||
public boolean a(BlockPosition blockposition, boolean flag, Entity entity, int i) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
+
|
||||
|
|
|
@ -128,12 +128,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
||||
this.methodProfiler.exit();
|
||||
this.methodProfiler.exit();
|
||||
+ worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
||||
}
|
||||
this.methodProfiler.exit();
|
||||
this.methodProfiler.exit();
|
||||
+ worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
||||
}
|
||||
|
||||
this.methodProfiler.exitEnter("connection");
|
||||
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
|
||||
|
|
|
@ -8,14 +8,14 @@ diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/ma
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
|
||||
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
|
||||
return IChatBaseComponent.ChatSerializer.a.toJsonTree(ichatbasecomponent);
|
||||
}
|
||||
|
||||
+ @Nullable public static IChatBaseComponent jsonToComponent(String json) { return a(json);} // Paper - OBFHELPER
|
||||
@Nullable
|
||||
public static IChatBaseComponent a(String s) {
|
||||
return (IChatBaseComponent) ChatDeserializer.a(IChatBaseComponent.ChatSerializer.a, s, IChatBaseComponent.class, false);
|
||||
public static IChatMutableComponent a(String s) {
|
||||
return (IChatMutableComponent) ChatDeserializer.a(IChatBaseComponent.ChatSerializer.a, s, IChatMutableComponent.class, false);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
|
||||
|
|
|
@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- 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 {
|
||||
private final ItemCooldown bW;
|
||||
private final ItemCooldown bT;
|
||||
@Nullable
|
||||
public EntityFishingHook hookedFish;
|
||||
+ // Paper start
|
||||
|
@ -23,14 +23,14 @@ 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 {
|
||||
} else if (!this.isPersistent() && !this.I()) {
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.L()) {
|
||||
this.die();
|
||||
} else if (!this.isPersistent() && !this.isSpecialPersistence()) {
|
||||
- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||
+ EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, IEntitySelector.affectsSpawning); // Paper
|
||||
|
||||
- if (entityhuman != null) {
|
||||
+ if (entityhuman != null && entityhuman.affectsSpawning) { // Paper - Affects Spawning API
|
||||
double d0 = entityhuman.h(this);
|
||||
|
||||
if (d0 > world.paperConfig.hardDespawnDistance) { // CraftBukkit - remove isTypeNotPersistent() check // Paper - custom despawn distances
|
||||
if (entityhuman != null) {
|
||||
double d0 = entityhuman.h((Entity) this); // CraftBukkit - decompile error
|
||||
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
|
||||
|
@ -44,6 +44,80 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
} else {
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
||||
}
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- default EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate<Entity> predicate) {
|
||||
+ default EntityHuman findNearbyPlayer(Entity entity, double d0, @Nullable Predicate<Entity> predicate) { return this.findNearbyPlayer(entity.locX(), entity.locY(), entity.locZ(), d0, predicate); } // Paper
|
||||
+ @Nullable default EntityHuman findNearbyPlayer(double d0, double d1, double d2, double d3, @Nullable Predicate<Entity> predicate) { return a(d0, d1, d2, d3, predicate); } // Paper - OBFHELPER
|
||||
+ @Nullable default EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate<Entity> predicate) { // Paper
|
||||
double d4 = -1.0D;
|
||||
EntityHuman entityhuman = null;
|
||||
Iterator iterator = this.getPlayers().iterator();
|
||||
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
||||
return this.a(d0, d1, d2, d3, predicate);
|
||||
}
|
||||
|
||||
+ // Paper end
|
||||
+ default boolean isAffectsSpawningPlayerNearby(double d0, double d1, double d2, double d3) {
|
||||
+ Iterator iterator = this.getPlayers().iterator();
|
||||
+ double d4;
|
||||
+ do {
|
||||
+ EntityHuman entityhuman;
|
||||
+ do {
|
||||
+ if (!iterator.hasNext()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ entityhuman = (EntityHuman) iterator.next();
|
||||
+ } while (!IEntitySelector.affectsSpawning.test(entityhuman));
|
||||
+
|
||||
+ d4 = entityhuman.g(d0, d1, d2);
|
||||
+ } while (d3 >= 0.0D && d4 >= d3 * d3);
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
default boolean isPlayerNearby(double d0, double d1, double d2, double d3) {
|
||||
Iterator iterator = this.getPlayers().iterator();
|
||||
|
||||
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 {
|
||||
return !entity.isSpectator();
|
||||
};
|
||||
|
||||
+ // Paper start
|
||||
+ public static final Predicate<Entity> affectsSpawning = (entity) -> {
|
||||
+ return !entity.isSpectator() && entity.isAlive() && (entity instanceof EntityPlayer) && ((EntityPlayer) entity).affectsSpawning;
|
||||
+ };
|
||||
+ // Paper end
|
||||
+
|
||||
public static Predicate<Entity> a(double d0, double d1, double d2, double d3) {
|
||||
double d4 = d3 * d3;
|
||||
|
||||
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().isAffectsSpawningPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange); // Paper
|
||||
}
|
||||
|
||||
public void c() {
|
||||
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
|
||||
|
|
|
@ -8,8 +8,8 @@ diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/ma
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
||||
@@ -0,0 +0,0 @@ import com.google.common.collect.Lists;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
+import java.util.HashSet;
|
||||
|
|
|
@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -21);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
System.err.println("*** Error, this build is outdated ***");
|
||||
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");
|
||||
|
@ -73,7 +73,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
+
|
||||
System.out.println("Loading libraries, please wait...");
|
||||
MinecraftServer.main(options);
|
||||
net.minecraft.server.Main.main(options);
|
||||
} catch (Throwable t) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
|
|
@ -11,15 +11,6 @@ diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/m
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
private final ChunkSection[] sections;
|
||||
private BiomeStorage d;
|
||||
private final Map<BlockPosition, NBTTagCompound> e;
|
||||
- public boolean loaded;
|
||||
+ public boolean loaded; public boolean isLoaded() { return loaded; } // Paper - OBFHELPER
|
||||
public final World world;
|
||||
public final Map<HeightMap.Type, HeightMap> heightMap;
|
||||
private final ChunkConverter i;
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null);
|
||||
}
|
||||
|
@ -92,20 +83,11 @@ diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- 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 INamableTileEntity, ICommandListener, Ke
|
||||
private static final DataWatcherObject<Boolean> aB = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
|
||||
private static final DataWatcherObject<Boolean> aC = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
|
||||
protected static final DataWatcherObject<EntityPose> POSE = DataWatcher.a(Entity.class, DataWatcherRegistry.s);
|
||||
- public boolean inChunk;
|
||||
+ public boolean inChunk; public boolean isAddedToChunk() { return inChunk; } // Paper - OBFHELPER
|
||||
public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER
|
||||
public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER
|
||||
public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
}
|
||||
|
||||
public boolean isChunkLoaded() {
|
||||
- return world.isChunkLoaded((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4);
|
||||
- return world.isChunkLoaded((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4);
|
||||
+ return getCurrentChunk() != null;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -124,31 +106,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ */
|
||||
+ public Chunk getCurrentChunk() {
|
||||
+ final Chunk chunk = currentChunk != null ? currentChunk.get() : null;
|
||||
+ if (chunk != null && chunk.isLoaded()) {
|
||||
+ if (chunk != null && chunk.loaded) {
|
||||
+ return chunk;
|
||||
+ }
|
||||
+
|
||||
+ return !isAddedToChunk() ? null : ((ChunkProviderServer) world.chunkProvider).getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the chunk at the location, using the entities local cache if avail
|
||||
+ * Will only return null if the location specified is not loaded
|
||||
+ */
|
||||
+ public Chunk getCurrentChunkAt(int x, int z) {
|
||||
+ Chunk chunk = getCurrentChunk();
|
||||
+ if (chunk != null && getChunkX() == chunk.getPos().x && getChunkZ() == chunk.getPos().z) {
|
||||
+ return chunk;
|
||||
+ }
|
||||
+ return ((ChunkProviderServer) world.chunkProvider).getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ());
|
||||
+ }
|
||||
+ /**
|
||||
+ * Returns the chunk at the entities current location, using the entities local cache if avail
|
||||
+ * Ideally this is always the same as getCurrentChunk, but only becomes different in registration issues.
|
||||
+ * Will only return null if the location specified is not loaded
|
||||
+ */
|
||||
+ public Chunk getChunkAtLocation() {
|
||||
+ return getCurrentChunkAt((int)Math.floor(locX) >> 4, (int)Math.floor(locZ) >> 4);
|
||||
+ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ());
|
||||
+ }
|
||||
+
|
||||
private MinecraftKey entityKey;
|
||||
|
|
|
@ -717,10 +717,10 @@ diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/m
|
|||
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 implements IMaterial {
|
||||
protected final boolean q;
|
||||
protected final SoundEffectType stepSound;
|
||||
protected final Material material;
|
||||
@@ -0,0 +0,0 @@ public class Block extends BlockBase implements IMaterial {
|
||||
private static final VoxelShape c = a(7.0D, 0.0D, 7.0D, 9.0D, 10.0D, 9.0D);
|
||||
protected final BlockStateList<Block, IBlockData> blockStateList;
|
||||
private IBlockData blockData;
|
||||
+ // Paper start
|
||||
+ public co.aikar.timings.Timing timing;
|
||||
+ public co.aikar.timings.Timing getTiming() {
|
||||
|
@ -730,9 +730,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ return timing;
|
||||
+ }
|
||||
+ // Paper end
|
||||
protected final MaterialMapColor t;
|
||||
private final float frictionFactor;
|
||||
private final float f;
|
||||
@Nullable
|
||||
private String name;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
|
@ -794,49 +794,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.world.getMethodProfiler().exitEnter("unload");
|
||||
this.playerChunkMap.unloadChunks(booleansupplier);
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
// CraftBukkit end
|
||||
boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit
|
||||
|
||||
this.world.getMethodProfiler().enter("naturalSpawnCount");
|
||||
+ this.world.timings.countNaturalMobs.startTiming(); // Paper - timings
|
||||
int l = this.chunkMapDistance.b();
|
||||
EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
|
||||
Object2IntMap<EnumCreatureType> object2intmap = this.world.l();
|
||||
|
||||
SpawnerCreature.d spawnercreature_d = SpawnerCreature.a(l, this.world.z(), this::a);
|
||||
+ this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
||||
this.world.getMethodProfiler().exit();
|
||||
this.playerChunkMap.f().forEach((playerchunk) -> {
|
||||
Optional<Chunk> optional = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
Chunk chunk = (Chunk) optional.get();
|
||||
|
||||
this.p = spawnercreature_d;
|
||||
this.world.getMethodProfiler().exit();
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
|
||||
if (optional.isPresent()) {
|
||||
this.world.getMethodProfiler().enter("broadcast");
|
||||
+ this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
|
||||
playerchunk.a(chunk);
|
||||
playerchunk.a((Chunk) optional.get());
|
||||
+ this.world.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings
|
||||
this.world.getMethodProfiler().exit();
|
||||
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
||||
Optional<Chunk> optional1 = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
||||
if (!this.playerChunkMap.isOutsideOfRange(chunkcoordintpair)) {
|
||||
+ // Paper end
|
||||
chunk.setInhabitedTime(chunk.getInhabitedTime() + j);
|
||||
if (flag1 && (this.allowMonsters || this.allowAnimals) && this.world.getWorldBorder().isInBounds(chunk.getPos()) && !this.playerChunkMap.isOutsideOfRange(chunkcoordintpair, true)) { // Spigot
|
||||
this.world.getMethodProfiler().enter("spawner");
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
SpawnerCreature.a(this.world, chunk, spawnercreature_d, this.allowAnimals, this.allowMonsters, flag2);
|
||||
}
|
||||
|
||||
- this.world.timings.doTickTiles.startTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
this.world.a(chunk, k);
|
||||
- this.world.timings.doTickTiles.stopTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
- this.world.timings.doTickTiles.startTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
this.world.a(chunk, k);
|
||||
- this.world.timings.doTickTiles.stopTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.world.getMethodProfiler().enter("customSpawners");
|
||||
if (flag1) {
|
||||
+ try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
|
||||
this.chunkGenerator.doMobSpawning(this.world, this.allowMonsters, this.allowAnimals);
|
||||
this.world.doMobSpawning(this.allowMonsters, this.allowAnimals);
|
||||
+ } // Paper - timings
|
||||
}
|
||||
|
||||
|
@ -849,7 +843,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- this.world.timings.tracker.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
@Override
|
||||
private void a(long i, Consumer<Chunk> consumer) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
|
@ -886,7 +880,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
-
|
||||
}
|
||||
|
||||
private static NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair, Map<String, StructureStart> map, Map<String, LongSet> map1) {
|
||||
private static NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair, Map<StructureGenerator<?>, StructureStart<?>> map, Map<StructureGenerator<?>, LongSet> map1) {
|
||||
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/CustomFunction.java
|
||||
|
@ -918,28 +912,19 @@ diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/ma
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
|
||||
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
|
||||
@@ -0,0 +0,0 @@ public class CustomFunctionData implements IResourcePackListener {
|
||||
@@ -0,0 +0,0 @@ public class CustomFunctionData {
|
||||
} else {
|
||||
int j;
|
||||
|
||||
- try {
|
||||
+ try (co.aikar.timings.Timing timing = customfunction.getTiming().startTiming()) { // Paper
|
||||
this.h = true;
|
||||
this.d = true;
|
||||
int k = 0;
|
||||
CustomFunction.c[] acustomfunction_c = customfunction.b();
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -0,0 +0,0 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
+import java.util.concurrent.CompletableFuture;
|
||||
+import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -1044,7 +1029,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
|
||||
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
|
||||
if (this.noclip) {
|
||||
this.a(this.getBoundingBox().b(vec3d));
|
||||
this.a(this.getBoundingBox().c(vec3d));
|
||||
this.recalcPosition();
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
||||
|
@ -1053,7 +1038,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
protected BlockPosition ag() {
|
||||
protected BlockPosition ak() {
|
||||
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
|
||||
|
@ -1073,8 +1058,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public void tick() {
|
||||
- SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
|
||||
super.tick();
|
||||
this.o();
|
||||
this.r();
|
||||
this.u();
|
||||
this.x();
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
@ -1093,7 +1078,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
protected float f(float f, float f1) {
|
||||
private void q() {
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.setMot(d4, d5, d6);
|
||||
|
@ -1101,7 +1086,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- SpigotTimings.timerEntityAI.startTiming(); // Spigot
|
||||
if (this.isFrozen()) {
|
||||
this.jumping = false;
|
||||
this.aZ = 0.0F;
|
||||
this.aY = 0.0F;
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.doTick();
|
||||
this.world.getMethodProfiler().exit();
|
||||
|
@ -1111,15 +1096,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.world.getMethodProfiler().exit();
|
||||
this.world.getMethodProfiler().enter("jump");
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.n();
|
||||
this.t();
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox();
|
||||
|
||||
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
|
||||
this.e(new Vec3D((double) this.aZ, (double) this.ba, (double) this.bb));
|
||||
this.f(new Vec3D((double) this.aY, (double) this.aZ, (double) this.ba));
|
||||
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
|
||||
this.world.getMethodProfiler().exit();
|
||||
this.world.getMethodProfiler().enter("push");
|
||||
if (this.bn > 0) {
|
||||
if (this.bm > 0) {
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.a(axisalignedbb, this.getBoundingBox());
|
||||
}
|
||||
|
@ -1128,8 +1113,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.collideNearby();
|
||||
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide && this.dN() && this.aC()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
|
@ -1142,17 +1127,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import co.aikar.timings.MinecraftTimings; // Paper
|
||||
import org.spigotmc.SlackActivityAccountant; // Spigot
|
||||
|
||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable, Runnable {
|
||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
});
|
||||
});
|
||||
private long nextTick = SystemUtils.getMonotonicMillis();
|
||||
- private long ab;
|
||||
- private boolean ac;
|
||||
+ private long ab; final long getTickOversleepMaxTime() { return this.ab; } // Paper - OBFHELPER
|
||||
+ private boolean ac; final boolean hasExecutedTask() { return this.ac; } // Paper - OBFHELPER
|
||||
private final IReloadableResourceManager ae;
|
||||
private long T;
|
||||
public final Thread serverThread;
|
||||
private long nextTick;
|
||||
- private long W;
|
||||
- private boolean X;
|
||||
+ private long W;final long getTickOversleepMaxTime() { return this.W; } // Paper - OBFHELPER
|
||||
+ private boolean X; final boolean hasExecutedTask() { return this.X; } // Paper - OBFHELPER
|
||||
private final ResourcePackRepository<ResourcePackLoader> resourcePackRepository;
|
||||
private final ScoreboardServer scoreboardServer;
|
||||
@Nullable
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
@ -1167,7 +1152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
private boolean canSleepForTick() {
|
||||
// CraftBukkit start
|
||||
+ if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
|
||||
return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.ac ? this.ab : this.nextTick);
|
||||
return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.X ? this.W : this.nextTick);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
@ -1215,7 +1200,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
++this.ticks;
|
||||
this.b(booleansupplier);
|
||||
if (i - this.Z >= 5000000000L) {
|
||||
if (i - this.T >= 5000000000L) {
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
|
@ -1243,7 +1228,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
+
|
||||
this.methodProfiler.enter("tallying");
|
||||
long l = this.f[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i;
|
||||
long l = this.h[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i;
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.methodProfiler.exit();
|
||||
|
@ -1308,7 +1293,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.playerList.tick();
|
||||
- SpigotTimings.playerListTimer.stopTiming(); // Spigot
|
||||
+ MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
|
||||
if (SharedConstants.b) {
|
||||
if (SharedConstants.d) {
|
||||
GameTestHarnessTicker.a.b();
|
||||
}
|
||||
|
||||
|
@ -1441,7 +1426,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.player.lastY = this.player.locY();
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
||||
}
|
||||
- org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.stopTiming(); // Spigot
|
||||
|
||||
|
@ -1530,16 +1515,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/TickListServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/TickListServer.java
|
||||
@@ -0,0 +0,0 @@ public class TickListServer<T> implements TickList<T> {
|
||||
private final List<NextTickListEntry<T>> h = Lists.newArrayList();
|
||||
private final Consumer<NextTickListEntry<T>> i;
|
||||
private final List<NextTickListEntry<T>> g = Lists.newArrayList();
|
||||
private final Consumer<NextTickListEntry<T>> h;
|
||||
|
||||
- public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Function<MinecraftKey, T> function1, Consumer<NextTickListEntry<T>> consumer) {
|
||||
+ public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Function<MinecraftKey, T> function1, Consumer<NextTickListEntry<T>> consumer, String timingsType) { // Paper
|
||||
- public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Consumer<NextTickListEntry<T>> consumer) {
|
||||
+ public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Consumer<NextTickListEntry<T>> consumer, String timingsType) { // Paper
|
||||
this.a = predicate;
|
||||
this.b = function;
|
||||
this.c = function1;
|
||||
this.f = worldserver;
|
||||
this.i = consumer;
|
||||
this.e = worldserver;
|
||||
this.h = consumer;
|
||||
+ this.timingCleanup = co.aikar.timings.WorldTimingsHandler.getTickList(worldserver, timingsType + " - Cleanup");
|
||||
+ this.timingTicking = co.aikar.timings.WorldTimingsHandler.getTickList(worldserver, timingsType + " - Ticking");
|
||||
}
|
||||
|
@ -1551,7 +1535,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
int i = this.nextTickList.size();
|
||||
@@ -0,0 +0,0 @@ public class TickListServer<T> implements TickList<T> {
|
||||
|
||||
this.f.getMethodProfiler().enter("cleaning");
|
||||
this.e.getMethodProfiler().enter("cleaning");
|
||||
|
||||
+ this.timingCleanup.startTiming(); // Paper
|
||||
NextTickListEntry nextticklistentry;
|
||||
|
@ -1564,17 +1548,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ this.timingCleanup.stopTiming(); // Paper
|
||||
|
||||
+ this.timingTicking.startTiming(); // Paper
|
||||
this.f.getMethodProfiler().exitEnter("ticking");
|
||||
this.e.getMethodProfiler().exitEnter("ticking");
|
||||
|
||||
while ((nextticklistentry = (NextTickListEntry) this.g.poll()) != null) {
|
||||
while ((nextticklistentry = (NextTickListEntry) this.f.poll()) != null) {
|
||||
@@ -0,0 +0,0 @@ public class TickListServer<T> implements TickList<T> {
|
||||
}
|
||||
}
|
||||
|
||||
this.f.getMethodProfiler().exit();
|
||||
+ this.timingTicking.stopTiming(); // Paper
|
||||
this.h.clear();
|
||||
this.e.getMethodProfiler().exit();
|
||||
this.g.clear();
|
||||
}
|
||||
this.f.clear();
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
|
@ -1598,20 +1582,11 @@ diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/m
|
|||
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 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+import co.aikar.timings.Timing;
|
||||
+import co.aikar.timings.Timings;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.util.Supplier;
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||
+import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.block.CapturedBlockState;
|
||||
|
@ -1654,10 +1629,10 @@ diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
+import co.aikar.timings.TimingHistory; // Paper
|
||||
+import co.aikar.timings.Timings; // Paper
|
||||
import com.google.common.collect.Lists;
|
||||
|
@ -1669,69 +1644,54 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import org.bukkit.WeatherType;
|
||||
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.util.WorldUUID;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.server.MapInitializeEvent;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
// CraftBukkit end
|
||||
this.nextTickListBlock = new TickListServer<>(this, (block) -> {
|
||||
return block == null || block.getBlockData().isAir();
|
||||
- }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b);
|
||||
+ }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings
|
||||
- }, IRegistry.BLOCK::getKey, this::b);
|
||||
+ }, IRegistry.BLOCK::getKey, this::b, "Blocks"); // Paper - Timings
|
||||
this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> {
|
||||
return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
- }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a);
|
||||
+ }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings
|
||||
- }, IRegistry.FLUID::getKey, this::a);
|
||||
+ }, IRegistry.FLUID::getKey, this::a, "Fluids"); // Paper - Timings
|
||||
this.navigators = Sets.newHashSet();
|
||||
this.I = new ObjectLinkedOpenHashSet();
|
||||
this.dataManager = worldnbtstorage;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
this.L = new ObjectLinkedOpenHashSet();
|
||||
this.Q = flag1;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
this.N();
|
||||
this.a();
|
||||
this.b();
|
||||
gameprofilerfiller.exitEnter("chunkSource");
|
||||
+ this.timings.chunkProviderTick.startTiming(); // Paper - timings
|
||||
this.getChunkProvider().tick(booleansupplier);
|
||||
+ this.timings.chunkProviderTick.stopTiming(); // Paper - timings
|
||||
gameprofilerfiller.exitEnter("tickPending");
|
||||
- timings.doTickPending.startTiming(); // Spigot
|
||||
+ timings.scheduledBlocks.startTiming(); // Spigot
|
||||
if (this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
+ timings.scheduledBlocks.startTiming(); // Paper
|
||||
if (!this.isDebugWorld()) {
|
||||
this.nextTickListBlock.b();
|
||||
this.nextTickListFluid.b();
|
||||
}
|
||||
- timings.doTickPending.stopTiming(); // Spigot
|
||||
+ timings.scheduledBlocks.stopTiming(); // Spigot
|
||||
+ timings.scheduledBlocks.stopTiming(); // Paper
|
||||
|
||||
gameprofilerfiller.exitEnter("raid");
|
||||
+ this.timings.raids.startTiming(); // Paper - timings
|
||||
this.persistentRaid.a();
|
||||
if (this.mobSpawnerTrader != null) {
|
||||
this.mobSpawnerTrader.a();
|
||||
}
|
||||
+ this.timings.raids.stopTiming(); // Paper - timings
|
||||
|
||||
gameprofilerfiller.exitEnter("blockEvents");
|
||||
timings.doSounds.startTiming(); // Spigot
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
this.ah();
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
timings.entityTick.startTiming(); // Spigot
|
||||
+ TimingHistory.entityTicks += this.globalEntityList.size(); // Paper
|
||||
while (objectiterator.hasNext()) {
|
||||
Entry<Entity> entry = (Entry) objectiterator.next();
|
||||
Entity entity1 = (Entity) entry.getValue();
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
||||
this.tickingEntities = false;
|
||||
|
||||
+ try (co.aikar.timings.Timing ignored = this.timings.newEntities.startTiming()) { // Paper - timings
|
||||
while ((entity = (Entity) this.entitiesToAdd.poll()) != null) {
|
||||
this.registerEntity(entity);
|
||||
}
|
||||
+ } // Paper - timings
|
||||
|
||||
gameprofilerfiller.exit();
|
||||
timings.tickEntities.stopTiming(); // Spigot
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
Entity entity = (Entity) entry.getValue();
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
|
||||
gameprofilerfiller.exitEnter("tickBlocks");
|
||||
|
@ -1739,7 +1699,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
if (i > 0) {
|
||||
ChunkSection[] achunksection = chunk.getSections();
|
||||
int l = achunksection.length;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1748,25 +1708,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
gameprofilerfiller.exit();
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
||||
public void entityJoinedWorld(Entity entity) {
|
||||
if (entity instanceof EntityHuman || this.getChunkProvider().a(entity)) {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
if (!(entity instanceof EntityHuman) && !this.getChunkProvider().a(entity)) {
|
||||
this.chunkCheck(entity);
|
||||
} else {
|
||||
+ ++TimingHistory.entityTicks; // Paper - timings
|
||||
// Spigot start
|
||||
if (!org.spigotmc.ActivationRange.checkIfActive(entity)) {
|
||||
entity.ticksLived++;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
return;
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
+ TimingHistory.activatedEntityTicks++; // Paper - timings
|
||||
entity.tickTimer.startTiming(); // Spigot
|
||||
+ try { // Paper - timings
|
||||
entity.f(entity.locX(), entity.locY(), entity.locZ());
|
||||
entity.lastYaw = entity.yaw;
|
||||
entity.lastPitch = entity.pitch;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
this.a(entity, entity1);
|
||||
}
|
||||
}
|
||||
|
@ -1776,16 +1736,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
if (!flag1) {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
|
||||
+ try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
|
||||
if (iprogressupdate != null) {
|
||||
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
|
||||
iprogressupdate.a(new ChatMessage("menu.savingLevel"));
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
iprogressupdate.c(new ChatMessage("menu.savingChunks", new Object[0]));
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
iprogressupdate.c(new ChatMessage("menu.savingChunks"));
|
||||
}
|
||||
|
||||
+ timings.worldSaveChunks.startTiming(); // Paper
|
||||
|
@ -1843,6 +1803,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
-import net.minecraft.server.Entity;
|
||||
-import net.minecraft.server.TileEntity;
|
||||
-import net.minecraft.server.World;
|
||||
-import net.minecraft.server.WorldDataServer;
|
||||
-import org.bukkit.craftbukkit.scheduler.CraftTask;
|
||||
-import org.bukkit.plugin.java.JavaPluginLoader;
|
||||
-import org.bukkit.scheduler.BukkitTask;
|
||||
|
@ -1973,7 +1934,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- public final CustomTimingsHandler syncChunkLoadPostTimer;
|
||||
-
|
||||
- public WorldTimingsHandler(World server) {
|
||||
- String name = server.worldData.getName() +" - ";
|
||||
- String name = ((WorldDataServer) server.worldData).getName() + " - ";
|
||||
-
|
||||
- mobSpawn = new CustomTimingsHandler("** " + name + "mobSpawn");
|
||||
- doChunkUnload = new CustomTimingsHandler("** " + name + "doChunkUnload");
|
||||
|
@ -2137,11 +2098,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
// Paper end
|
||||
|
||||
- CraftTask(final Plugin plugin, final Object task, final int id, final long period) {
|
||||
+ CraftTask(final Plugin plugin, final Object task, final int id, final long period) { // Paper
|
||||
this.plugin = plugin;
|
||||
if (task instanceof Runnable) {
|
||||
this.rTask = (Runnable) task;
|
||||
@@ -0,0 +0,0 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
||||
}
|
||||
this.id = id;
|
||||
|
|
Loading…
Reference in a new issue