Updated Upstream (Bukkit/CraftBukkit/Spigot)

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Warning: this commit contains more mapping changes from upstream, As always, ensure that you
have working backups and test this build before deployment; Developers working on paper will,
yet again, need to delete their work/Minecraft/1.13.2 folder

Bukkit Changes:
7fca5fd4 SPIGOT-4558: Preserve user order in the face of copied defaults in configurations
15c9b1eb Ignore spurious slot IDs sent by client, e.g. in enchanting tables
5d2a10c5 SPIGOT-3747: Add API for force loaded chunks
d6dd2bb3 SPIGOT-3538: Add getHitBlockFace for ProjectileHitEvent
771db4aa SPIGOT-794: Call EntityPlaceEvent for Minecart placement
55462509 Add InventoryView#getSlotType
2f3ce5b6 Remove EntityTransformEvent and CustomItemTagContainer from draft API
f04ad7b6 Make ProjectileLaunchEvent extend EntitySpawnEvent
ccb85808 Define EntitySpawnEvent
b8cc3ebe Add PlayerItemDamageEvent
184a495d Ease ClassLoader Deadlocks Where Possible
11ac4728 Expand Boolean Prompt Values in Conversation API
aae62d51 Added getAllSessionData() to the Conversation API.
9290ff91 Add InventoryView#getInventory API
995e530f Add API to get / set base arrow damage

CraftBukkit Changes:
c4a67eed SPIGOT-4556: Fix plugins closing inventory during drop events
5be2ddcb Replace version constants with methods to prevent compiler inlining
a5b9c7b3 Use API method to create offset command completions
2bc7d1df SPIGOT-3747: Add API for force loaded chunks
a408f375 SPIGOT-3538: Add getHitBlockFace for ProjectileHitEvent
b54b9409 SPIGOT-2864: Make Arrow / Item setTicksLived behave like FallingBlock
79ded7a8 SPIGOT-1811: Death message not shown on respawn screen
b4a4f15d SPIGOT-943: InventoryCloseEvent called on death regardless of open inventory
0afed592 SPIGOT-794: Call EntityPlaceEvent for Minecart placement
2b2d084a Add InventoryView#getSlotType
01a9959a Do not use deprecated ItemSpawnEvent constructor
9642498d SPIGOT-4547: Call EntitySpawnEvent as general spawn fallback event
963f4a5f Add PlayerItemDamageEvent
63db0445 Add API to get / set base arrow damage
531c25d7 Add CraftMagicNumbers.MAPPINGS_VERSION for use by NMS plugins
d05c8b14 Mappings Update
bd36e200 SPIGOT-4551: Ignore invalid attribute modifier slots

Spigot Changes:
518206a1 Remove redundant trove depend
1959ad21 MC-11211,SPIGOT-4552: Fix placing double slabs at y = 255
29ab5e43 SPIGOT-3661: Allow arguments in restart-script
7cc46316 SPIGOT-852: Growth modifiers for beetroots, potatoes, carrots
82e117e1 Squelch "fatal: Resolve operation not in progress" message
0a1a68e7 Mappings Update & Patch Rebuild
This commit is contained in:
Shane Freeder
2019-01-01 03:15:55 +00:00
parent 8ef9dc94ca
commit 08b01ae4df
363 changed files with 1838 additions and 2537 deletions

View File

