More compile fixes

This commit is contained in:
Zach Brown 2019-12-12 19:18:18 -06:00
parent b0dc983f21
commit 4565495711
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76
30 changed files with 230 additions and 151 deletions

View file

@ -1,4 +1,4 @@
From 207bb124c37c659b47420cfbd7e924e5e3149e55 Mon Sep 17 00:00:00 2001
From cabe477c5c143734d6b8242e4ab82203ca85a2b6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes
@ -134,6 +134,28 @@ index 2dd27edc8..6def3616e 100644
}));
CraftingManager.LOGGER.info("Loaded {} recipes", map1.size());
}
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
index f2c0e06ba..909d13c42 100644
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
@@ -376,7 +376,7 @@ public class EnderDragonBattle {
private void a(BlockPosition blockposition) {
this.d.triggerEffect(3000, blockposition, 0);
- WorldGenerator.END_GATEWAY.b((WorldGenFeatureConfiguration) WorldGenEndGatewayConfiguration.a()).a(this.d, this.d.getChunkProvider().getChunkGenerator(), new Random(), blockposition);
+ WorldGenerator.END_GATEWAY.b(WorldGenEndGatewayConfiguration.a()).a(this.d, this.d.getChunkProvider().getChunkGenerator(), new Random(), blockposition); // Paper - decompile fix
}
private void a(boolean flag) {
@@ -388,7 +388,7 @@ public class EnderDragonBattle {
}
}
- worldgenendtrophy.b((WorldGenFeatureConfiguration) WorldGenFeatureConfiguration.e).a(this.d, this.d.getChunkProvider().getChunkGenerator(), new Random(), this.o);
+ worldgenendtrophy.b(WorldGenFeatureConfiguration.e).a(this.d, this.d.getChunkProvider().getChunkGenerator(), new Random(), this.o); // Paper - decompile fix
}
private EntityEnderDragon o() {
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 7d44348c7..73ecdd22e 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
@ -178,7 +200,7 @@ index 1f3ea23ae..b098d86e3 100644
}
}
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
index 3be9efd22..8d9b9af9b 100644
index 3be9efd22..3a1ad2346 100644
--- a/src/main/java/net/minecraft/server/IBlockData.java
+++ b/src/main/java/net/minecraft/server/IBlockData.java
@@ -281,12 +281,12 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
@ -204,7 +226,7 @@ index 3be9efd22..8d9b9af9b 100644
+ 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 = IBlockData.a.a; // Paper - decompile fix
+ EnumDirection[] aenumdirection = a; // Paper - decompile fix
i = aenumdirection.length;
@ -359,6 +381,41 @@ index 829a7ae0a..8b9e47b4c 100644
default String asString() {
return this.toString();
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index 22035b6c0..5406f4c40 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -51,7 +51,7 @@ public class NBTTagList extends NBTList<NBTBase> {
return "TAG_List";
}
};
- private static final ByteSet b = new ByteOpenHashSet(Arrays.asList(1, 2, 3, 4, 5, 6));
+ private static final ByteSet b = new ByteOpenHashSet(Arrays.asList((byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6)); // Paper - decompiler fix
private final List<NBTBase> list;
private byte type;
diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java
index 8471920b8..e9c405fb5 100644
--- a/src/main/java/net/minecraft/server/NextTickListEntry.java
+++ b/src/main/java/net/minecraft/server/NextTickListEntry.java
@@ -37,13 +37,13 @@ public class NextTickListEntry<T> {
return this.a.hashCode();
}
- public static <T> Comparator<NextTickListEntry<T>> a() {
+ public static <T> Comparator<Object> a() { // Paper - decompile fix
return Comparator.comparingLong((nextticklistentry) -> {
- return nextticklistentry.b;
+ return ((NextTickListEntry<T>) nextticklistentry).b; // Paper - decompile fix
}).thenComparing((nextticklistentry) -> {
- return nextticklistentry.c;
+ return ((NextTickListEntry<T>) nextticklistentry).c; // Paper - decompile fix
}).thenComparingLong((nextticklistentry) -> {
- return nextticklistentry.f;
+ return ((NextTickListEntry<T>) nextticklistentry).f; // Paper - decompile fix
});
}
diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java
index 737afc7d7..db9f0196b 100644
--- a/src/main/java/net/minecraft/server/RegionFileSection.java
@ -565,5 +622,5 @@ index 55fe7625a..19e68a783 100644
t0.a(nbttagcompound.getCompound("data"));
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From d1c2226c691007cd5409244b74ed91ca98fb0231 Mon Sep 17 00:00:00 2001
From 1e7b04123a676af53fc29813810da8778f3456f3 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
@ -117,33 +117,32 @@ index 55373cae0..cfffbd031 100644
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
index 11c4d23ba..818872944 100644
index 11c4d23ba..53c15c1c0 100644
--- a/src/main/java/net/minecraft/server/ChunkCache.java
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
@@ -71,6 +71,30 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
@@ -8,7 +8,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
protected final int b;
protected final IChunkAccess[][] c;
protected boolean d;
- protected final World e;
+ protected final World e; protected final World getWorld() { return e; } // Paper - OBFHELPER
public ChunkCache(World world, BlockPosition blockposition, BlockPosition blockposition1) {
this.e = world;
@@ -71,6 +71,20 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
return this.a(i, j);
}
+ // Paper start - if loaded util
+ @Nullable
+ @Override
+ public IChunkAccess getChunkIfLoadedImmediately(int x, int z) {
+ IChunkAccess chunk = this.getChunkAt(x, z, ChunkStatus.FULL, false);
+ if (chunk instanceof ChunkEmpty) {
+ return null;
+ }
+ return chunk;
+ }
+
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ IChunkAccess chunk = getWorld().getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ return chunk == null ? null : chunk.getFluid(blockposition);
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ IChunkAccess chunk = getWorld().getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ return chunk == null ? null : chunk.getType(blockposition);
+ }
+ // Paper end
@ -1149,5 +1148,5 @@ index d8358a0f0..d0b813008 100644
+ // Paper end
}
--
2.24.1
2.24.0

View file

@ -1,10 +1,33 @@
From c9cf346e450300465e7d6491d96007120a892e30 Mon Sep 17 00:00:00 2001
From 538c2d1c4e8c4325641ea2577add8af9f8344c38 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 20:16:03 -0400
Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 5d8404f8a..adc2e8ff7 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -235,6 +235,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
return chunk == null ? null : chunk.getFluid(blockposition);
}
+
+ public boolean isLoadedAndInBounds(BlockPosition blockposition) {
+ return getWorldBorder().isInBounds(blockposition) && getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
+ }
+ public Chunk getChunkIfLoaded(BlockPosition blockposition) {
+ return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ }
+
+ // reduces need to do isLoaded before getType
+ public IBlockData getTypeIfLoadedAndInBounds(BlockPosition blockposition) {
+ return getWorldBorder().isInBounds(blockposition) ? getTypeIfLoaded(blockposition) : null;
+ }
// Paper end
@Override
diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java
index 020e5c171..4ee13ac45 100644
--- a/src/main/java/net/minecraft/server/WorldBorder.java

View file

@ -1,4 +1,4 @@
From fa37dd8d51f347ec51960d3f30ec4dedea351dcf Mon Sep 17 00:00:00 2001
From cf0c7060639d7bb09fdcf9f8597c734db294004e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 19:55:45 -0400
Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
@ -44,10 +44,10 @@ index 81d3a5262..25774fb73 100644
this.methodProfiler.a(() -> {
return worldserver.getWorldData().getName() + " " + IRegistry.DIMENSION_TYPE.getKey(worldserver.worldProvider.getDimensionManager());
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 182376a0a..ead8d84be 100644
index 0138b6bbe..1519e9e6b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -378,7 +378,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -390,7 +390,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
// CraftBukkit start
iblockdata1.b(this, blockposition, j); // Don't call an event for the old block to limit event spam
CraftWorld world = ((WorldServer) this).getWorld();
@ -56,7 +56,7 @@ index 182376a0a..ead8d84be 100644
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getServer().getPluginManager().callEvent(event);
@@ -490,7 +490,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -502,7 +502,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
try {
// CraftBukkit start
CraftWorld world = ((WorldServer) this).getWorld();
@ -66,7 +66,7 @@ index 182376a0a..ead8d84be 100644
this.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8307379e9..30c9cfa12 100644
index 38bbb3ce2..70b8b41ea 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -74,6 +74,7 @@ public class WorldServer extends World {

View file

@ -1,14 +1,14 @@
From ec2f595808f9c9cbe442786652708d5b305f757f Mon Sep 17 00:00:00 2001
From 54d988e5c406fb6f6cacac327c994b2d6132d0b9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Apr 2016 17:48:50 -0400
Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c4d5907b5..57633955c 100644
index 1519e9e6b..4870264c6 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -448,6 +448,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -460,6 +460,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public void b(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
public void applyPhysics(BlockPosition blockposition, Block block) {

View file

@ -1,4 +1,4 @@
From 35b17f41a0ade215d61bc938a17bc058386f812b Mon Sep 17 00:00:00 2001
From 6251ee3823300c9286d5f21cab7ee79f64ba84a3 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 00:25:28 -0400
Subject: [PATCH] Remove unused World Tile Entity List
@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List
Massive hit to performance and it is completely unnecessary.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 57633955c..7d5f6e220 100644
index 4870264c6..b2cc85834 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -40,7 +40,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -18,7 +18,7 @@ index 57633955c..7d5f6e220 100644
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet();
@@ -616,9 +616,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -628,9 +628,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}, tileentity::getPosition});
}
@ -30,7 +30,7 @@ index 57633955c..7d5f6e220 100644
this.tileEntityListTick.add(tileentity);
}
@@ -654,7 +654,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -666,7 +666,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@ -39,7 +39,7 @@ index 57633955c..7d5f6e220 100644
this.tileEntityListUnload.clear();
}
@@ -715,7 +715,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -727,7 +727,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
// Spigot end
@ -48,7 +48,7 @@ index 57633955c..7d5f6e220 100644
if (this.isLoaded(tileentity.getPosition())) {
this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition());
}
@@ -745,7 +745,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -757,7 +757,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
// CraftBukkit start
// From above, don't screw this up - SPIGOT-1746
@ -57,7 +57,7 @@ index 57633955c..7d5f6e220 100644
this.a(tileentity1);
}
// CraftBukkit end
@@ -1005,7 +1005,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -1017,7 +1017,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
} else {
if (tileentity != null) {
this.tileEntityListPending.remove(tileentity);
@ -89,5 +89,5 @@ index 5a813c93f..8b17fb4b4 100644
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From 025d5128eaa1e73d661b4545dc3e44ed1b49414c Mon Sep 17 00:00:00 2001
From 01e45083672563157c8546ae0325ad38e8a9caa1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 16 May 2016 20:47:41 -0400
Subject: [PATCH] Optimize UserCache / Thread Safe
@ -23,7 +23,7 @@ index 2a40bb0b8..38bf3ea44 100644
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index 65659996c..566f3db39 100644
index 65659996c..d32bec70d 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -43,8 +43,8 @@ public class UserCache {
@ -66,15 +66,7 @@ index 65659996c..566f3db39 100644
String s1 = s.toLowerCase(Locale.ROOT);
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1);
@@ -164,6 +165,7 @@ public class UserCache {
return usercache_usercacheentry == null ? null : usercache_usercacheentry.a();
}
+ @Nullable public GameProfile getProfile(UUID uuid) { return a(uuid); } // Paper - OBFHELPER
@Nullable
public GameProfile getProfile(UUID uuid) {
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid);
@@ -220,8 +222,15 @@ public class UserCache {
@@ -220,8 +221,15 @@ public class UserCache {
}
@ -90,7 +82,7 @@ index 65659996c..566f3db39 100644
BufferedWriter bufferedwriter = null;
try {
@@ -235,6 +244,14 @@ public class UserCache {
@@ -235,6 +243,14 @@ public class UserCache {
} finally {
IOUtils.closeQuietly(bufferedwriter);
}
@ -106,5 +98,5 @@ index 65659996c..566f3db39 100644
}
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From abd5f22ee2480d2a88bb8d450e212b6788ea857c Mon Sep 17 00:00:00 2001
From eceb81a7db137272593422ec5de6c890ba92f9d4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 15 Jan 2018 22:11:48 -0500
Subject: [PATCH] Basic PlayerProfile API
@ -403,7 +403,7 @@ index 000000000..3aceb0ea8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index 1f6a12632..6d278a0da 100644
index 2f10dab36..670f8313a 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -1,7 +1,10 @@
@ -450,7 +450,7 @@ index 7df3ae0ec..1ddb10741 100644
return this.minecraftSessionService;
}
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index e8143eff4..10935bcf3 100644
index 581199e6d..a072222bc 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -43,7 +43,7 @@ public class UserCache {
@ -473,10 +473,10 @@ index e8143eff4..10935bcf3 100644
+ }
+ // Paper end
+
@Nullable public GameProfile getProfile(UUID uuid) { return a(uuid); } // Paper - OBFHELPER
@Nullable
public GameProfile getProfile(UUID uuid) {
@@ -274,7 +281,7 @@ public class UserCache {
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid);
@@ -273,7 +280,7 @@ public class UserCache {
class UserCacheEntry {
@ -525,5 +525,5 @@ index 202f6ad68..2f7769c00 100644
// Paper end
}
--
2.17.1
2.24.0

View file

@ -1,14 +1,14 @@
From cb98e4077354d4495e2a641196c2b4e4fee88bd9 Mon Sep 17 00:00:00 2001
From 5a4f65aa640f16cfe63ad3d4a6fad3d5a01e583e Mon Sep 17 00:00:00 2001
From: mezz <tehgeek@gmail.com>
Date: Wed, 9 Aug 2017 17:51:22 -0500
Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 312e32f1b..8cbad8362 100644
index ef5cec964..3cab54e77 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -654,7 +654,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -666,7 +666,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
gameprofilerfiller.enter("blockEntities");
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
@ -22,5 +22,5 @@ index 312e32f1b..8cbad8362 100644
this.tileEntityListUnload.clear();
}
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 23a78d79f6a374067ac84e4ac07d2160bf2e6614 Mon Sep 17 00:00:00 2001
From 1d4f71098b09cba6d0e85447da13cd260f250be8 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 31 Oct 2017 03:26:18 +0100
Subject: [PATCH] Send attack SoundEffects only to players who can see the
@ -72,10 +72,10 @@ index 2d982ce1e..fd7de143e 100644
entity.extinguish();
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8cbad8362..117939bb7 100644
index 3cab54e77..989d4d8ca 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -591,6 +591,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -603,6 +603,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
this.playSound(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1);
}
@ -88,5 +88,5 @@ index 8cbad8362..117939bb7 100644
public abstract void playSound(@Nullable EntityHuman entityhuman, Entity entity, SoundEffect soundeffect, SoundCategory soundcategory, float f, float f1);
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 576298272c0aa61f8fd7f23d99c98bec4b5b2730 Mon Sep 17 00:00:00 2001
From 8577b822d9e3d4150092229e8e65bdbe83ef91ff Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 16 Nov 2017 12:12:41 +0000
Subject: [PATCH] use CB BlockState implementations for captured blocks
@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 117939bb7..39b136935 100644
index 989d4d8ca..e7b8a6920 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -282,7 +282,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -294,7 +294,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
// CraftBukkit start - capture blockstates
CraftBlockState blockstate = null;
if (this.captureBlockStates) {
@ -31,5 +31,5 @@ index 117939bb7..39b136935 100644
}
// CraftBukkit end
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 32e97804d1443bf400e5f0e28293bd5901044fd4 Mon Sep 17 00:00:00 2001
From b8ef4a1e566f44104d288e456d79bdb4e33feb9b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 18 Mar 2018 12:29:48 -0400
Subject: [PATCH] Player.setPlayerProfile API
@ -48,7 +48,7 @@ index 0614976b8..a985ae7ba 100644
uniqueId = i.getId();
// Paper end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6bdee24f8..e786641cc 100644
index 6bdee24f8..96b1eec91 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,6 +1,8 @@
@ -123,7 +123,7 @@ index 6bdee24f8..e786641cc 100644
+ reregisterPlayer(handle);
+
+ //Respawn the player then update their position and selected slot
+ connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(handle.dimension, handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode()));
+ connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(handle.dimension, net.minecraft.server.WorldData.c(handle.world.getWorldData().getSeed()), handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode()));
+ handle.updateAbilities();
+ connection.sendPacket(new net.minecraft.server.PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet<>(), 0));
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().updateClient(handle);
@ -138,5 +138,5 @@ index 6bdee24f8..e786641cc 100644
public void removeDisconnectingPlayer(Player player) {
hiddenPlayers.remove(player.getUniqueId());
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 3cfc49d7c12d84ddb6f278657ecdd337d29844e1 Mon Sep 17 00:00:00 2001
From 5608410605bce2f4b96dedc1289a4254b4416ca8 Mon Sep 17 00:00:00 2001
From: Hugo Manrique <hugmanrique@gmail.com>
Date: Mon, 23 Jul 2018 12:57:39 +0200
Subject: [PATCH] Option to prevent armor stands from doing entity lookups
@ -19,10 +19,10 @@ index b4e5948cc..0a99b8fe9 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 7fcc8c52d..d909d7a83 100644
index 059e4544e..a4fd1cb37 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -788,6 +788,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -800,6 +800,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
}

View file

@ -1,11 +1,11 @@
From d256ecba29766e5be9e171883aafef26faa42509 Mon Sep 17 00:00:00 2001
From 9ee8591ff2313a13e15a06ce71b6c5503854d2f1 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Mon, 16 Jul 2018 00:05:05 +0300
Subject: [PATCH] Add TNTPrimeEvent
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
index 9cf7d0b9e..15d44cd98 100644
index 0ece78d4d..3400e7ce3 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
@ -39,7 +39,7 @@ index 9cf7d0b9e..15d44cd98 100644
}
}
diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java
index 44d26e096..199276f3a 100644
index 44d26e096..ca9b0539f 100644
--- a/src/main/java/net/minecraft/server/BlockTNT.java
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
@@ -1,6 +1,7 @@
@ -94,7 +94,7 @@ index 44d26e096..199276f3a 100644
+ // Paper start - TNTPrimeEvent
+ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);
+ if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.ITEM, entityhuman.getBukkitEntity()).callEvent())
+ return true;
+ return EnumInteractionResult.FAIL;
+ // Paper end
a(world, blockposition, (EntityLiving) entityhuman);
world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11);

View file

@ -1,4 +1,4 @@
From 88c1f7c439fe9eeccb0cb1cbb7b22dfc46885368 Mon Sep 17 00:00:00 2001
From 00491dfb737b8cf317f106ffebb314b64ff922cf Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events
@ -119,7 +119,7 @@ index 80717ad9a..53aac5bcc 100644
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 1592a705f..78e4fe67d 100644
index 1592a705f..5fcf3e49a 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -89,7 +89,7 @@ public abstract class EntityLiving extends Entity {
@ -189,7 +189,7 @@ index 1592a705f..78e4fe67d 100644
+ entity.onKill(this);
+ }
+ if (this.isSleeping()) {
+ this.dy();
+ this.entityWakeup();
+ }
+ this.getCombatTracker().reset();
+ } else {
@ -279,7 +279,7 @@ index 1592a705f..78e4fe67d 100644
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index ca69f9038..139d19cde 100644
index 850c7cc1b..51b3acadb 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -447,5 +447,5 @@ index 844781f4e..4fb1092ce 100644
* Server methods
*/
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 04757b158488f08a5246b3278c20ab84447ce9f5 Mon Sep 17 00:00:00 2001
From 16c59686eddc334ed5c83c69bd51dba172461a3a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 9 Sep 2018 13:30:00 -0400
Subject: [PATCH] Mob Pathfinding API
@ -123,7 +123,7 @@ index 000000000..f68a07cb9
+ }
+}
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index bdd092e49..1cb03d464 100644
index bdd092e49..f06764973 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -80,7 +80,7 @@ public abstract class NavigationAbstract {
@ -157,7 +157,7 @@ index bdd092e49..1cb03d464 100644
}
- @Nullable
+ @Nullable public PathEntity getPathEntity() { return l(); } @Nullable // Paper - OBFHELPER
+ @Nullable public PathEntity getPathEntity() { return k(); } @Nullable // Paper - OBFHELPER
public PathEntity k() {
return this.c;
}
@ -243,5 +243,5 @@ index 5bf1cd06f..53c2d154e 100644
public void setTarget(LivingEntity target) {
EntityInsentient entity = getHandle();
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 35dce37a959e9f4b9b98f03437efbc13ac47a19c Mon Sep 17 00:00:00 2001
From e1c3b29f882864102b37e502f90ad0714d4c063d Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Wed, 12 Sep 2018 18:53:55 +0300
Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
@ -32,7 +32,7 @@ index 005ebec26..97d85f845 100644
this.s = this::l;
if (this.i.canRead() && this.i.peek() == '#') {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 1eede4bcc..8a9a48bb8 100644
index 1eede4bcc..fb78d6cce 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -87,6 +87,12 @@ import org.bukkit.persistence.PersistentDataContainer;
@ -189,7 +189,7 @@ index 1eede4bcc..8a9a48bb8 100644
+
+ NBTTagList tagList = new NBTTagList();
+ for (String value : list) {
+ tagList.add(new NBTTagString(value));
+ tagList.add(NBTTagString.a(value)); // Paper - NBTTagString.of(String str)
+ }
+
+ return tagList;
@ -432,5 +432,5 @@ index 1eede4bcc..8a9a48bb8 100644
+ // Paper end
}
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 9df1428b0a73a35c6958d1019b4c4c85fbf503ff Mon Sep 17 00:00:00 2001
From 04921bcf6f6be7a6db8227ca25bef34465e5a472 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 12 Sep 2018 21:12:57 -0400
Subject: [PATCH] Prevent mob spawning from loading/generating chunks
@ -6,7 +6,7 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks
also prevents if out of world border bounds
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 487114367..bcca7faed 100644
index 224443e03..fdac5bb3a 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -25,9 +25,9 @@ public final class SpawnerCreature {
@ -14,7 +14,7 @@ index 487114367..bcca7faed 100644
if (k >= 1) {
- IBlockData iblockdata = chunk.getType(blockposition1);
+ IBlockData iblockdata = world.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
+ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
- if (!iblockdata.isOccluding(chunk, blockposition1)) {
+ if (iblockdata != null && !iblockdata.isOccluding(chunk, blockposition1)) { // Paper - don't load chunks for mob spawn
@ -26,10 +26,10 @@ index 487114367..bcca7faed 100644
double d0 = entityhuman.g((double) f, (double) k, (double) f1);
- if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D)) {
+ if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D) && world.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
+ if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D) && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition_mutableblockposition);
if (Objects.equals(chunkcoordintpair, chunk.getPos()) || worldserver.getChunkProvider().a(chunkcoordintpair)) {
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 97dd941a53daeecad5edbeb9e55cd4d5c858e6b3 Mon Sep 17 00:00:00 2001
From 8262e20d455717a97ebf851e6645d32ad97ba000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 00:54:21 -0500
Subject: [PATCH] Add sun related API
@ -17,10 +17,10 @@ index eadac07f6..cbaed08f5 100644
if (this.world.J() && !this.world.isClientSide) {
float f = this.aI();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9c23060bb..8e3367435 100644
index 7a9159252..3e4632425 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -619,6 +619,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -631,6 +631,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
}
@ -63,5 +63,5 @@ index 53c2d154e..56c233872 100644
+ // Paper end
}
--
2.17.1
2.24.0

View file

@ -1,11 +1,11 @@
From 049e3869567e166299d0659ee10b1c068b637194 Mon Sep 17 00:00:00 2001
From 011682cf9aa804b073a7181e545916b1552f6568 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 12 Oct 2018 14:10:46 -0500
Subject: [PATCH] Add more Witch API
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index be6ecfb08..f1a4c10ad 100644
index be6ecfb08..7b6b1ad17 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -1,5 +1,11 @@
@ -25,7 +25,7 @@ index be6ecfb08..f1a4c10ad 100644
private static final UUID b = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
- private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false);
+ private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bz; // Paper - OBFHELPER
+ private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bw; // Paper - OBFHELPER
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
- private int by;
+ private int by; public int getPotionUseTimeLeft() { return by; } public void setPotionUseTimeLeft(int timeLeft) { by = timeLeft; } // Paper - OBFHELPER
@ -146,5 +146,5 @@ index bae107e76..b43a2bbd5 100644
+ // Paper end
}
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 96fb816d07d1115f2a2dd941c55277d4c248ff14 Mon Sep 17 00:00:00 2001
From 5225647a32d31190b65163bd55c830f46e18761b Mon Sep 17 00:00:00 2001
From: theosib <millerti@172.16.221.1>
Date: Thu, 27 Sep 2018 01:43:35 -0600
Subject: [PATCH] Optimize redstone algorithm
@ -1124,10 +1124,10 @@ index 5bf2fc0b3..52a4982ec 100644
c(iblockdata, world, blockposition);
world.a(blockposition, false);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8e3367435..e8f83627c 100644
index 3e4632425..3e7ba9be6 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -526,6 +526,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -538,6 +538,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
@ -1135,7 +1135,7 @@ index 8e3367435..e8f83627c 100644
public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
if (!this.isClientSide) {
IBlockData iblockdata = this.getType(blockposition);
@@ -1275,6 +1276,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -1287,6 +1288,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
return this.getBlockFacePower(blockposition.down(), EnumDirection.DOWN) > 0 ? true : (this.getBlockFacePower(blockposition.up(), EnumDirection.UP) > 0 ? true : (this.getBlockFacePower(blockposition.north(), EnumDirection.NORTH) > 0 ? true : (this.getBlockFacePower(blockposition.south(), EnumDirection.SOUTH) > 0 ? true : (this.getBlockFacePower(blockposition.west(), EnumDirection.WEST) > 0 ? true : this.getBlockFacePower(blockposition.east(), EnumDirection.EAST) > 0))));
}
@ -1144,5 +1144,5 @@ index 8e3367435..e8f83627c 100644
int i = 0;
EnumDirection[] aenumdirection = World.a;
--
2.17.1
2.24.0

View file

@ -1,4 +1,4 @@
From 5520641b69e980691db06799793a50b52fd497ca Mon Sep 17 00:00:00 2001
From 10a9a42dfb78cdd1e27b1c8ea4d5a89590abb829 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 6 Feb 2019 00:20:33 -0500
Subject: [PATCH] BlockDestroyEvent
@ -11,10 +11,10 @@ floating in the air.
This can replace many uses of BlockPhysicsEvent
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e8f83627c..61a3ddc4d 100644
index 3e7ba9be6..77db1b73d 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -456,8 +456,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -468,8 +468,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
return false;
} else {
Fluid fluid = this.getFluid(blockposition);
@ -37,5 +37,5 @@ index e8f83627c..61a3ddc4d 100644
TileEntity tileentity = iblockdata.getBlock().isTileEntity() ? this.getTileEntity(blockposition) : null;
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From bed92ef07ed1a7c0514c36dd12f20aaba86cbc66 Mon Sep 17 00:00:00 2001
From 5e9eff1f0169179c20855dfdb4f0129b00180e09 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 6 Apr 2019 10:16:48 -0400
Subject: [PATCH] Optimize Captured TileEntity Lookup
@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
just do a get call since the value can never be null.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 61a3ddc4d..dfc695084 100644
index 77db1b73d..7d39a8fbc 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1000,12 +1000,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -1012,12 +1012,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
return null;
} else {
// CraftBukkit start
@ -31,5 +31,5 @@ index 61a3ddc4d..dfc695084 100644
if (this.tickingTileEntities) {
tileentity = this.e(blockposition);
--
2.24.1
2.24.0

View file

@ -1,14 +1,14 @@
From 67f62dfa1ad2c6ea8104461749bd2b43b94bb366 Mon Sep 17 00:00:00 2001
From 2bd3daff08c36cebcfb7c1f1a7eb3718d771daa6 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Tue, 1 Jan 2019 02:22:01 -0800
Subject: [PATCH] Add Heightmap API
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index dfc695084..10bb06489 100644
index 7d39a8fbc..9889b0543 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -577,8 +577,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -589,8 +589,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
}
@ -54,5 +54,5 @@ index 578fe8d19..12362d560 100644
public Location getSpawnLocation() {
BlockPosition spawn = world.getSpawn();
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From 36505b571ac2b7a8b2353960f29c818d5e880384 Mon Sep 17 00:00:00 2001
From 9dff654d99e1c5c0d31a9974dfe1b2b8314ae3dc Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 9 Jun 2019 03:53:22 +0100
Subject: [PATCH] incremental chunk saving
@ -149,7 +149,7 @@ index 827831aab..4379434f6 100644
if (flag) {
List<PlayerChunk> list = (List) this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).peek(PlayerChunk::m).collect(Collectors.toList());
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c28c0431a..0fd3cb54b 100644
index c28c0431a..4bfa6ea0e 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -791,11 +791,44 @@ public class WorldServer extends World {
@ -166,7 +166,7 @@ index c28c0431a..0fd3cb54b 100644
+
+ try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) {
+ if (doFull) {
+ this.k_();
+ this.saveData();
+ }
+
+ timings.worldSaveChunks.startTiming(); // Paper
@ -180,9 +180,9 @@ index c28c0431a..0fd3cb54b 100644
+ WorldServer worldserver1 = this;
+ WorldData worlddata = worldserver1.getWorldData();
+
+ worldserver1.getWorldBorder().a(worlddata);
+ worlddata.c(this.server.getBossBattleCustomData().c());
+ worldserver1.getDataManager().saveWorldData(worlddata, this.server.getPlayerList().r());
+ worldserver1.getWorldBorder().save(worlddata);
+ worlddata.setCustomBossEvents(this.server.getBossBattleCustomData().save());
+ worldserver1.getDataManager().saveWorldData(worlddata, this.server.getPlayerList().save());
+ // CraftBukkit end
+ }
+ }
@ -198,6 +198,14 @@ index c28c0431a..0fd3cb54b 100644
try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
if (iprogressupdate != null) {
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
@@ -822,6 +855,7 @@ public class WorldServer extends World {
// CraftBukkit end
}
+ protected void saveData() throws ExceptionWorldConflict { this.m_(); } // Paper - OBFHELPER
protected void m_() throws ExceptionWorldConflict {
this.checkSession();
this.worldProvider.i();
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From 6af2036c7be6a6b165b5e8a88ed9de26748b03f2 Mon Sep 17 00:00:00 2001
From d46c3f2175e3fe28a373540a9e5f7a668fb4817a Mon Sep 17 00:00:00 2001
From: stonar96 <minecraft.stonar96@gmail.com>
Date: Mon, 20 Aug 2018 03:03:58 +0200
Subject: [PATCH] Anti-Xray
@ -1648,7 +1648,7 @@ index a905a29e7..335b64435 100644
public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
return new TicketType<>(s, comparator, 0L);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9ad76ab32..39725335d 100644
index e80cb3b97..985f30372 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2,6 +2,8 @@ package net.minecraft.server;
@ -1676,7 +1676,7 @@ index 9ad76ab32..39725335d 100644
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
@@ -346,6 +350,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -358,6 +362,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
// CraftBukkit end
IBlockData iblockdata1 = chunk.setType(blockposition, iblockdata, (i & 64) != 0, (i & 1024) == 0); // CraftBukkit custom NO_PLACE flag
@ -1710,5 +1710,5 @@ index 7772d5900..4570ed999 100644
return section;
}
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From d6b3a9d00583ae9f1c817cf2357385828b4c77f7 Mon Sep 17 00:00:00 2001
From 7167eb52225425a7247cb5afc746f3c5e0902847 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 24 Mar 2019 01:01:32 -0400
Subject: [PATCH] Only count Natural Spawned mobs towards natural spawn mob
@ -38,10 +38,10 @@ index 363676348..0a7e6fff1 100644
public boolean asynchronous;
public EngineMode engineMode;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 0fd3cb54b..a5cce8f4e 100644
index 4bfa6ea0e..733f3e10e 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -933,6 +933,13 @@ public class WorldServer extends World {
@@ -934,6 +934,13 @@ public class WorldServer extends World {
EnumCreatureType enumcreaturetype = entity.getEntityType().e();
if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().b(entity)) {
@ -56,5 +56,5 @@ index 0fd3cb54b..a5cce8f4e 100644
}
}
--
2.24.1
2.24.0

View file

@ -1,14 +1,14 @@
From 56f78814b12ea4c6d20d61805f929ad16a4e0210 Mon Sep 17 00:00:00 2001
From 9a39e60db93fde594b0819fcf31c8ad7bde4ffa0 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 28 Jul 2019 00:51:11 +0100
Subject: [PATCH] Mark entities as being ticked when notifying navigation
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a5cce8f4e..8ea9b34a1 100644
index 733f3e10e..049d4ef4e 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1370,6 +1370,7 @@ public class WorldServer extends World {
@@ -1371,6 +1371,7 @@ public class WorldServer extends World {
VoxelShape voxelshape1 = iblockdata1.getCollisionShape(this, blockposition);
if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) {
@ -16,7 +16,7 @@ index a5cce8f4e..8ea9b34a1 100644
Iterator iterator = this.navigators.iterator();
while (iterator.hasNext()) {
@@ -1380,6 +1381,7 @@ public class WorldServer extends World {
@@ -1381,6 +1382,7 @@ public class WorldServer extends World {
}
}
@ -25,5 +25,5 @@ index a5cce8f4e..8ea9b34a1 100644
}
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From 4e401f46a0da7fb3e383d51e6a23e7e09db0dd88 Mon Sep 17 00:00:00 2001
From 55f4e65820156e476cff0bfa265f30573860ca87 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@burngames.net>
Date: Sun, 14 Jul 2019 21:05:03 -0500
Subject: [PATCH] Do less work if we have a custom Bukkit generator
@ -7,7 +7,7 @@ If the Bukkit generator already has a spawn, use it immediately instead
of spending time generating one that we won't use
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index fecbe7914..a08308a12 100644
index 657f0e024..1d750eba5 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -782,12 +782,13 @@ public class WorldServer extends World {
@ -35,7 +35,7 @@ index fecbe7914..a08308a12 100644
// CraftBukkit end
+ // Paper start - this is useless if craftbukkit returns early
+ WorldChunkManager worldchunkmanager = this.chunkProvider.getChunkGenerator().getWorldChunkManager();
+ WorldChunkManager worldchunkmanager = this.getChunkProvider().getChunkGenerator().getWorldChunkManager();
+ List<BiomeBase> list = worldchunkmanager.a();
+ Random random = new Random(this.getSeed());
+ BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
@ -45,5 +45,5 @@ index fecbe7914..a08308a12 100644
WorldServer.LOGGER.warn("Unable to find spawn biome");
}
--
2.24.1
2.24.0

View file

@ -1,4 +1,4 @@
From 86be231a037cbcb9e168afa85e02d3dd83fcc97b Mon Sep 17 00:00:00 2001
From 1dfb1d7424222fe141edd78433a2f79225570544 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Mon, 19 Aug 2019 01:27:58 +0500
Subject: [PATCH] implement optional per player mob spawns
@ -755,10 +755,10 @@ index e168c528c..56dabbc15 100644
@Nullable
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a08308a12..4da5c8982 100644
index b9e37d630..25a1ef134 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -998,7 +998,20 @@ public class WorldServer extends World {
@@ -999,7 +999,20 @@ public class WorldServer extends World {
}
public Object2IntMap<EnumCreatureType> l() {
@ -780,7 +780,7 @@ index a08308a12..4da5c8982 100644
ObjectIterator objectiterator = this.entitiesById.values().iterator();
while (objectiterator.hasNext()) {
@@ -1023,11 +1036,16 @@ public class WorldServer extends World {
@@ -1024,11 +1037,16 @@ public class WorldServer extends World {
continue;
}
// Paper end
@ -800,5 +800,5 @@ index a08308a12..4da5c8982 100644
@Override
--
2.24.1
2.24.0