mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
More compile fixes
This commit is contained in:
parent
78640d1334
commit
f7b5ea39ea
30 changed files with 147 additions and 68 deletions
|
@ -5,7 +5,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -5,7 +5,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -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);
|
||||
|
|
|
@ -5,6 +5,29 @@ 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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
|
|
|
@ -5,7 +5,7 @@ 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
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -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
|
||||
|
|
|
@ -17,7 +17,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -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
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
|
@ -473,9 +473,9 @@ index e8143eff4..10935bcf3 100644
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@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);
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
|
||||
class UserCacheEntry {
|
||||
|
|
|
@ -11,7 +11,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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);
|
||||
|
|
|
@ -5,7 +5,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -5,7 +5,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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;
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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) {
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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;
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
|
|
|
@ -5,7 +5,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
|
|
@ -44,7 +44,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
@ -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
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
|
|
@ -10,7 +10,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
|
@ -66,14 +66,6 @@ index 65659996c..566f3db39 100644
|
|||
String s1 = s.toLowerCase(Locale.ROOT);
|
||||
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1);
|
||||
|
||||
@@ -0,0 +0,0 @@ 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);
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
|
||||
}
|
||||
|
|
|
@ -1124,7 +1124,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -19,7 +19,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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,7 +26,7 @@ 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)) {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -72,7 +72,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
|
@ -755,7 +755,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
|
|
@ -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
|
||||
@@ -0,0 +0,0 @@ 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,4 +198,12 @@ 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]));
|
||||
@@ -0,0 +0,0 @@ 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();
|
||||
--
|
|
@ -18,7 +18,7 @@ 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
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
|
Loading…
Reference in a new issue