@@ -458,7 +458,7 @@ index 000000000..8f18c2869
+
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 25e49de19..8246194df 100644
index 71d865b76..6d3f5b651 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 {
@@ -562,7 +562,7 @@ index 2021c0d02..154ab09e0 100644
public void putAll(Map<? extends Long, ? extends Chunk> map) {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index b9f8a86aa..4fe173cfb 100644
index fce3f673d..7b460d7dd 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@@ -712,7 +712,7 @@ index b9f8a86aa..4fe173cfb 100644
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index c12db3cfa..6cacacb0b 100644
index f3e766967..c70308198 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@@ -739,7 +739,7 @@ index c12db3cfa..6cacacb0b 100644
completion = new Supplier<NBTTagCompound>() {
public NBTTagCompound get() {
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index bdfc7d81f..a5c4564d6 100644
index 2af07ae59..9c6844d44 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -0,0 +0,0 @@ public class ChunkSection {
@@ -759,18 +759,18 @@ index bdfc7d81f..a5c4564d6 100644
+ // Paper end
public IBlockData getType(int i, int j, int k) {
return this.blockIds.a(i, j, k);
return (IBlockData) this.blockIds.a(i, j, k);
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
index ad7e4a036..f10f235ed 100644
index d3898599f..8f061f5ca 100644
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
@@ -0,0 +0,0 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
private final ChunkGenerator<?> d;
private final IChunkLoader e;
private final IAsyncTaskHandler f;
- private final Long2ObjectMap<Scheduler.a> progressCache = new ExpiringMap<Scheduler.a>(8192, 5000) { // CraftBukkit - decompile error
+ final Long2ObjectMap<Scheduler.a> progressCache = new ExpiringMap<Scheduler.a>(8192, 5000) { // CraftBukkit - decompile error // Paper - protected
protected boolean a(Scheduler.a scheduler_a) {
- private final Long2ObjectMap<Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a> progressCache = new ExpiringMap<Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a>(8192, 5000) {
+ protected final Long2ObjectMap<Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a> progressCache = new ExpiringMap<Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a>(8192, 5000) { // Paper - protected
protected boolean a(Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a scheduler_a) {
ProtoChunk protochunk = (ProtoChunk) scheduler_a.a();
return !protochunk.ab_() /*&& !protochunk.h()*/; // Paper
@@ -781,7 +781,7 @@ index ad7e4a036..f10f235ed 100644
public ChunkTaskScheduler(int i, World world, ChunkGenerator<?> chunkgenerator, IChunkLoader ichunkloader, IAsyncTaskHandler iasynctaskhandler) {
super("WorldGen", i, ChunkStatus.FINALIZED, () -> {
@@ -0,0 +0,0 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
protected Scheduler.a a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
protected Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
IChunkLoader ichunkloader = this.e;
- synchronized (this.e) {
@@ -832,7 +832,7 @@ index ad7e4a036..f10f235ed 100644
protected ProtoChunk a(ChunkCoordIntPair chunkcoordintpair, ChunkStatus chunkstatus, Map<ChunkCoordIntPair, ProtoChunk> map) {
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 71a3636be..ff0fe2541 100644
index 454903a0e..dcbcb655c 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -0,0 +0,0 @@ package net.minecraft.server;
@@ -868,12 +868,13 @@ index 71a3636be..ff0fe2541 100644
- private void b() {
- if (this.j.isLocked() && !this.j.isHeldByCurrentThread()) {
- String s = (String)Thread.getAllStackTraces().keySet().stream().filter(Objects::nonNull).map((thread) -> {
- return thread.getName() + ": \n\tat " + (String)Arrays.stream(thread.getStackTrace()).map(Object::toString).collect(Collectors.joining("\n\tat "));
- String s = (String) Thread.getAllStackTraces().keySet().stream().filter(Objects::nonNull).map((thread) -> {
- return thread.getName() + ": \n\tat " + (String) Arrays.stream(thread.getStackTrace()).map(Object::toString).collect(Collectors.joining("\n\tat "));
- }).collect(Collectors.joining("\n"));
- CrashReport crashreport = new CrashReport("Writing into PalettedContainer from multiple threads", new IllegalStateException());
- CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Thread dumps");
- crashreportsystemdetails.a("Thread dumps", s);
-
- crashreportsystemdetails.a("Thread dumps", (Object) s);
- throw new ReportedException(crashreport);
- } else {
- this.j.lock();
@@ -889,6 +890,7 @@ index 71a3636be..ff0fe2541 100644
+ readLock = NOOP_LOCK;
+ writeLock = NOOP_LOCK;
+ }
+
+ private void b() {
+ writeLock.lock();
+ }
@@ -898,17 +900,18 @@ index 71a3636be..ff0fe2541 100644
}
+ // Paper end
public DataPaletteBlock(DataPalette<T> datapalette, RegistryBlockID<T> registryblockid, Function<NBTTagCompound, T> function, Function<T, NBTTagCompound> function1, T object) {
public DataPaletteBlock(DataPalette<T> datapalette, RegistryBlockID<T> registryblockid, Function<NBTTagCompound, T> function, Function<T, NBTTagCompound> function1, T t0) {
// Paper start - Anti-Xray - Support default constructor
@@ -0,0 +0,0 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> {
}
protected T a(int ix) {
- T object = this.h.a(this.a.a(ix)); // Paper - decompile fix
- return (T)(object == null ? this.g : object);
protected T a(int i) {
- T t0 = this.h.a(this.a.a(i));
-
- return t0 == null ? this.g : t0;
+ try { // Paper start - read lock
+ readLock.lock();
+ T object = this.h.a(this.a.a(ix)); // Paper - decompile fix
+ T object = this.h.a(this.a.a(i)); // Paper - decompile fix
+ return (T)(object == null ? this.g : object);
+ } finally {
+ readLock.unlock();
@@ -917,12 +920,12 @@ index 71a3636be..ff0fe2541 100644
// Paper start - Anti-Xray - Support default methods
diff --git a/src/main/java/net/minecraft/server/DefinedStructureManager.java b/src/main/java/net/minecraft/server/DefinedStructureManager.java
index 271dc41d4..bd15534c2 100644
index f5a6387f2..f45685099 100644
--- a/src/main/java/net/minecraft/server/DefinedStructureManager.java
+++ b/src/main/java/net/minecraft/server/DefinedStructureManager.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
public class DefinedStructureManager implements IResourcePackListener {
private static final Logger a = LogManager.getLogger();
- private final Map<MinecraftKey, DefinedStructure> b = Maps.newHashMap();
+ private final Map<MinecraftKey, DefinedStructure> b = Maps.newConcurrentMap(); // Paper
@@ -930,7 +933,7 @@ index 271dc41d4..bd15534c2 100644
private final MinecraftServer d;
private final java.nio.file.Path e;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index ef5a21505..93171edb4 100644
index 11d5c2655..80e395b1a 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
@@ -956,19 +959,28 @@ index 4698ee99f..dfb45cc4e 100644
Chunk a(GeneratorAccess generatoraccess, int i, int j, Consumer<Chunk> consumer) throws IOException;
diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java
index 49fba0979..9ad646f8d 100644
index 8bb2593aa..67bb28954 100644
--- a/src/main/java/net/minecraft/server/MathHelper.java
+++ b/src/main/java/net/minecraft/server/MathHelper.java
@@ -0,0 +0,0 @@ import java.util.function.IntPredicate;
public class MathHelper {
public static final float a = c(2.0F);
- private static final float[] b = (float[]) SystemUtils.a((Object) (new float[65536]), (afloat) -> {
+ private static final float[] b = (float[]) SystemUtils.a((new float[65536]), (afloat) -> { // Paper - Decompile fix
for (int i = 0; i < afloat.length; ++i) {
afloat[i] = (float) Math.sin((double) i * 3.141592653589793D * 2.0D / 65536.0D);
}
@@ -0,0 +0,0 @@ public class MathHelper {
return Math.floorMod(i, j);
}
+ public static float normalizeYaw(float fx) { return g(fx); } // Paper - OBFHELPER
public static float g(float fx) {
fx = fx % 360.0F;
if (fx >= 180.0F) {
public static float g(float f) {
f %= 360.0F;
if (f >= 180.0F) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 63b5cdd41..32aee07d1 100644
index d0be8d2fb..84d588122 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@@ -983,25 +995,25 @@ index 63b5cdd41..32aee07d1 100644
}
BlockPosition blockposition = worldserver.getSpawn();
- ArrayList arraylist = Lists.newArrayList();
+ List<ChunkCoordIntPair> arraylist = worldserver.getChunkProvider().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper
Set set = Sets.newConcurrentHashSet();
- List<ChunkCoordIntPair> list = Lists.newArrayList();
+ List<ChunkCoordIntPair> list = worldserver.getChunkProvider().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper
Set<ChunkCoordIntPair> set = Sets.newConcurrentHashSet();
- // Paper start
- short radius = worldserver.paperConfig.keepLoadedRange;
- for (int i = -radius; i <= radius && this.isRunning(); i += 16) {
- for (int j = -radius; j <= radius && this.isRunning(); j += 16) {
- // Paper end
- arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
- list.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
- }
- } // Paper
+ // Paper - remove arraylist creation, call spiral above
if (this.isRunning()) { // Paper
int expected = arraylist.size(); // Paper
int expected = list.size(); // Paper
- CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> {
+ CompletableFuture completablefuture = worldserver.getChunkProvider().loadAllChunks((Iterable) arraylist, (chunk) -> { // Paper
-
- CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) list, (chunk) -> {
+ CompletableFuture completablefuture = worldserver.getChunkProvider().loadAllChunks(list, (chunk) -> { // Paper
set.add(chunk.getPos());
- if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper
+ if (waitForChunks && (set.size() == expected || (set.size() < expected && set.size() % (set.size() / 10) == 0))) {
@@ -1718,7 +1730,7 @@ index 000000000..e9a38f9d9
+
+}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index b58683e6f..e61538b3c 100644
index 240f59066..e4cf8548d 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -0,0 +0,0 @@ public class PlayerChunk {
@@ -1772,15 +1784,16 @@ index b58683e6f..e61538b3c 100644
+ return Math.sqrt((x * x) + (z * z));
+ }
public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) {
public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) {
this.playerChunkMap = playerchunkmap;
this.location = new ChunkCoordIntPair(ix, j);
@@ -0,0 +0,0 @@ public class PlayerChunk {
ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider();
chunkproviderserver.a(ix, j);
- this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false);
- this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper
+ this.chunk = chunkproviderserver.getChunkAt(ix, j, false, false); // Paper
+ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(ix, j); // Paper
chunkproviderserver.a(i, j);
- this.chunk = chunkproviderserver.getChunkAt(i, j, true, false);
- this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper
+ this.chunk = chunkproviderserver.getChunkAt(i, j, false, false); // Paper
+ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(i, j); // Paper
markChunkUsed(); // Paper - delay chunk unloads
}
@@ -1815,7 +1828,7 @@ index b58683e6f..e61538b3c 100644
}
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 27343174d..77b36ff89 100644
index 679488a3c..b7dda8e28 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap {
@@ -1875,7 +1888,7 @@ index 27343174d..77b36ff89 100644
private void e() {
diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
index d0b3e43c0..eb7f03898 100644
index de6dd4fed..da6df06d8 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 {
@@ -1888,7 +1901,7 @@ index d0b3e43c0..eb7f03898 100644
this.m = world.getChunkProvider().getChunkGenerator().getSettings();
this.i = world.getSeaLevel();
diff --git a/src/main/java/net/minecraft/server/SchedulerBatch.java b/src/main/java/net/minecraft/server/SchedulerBatch.java
index d868149d1..0d45d933e 100644
index 8e909d9ca..f214a74a2 100644
--- a/src/main/java/net/minecraft/server/SchedulerBatch.java
+++ b/src/main/java/net/minecraft/server/SchedulerBatch.java
@@ -0,0 +0,0 @@ public class SchedulerBatch<K, T extends SchedulerTask<K, T>, R> {
@@ -1916,7 +1929,7 @@ index d868149d1..0d45d933e 100644
}
+ public CompletableFuture<R> add(K k0) { return a(k0); } // Paper - OBFHELPER
public CompletableFuture<R> a(K object) {
public CompletableFuture<R> a(K k0) {
if (!this.c) {
throw new RuntimeException("Batch not properly started. Please use startBatch to create a new batch.");
@@ -0,0 +0,0 @@ public class SchedulerBatch<K, T extends SchedulerTask<K, T>, R> {
@@ -1943,7 +1956,7 @@ index d868149d1..0d45d933e 100644
}
}
diff --git a/src/main/java/net/minecraft/server/StructurePiece.java b/src/main/java/net/minecraft/server/StructurePiece.java
index 510543db4..ce9e5d4e0 100644
index d9def7135..945a005e9 100644
--- a/src/main/java/net/minecraft/server/StructurePiece.java
+++ b/src/main/java/net/minecraft/server/StructurePiece.java
@@ -0,0 +0,0 @@ public abstract class StructurePiece {
@@ -1953,41 +1966,53 @@ index 510543db4..ce9e5d4e0 100644
- private static final Set<Block> d = ImmutableSet.builder().add(Blocks.NETHER_BRICK_FENCE).add(Blocks.TORCH).add(Blocks.WALL_TORCH).add(Blocks.OAK_FENCE).add(Blocks.SPRUCE_FENCE).add(Blocks.DARK_OAK_FENCE).add(Blocks.ACACIA_FENCE).add(Blocks.BIRCH_FENCE).add(Blocks.JUNGLE_FENCE).add(Blocks.LADDER).add(Blocks.IRON_BARS).build();
+ private static final Set<Block> d = ImmutableSet.<Block>builder().add(Blocks.NETHER_BRICK_FENCE).add(Blocks.TORCH).add(Blocks.WALL_TORCH).add(Blocks.OAK_FENCE).add(Blocks.SPRUCE_FENCE).add(Blocks.DARK_OAK_FENCE).add(Blocks.ACACIA_FENCE).add(Blocks.BIRCH_FENCE).add(Blocks.JUNGLE_FENCE).add(Blocks.LADDER).add(Blocks.IRON_BARS).build(); // Paper - decompile error
public StructurePiece() {
}
public StructurePiece() {}
@@ -0,0 +0,0 @@ public abstract class StructurePiece {
}
public static StructurePiece a(List<StructurePiece> list, StructureBoundingBox structureboundingbox) {
- for(StructurePiece structurepiece : list) {
+ synchronized (list) { for(StructurePiece structurepiece : list) { // Paper - synchronize main structure list
if (structurepiece.d() != null && structurepiece.d().a(structureboundingbox)) {
return structurepiece;
}
- }
+ }} // Paper
+ StructurePiece structurepiece; // Paper
+ synchronized (list) { // Paper - synchronize main structure list
Iterator iterator = list.iterator();
return null;
- StructurePiece structurepiece;
+ //StructurePiece structurepiece; // Paper - move up
do {
if (!iterator.hasNext()) {
@@ -0,0 +0,0 @@ public abstract class StructurePiece {
structurepiece = (StructurePiece) iterator.next();
} while (structurepiece.d() == null || !structurepiece.d().a(structureboundingbox));
-
+ } // Paper
return structurepiece;
}
diff --git a/src/main/java/net/minecraft/server/StructureStart.java b/src/main/java/net/minecraft/server/StructureStart.java
index 1926c902a..1117e4ae2 100644
index 284e96710..8b08efe1f 100644
--- a/src/main/java/net/minecraft/server/StructureStart.java
+++ b/src/main/java/net/minecraft/server/StructureStart.java
@@ -0,0 +0,0 @@ import java.util.List;
import java.util.Random;
@@ -0,0 +0,0 @@ import java.util.Random;
public abstract class StructureStart {
- protected final List<StructurePiece> a = Lists.newArrayList();
+ protected final List<StructurePiece> a = java.util.Collections.synchronizedList(Lists.newArrayList()); // Paper
protected StructureBoundingBox b;
protected int c;
protected int d;
@@ -0,0 +0,0 @@ public abstract class StructureStart {
protected void a(IBlockAccess var1) {
this.b = StructureBoundingBox.a();
- for(StructurePiece structurepiece : this.a) {
+ synchronized (this.a) {for(StructurePiece structurepiece : this.a) { // Paper - synchronize
protected void a(IBlockAccess iblockaccess) {
this.b = StructureBoundingBox.a();
+ synchronized (this.a) { // Paper - synchronize
Iterator iterator = this.a.iterator();
while (iterator.hasNext()) {
StructurePiece structurepiece = (StructurePiece) iterator.next();
this.b.b(structurepiece.d());
- }
+ }} // Paper
@@ -1996,10 +2021,14 @@ index 1926c902a..1117e4ae2 100644
@@ -0,0 +0,0 @@ public abstract class StructureStart {
int l = k - this.b.e;
this.b.a(0, l, 0);
- for(StructurePiece structurepiece : this.a) {
+ synchronized (this.a) {for(StructurePiece structurepiece : this.a) { // Paper - synchronize
this.b.a(0, l, 0);
+ synchronized (this.a) { // Paper - synchronize
Iterator iterator = this.a.iterator();
while (iterator.hasNext()) {
StructurePiece structurepiece = (StructurePiece) iterator.next();
structurepiece.a(0, l, 0);
- }
+ }} // Paper
@@ -2008,10 +2037,14 @@ index 1926c902a..1117e4ae2 100644
@@ -0,0 +0,0 @@ public abstract class StructureStart {
int i1 = l - this.b.b;
this.b.a(0, i1, 0);
- for(StructurePiece structurepiece : this.a) {
+ synchronized (this.a) {for(StructurePiece structurepiece : this.a) { // Paper - synchronize
this.b.a(0, i1, 0);
+ synchronized (this.a) {
Iterator iterator = this.a.iterator();
while (iterator.hasNext()) {
StructurePiece structurepiece = (StructurePiece) iterator.next();
structurepiece.a(0, i1, 0);
- }
+ }} // Paper
@@ -2019,7 +2052,7 @@ index 1926c902a..1117e4ae2 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index cb09e1052..cd31792b7 100644
index f48d5d9f7..b5b0fcf8c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -2116,13 +2149,13 @@ index cb09e1052..cd31792b7 100644
if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java
index fa99fe014..4f49786aa 100644
index 69d8a25bd..d0eaa9e9f 100644
--- a/src/main/java/net/minecraft/server/WorldGenStronghold.java
+++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java
@@ -0,0 +0,0 @@ import java.util.Random;
import javax.annotation.Nullable;
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrongholdConfiguration> {
- private boolean b;
- private ChunkCoordIntPair[] c;
- private long d;
@@ -2132,10 +2165,9 @@ index fa99fe014..4f49786aa 100644
+ //private long d;
+ // Paper end
public WorldGenStronghold() {
}
public WorldGenStronghold() {}
protected boolean a(ChunkGenerator<?> chunkgenerator, Random var2, int i, int j) {
protected boolean a(ChunkGenerator<?> chunkgenerator, Random random, int i, int j) {
- if (this.d != chunkgenerator.getSeed()) {
+ // Paper start
+ /*if (this.d != chunkgenerator.getSeed()) {
@@ -2153,11 +2185,11 @@ index fa99fe014..4f49786aa 100644
+ }} // Paper
+ // Paper end
- for(ChunkCoordIntPair chunkcoordintpair : this.c) {
+ for(ChunkCoordIntPair chunkcoordintpair : chunkgenerator.getWorld().strongholdCoords) { // Paper
if (i == chunkcoordintpair.x && j == chunkcoordintpair.z) {
return true;
}
- ChunkCoordIntPair[] achunkcoordintpair = this.c;
+ ChunkCoordIntPair[] achunkcoordintpair = chunkgenerator.getWorld().strongholdCoords; // Paper
int k = achunkcoordintpair.length;
for (int l = 0; l < k; ++l) {
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
}
@@ -2193,77 +2225,84 @@ index fa99fe014..4f49786aa 100644
+ // Paper end
BlockPosition blockposition1 = null;
BlockPosition.MutableBlockPosition blockposition$mutableblockposition = new BlockPosition.MutableBlockPosition(0, 0, 0);
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(0, 0, 0);
double d0 = Double.MAX_VALUE;
+ // Paper start
+ /*
ChunkCoordIntPair[] achunkcoordintpair = this.c;
int j = achunkcoordintpair.length;
- for(ChunkCoordIntPair chunkcoordintpair : this.c) {
+ for(ChunkCoordIntPair chunkcoordintpair : chunkgenerator.getWorld().strongholdCoords) { // Paper
blockposition$mutableblockposition.c((chunkcoordintpair.x << 4) + 8, 32, (chunkcoordintpair.z << 4) + 8);
double d1 = blockposition$mutableblockposition.n(blockposition);
if (blockposition1 == null) {
for (int k = 0; k < j; ++k) {
- ChunkCoordIntPair chunkcoordintpair = achunkcoordintpair[k];
+ */
+ for (ChunkCoordIntPair chunkcoordintpair : world.strongholdCoords) {
+ // Paper end
blockposition_mutableblockposition.c((chunkcoordintpair.x << 4) + 8, 32, (chunkcoordintpair.z << 4) + 8);
double d1 = blockposition_mutableblockposition.n(blockposition);
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
}
private void a(ChunkGenerator<?> chunkgenerator) {
- this.d = chunkgenerator.getSeed();
+ //this.d = chunkgenerator.getSeed(); // Paper
ArrayList arraylist = Lists.newArrayList();
List<BiomeBase> list = Lists.newArrayList();
Iterator iterator = IRegistry.BIOME.iterator();
for(BiomeBase biomebase : IRegistry.BIOME) {
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
int i2 = chunkgenerator.getSettings().e();
int j2 = chunkgenerator.getSettings().f();
int i = chunkgenerator.getSettings().g();
- this.c = new ChunkCoordIntPair[j2];
+ ChunkCoordIntPair[] strongholdCoords = chunkgenerator.getWorld().strongholdCoords = new ChunkCoordIntPair[j2]; // Paper
int j = 0;
Long2ObjectMap long2objectmap = chunkgenerator.getStructureStartCache(this);
synchronized(long2objectmap) {
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
int j = chunkgenerator.getSettings().f();
int k = chunkgenerator.getSettings().g();
while(objectiterator.hasNext()) {
StructureStart structurestart = (StructureStart)objectiterator.next();
- if (j < this.c.length) {
- this.c[j++] = new ChunkCoordIntPair(structurestart.e(), structurestart.f());
+ if (j < strongholdCoords.length) { // Paper
+ strongholdCoords[j++] = new ChunkCoordIntPair(structurestart.e(), structurestart.f()); // Paper
- this.c = new ChunkCoordIntPair[j];
+ ChunkCoordIntPair[] strongholdCoords = chunkgenerator.getWorld().strongholdCoords = new ChunkCoordIntPair[j]; // Paper
int l = 0;
Long2ObjectMap<StructureStart> long2objectmap = chunkgenerator.getStructureStartCache(this);
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
while (objectiterator.hasNext()) {
StructureStart structurestart = (StructureStart) objectiterator.next();
- if (l < this.c.length) {
- this.c[l++] = new ChunkCoordIntPair(structurestart.e(), structurestart.f());
+ if (l < strongholdCoords.length) { // Paper
+ strongholdCoords[l++] = new ChunkCoordIntPair(structurestart.e(), structurestart.f()); // Paper
}
}
}
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
random.setSeed(chunkgenerator.getSeed());
double d1 = random.nextDouble() * Math.PI * 2.0D;
int k = long2objectmap.size();
- if (k < this.c.length) {
+ if (k < strongholdCoords.length) { // Paper
int l = 0;
int i1 = 0;
double d0 = random.nextDouble() * 3.141592653589793D * 2.0D;
int i1 = long2objectmap.size();
- for(int j1 = 0; j1 < this.c.length; ++j1) {
+ for(int j1 = 0; j1 < strongholdCoords.length; ++j1) { // Paper
double d0 = (double)(4 * i2 + i2 * i1 * 6) + (random.nextDouble() - 0.5D) * (double)i2 * 2.5D;
int k1 = (int)Math.round(Math.cos(d1) * d0);
int l1 = (int)Math.round(Math.sin(d1) * d0);
- if (i1 < this.c.length) {
+ if (i1 < strongholdCoords.length) { // Paper
int j1 = 0;
int k1 = 0;
- for (int l1 = 0; l1 < this.c.length; ++l1) {
+ for (int l1 = 0; l1 < strongholdCoords.length; ++l1) { // Paper
double d1 = (double) (4 * i + i * k1 * 6) + (random.nextDouble() - 0.5D) * (double) i * 2.5D;
int i2 = (int) Math.round(Math.cos(d0) * d1);
int j2 = (int) Math.round(Math.sin(d0) * d1);
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
}
if (j1 >= k) {
- this.c[j1] = new ChunkCoordIntPair(k1, l1);
+ strongholdCoords[j1] = new ChunkCoordIntPair(k1, l1); // Paper
if (l1 >= i1) {
- this.c[l1] = new ChunkCoordIntPair(i2, j2);
+ strongholdCoords[l1] = new ChunkCoordIntPair(i2, j2); // Paper
}
d1 += (Math.PI * 2D) / (double)i;
d0 += 6.283185307179586D / (double) k;
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureStrong
++i1;
l = 0;
i = i + 2 * i / (i1 + 1);
- i = Math.min(i, this.c.length - j1);
+ i = Math.min(i, strongholdCoords.length - j1); // Paper
d1 += random.nextDouble() * Math.PI * 2.0D;
++k1;
j1 = 0;
k += 2 * k / (k1 + 1);
- k = Math.min(k, this.c.length - l1);
+ k = Math.min(k, strongholdCoords.length - l1); // Paper
d0 += random.nextDouble() * 3.141592653589793D * 2.0D;
}
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b355c3f53..27c8a97be 100644
index 0a1ffd009..82cfd694a 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 IAsyncTaskHandler {
@@ -2304,7 +2343,7 @@ index a0f255ff1..eb4b3c7a2 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 7ef3c7746..162ff3414 100644
index 95fe3a91b..b5a87cfaf 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
@@ -2342,7 +2381,7 @@ index 7ef3c7746..162ff3414 100644
if (isChunkLoaded(chunkCoordX + x, chunkCoordZ + z)) {
unloadChunk(chunkCoordX + x, chunkCoordZ + z);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f87d2bed7..603f43b7e 100644
index fdab6734f..140415687 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {