Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-14 18:40:10 +01:00
remove more obfhelpers
Dieser Commit ist enthalten in:
Ursprung
30cdf3b8b1
Commit
c9cdc05ff1
@ -49,7 +49,7 @@ public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
|
|||||||
# LivingEntity setkiller
|
# LivingEntity setkiller
|
||||||
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
|
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
|
||||||
|
|
||||||
# SkeletonHore Addittions
|
# SkeletonHorse Addittions
|
||||||
public net.minecraft.world.entity.animal.horse.SkeletonHorse trapTime
|
public net.minecraft.world.entity.animal.horse.SkeletonHorse trapTime
|
||||||
|
|
||||||
# Fix client rendering skulls
|
# Fix client rendering skulls
|
||||||
@ -64,6 +64,7 @@ public net.minecraft.server.level.ServerChunkCache mainThreadProcessor
|
|||||||
public-f net.minecraft.world.level.chunk.storage.RegionFileStorage
|
public-f net.minecraft.world.level.chunk.storage.RegionFileStorage
|
||||||
public net.minecraft.world.level.chunk.storage.RegionFileStorage getFile(Lnet/minecraft/world/level/ChunkPos;Z)Lnet/minecraft/world/level/chunk/storage/RegionFile;
|
public net.minecraft.world.level.chunk.storage.RegionFileStorage getFile(Lnet/minecraft/world/level/ChunkPos;Z)Lnet/minecraft/world/level/chunk/storage/RegionFile;
|
||||||
public net.minecraft.world.level.chunk.storage.SectionStorage dirty
|
public net.minecraft.world.level.chunk.storage.SectionStorage dirty
|
||||||
|
public net.minecraft.util.thread.BlockableEventLoop runAllTasks()V
|
||||||
|
|
||||||
# Improve death events
|
# Improve death events
|
||||||
public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sounds/SoundEvent;
|
public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sounds/SoundEvent;
|
||||||
@ -96,6 +97,7 @@ public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
|
|||||||
|
|
||||||
# Add PlayerConnectionCloseEvent
|
# Add PlayerConnectionCloseEvent
|
||||||
public net.minecraft.server.network.ServerLoginPacketListenerImpl$State
|
public net.minecraft.server.network.ServerLoginPacketListenerImpl$State
|
||||||
|
public net.minecraft.server.network.ServerLoginPacketListenerImpl state
|
||||||
|
|
||||||
# Entity Activation Range 2.0
|
# Entity Activation Range 2.0
|
||||||
public net.minecraft.world.entity.Entity isInsidePortal
|
public net.minecraft.world.entity.Entity isInsidePortal
|
||||||
@ -175,9 +177,6 @@ public net.minecraft.world.entity.projectile.AbstractArrow getPickupItem()Lnet.m
|
|||||||
# Implement Expanded ArmorStand API
|
# Implement Expanded ArmorStand API
|
||||||
public net.minecraft.world.entity.decoration.ArmorStand isDisabled(Lnet/minecraft/world/entity/EquipmentSlot;)Z
|
public net.minecraft.world.entity.decoration.ArmorStand isDisabled(Lnet/minecraft/world/entity/EquipmentSlot;)Z
|
||||||
|
|
||||||
# Asynchronous chunk IO and loading
|
|
||||||
public net.minecraft.util.thread.BlockableEventLoop runAllTasks()V
|
|
||||||
|
|
||||||
# Chunk debug command
|
# Chunk debug command
|
||||||
public net.minecraft.server.level.ChunkMap entitiesInLevel
|
public net.minecraft.server.level.ChunkMap entitiesInLevel
|
||||||
public net.minecraft.server.level.ServerLevel players
|
public net.minecraft.server.level.ServerLevel players
|
||||||
@ -205,3 +204,14 @@ public net.minecraft.commands.arguments.blocks.BlockStateParser id
|
|||||||
|
|
||||||
# Villager Restock API
|
# Villager Restock API
|
||||||
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
|
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
|
||||||
|
|
||||||
|
# Mob Pathfinding API
|
||||||
|
public net.minecraft.world.entity.ai.navigation.PathNavigation pathFinder
|
||||||
|
public net.minecraft.world.level.pathfinder.PathFinder nodeEvaluator
|
||||||
|
public net.minecraft.world.level.pathfinder.Path nodes
|
||||||
|
|
||||||
|
# Add more Witch API
|
||||||
|
public net.minecraft.world.entity.monster.Witch usingTime
|
||||||
|
|
||||||
|
# PlayerDeathEvent#getItemsToKeep
|
||||||
|
public net.minecraft.world.entity.player.Inventory compartments
|
||||||
|
@ -724,7 +724,7 @@ index 0000000000000000000000000000000000000000..0133ea6feb1ab88f021f66855669f583
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
|
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..abe7f2f13ab713bf1cb0343059377ab7e1b48b6e
|
index 0000000000000000000000000000000000000000..4a21ec2397f57c7c2ac3659f7de96cda9182fea0
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
|
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
|
||||||
@@ -0,0 +1,128 @@
|
@@ -0,0 +1,128 @@
|
||||||
@ -760,7 +760,7 @@ index 0000000000000000000000000000000000000000..abe7f2f13ab713bf1cb0343059377ab7
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static BlockState getBlockDataFromRaw(final long raw) {
|
+ public static BlockState getBlockDataFromRaw(final long raw) {
|
||||||
+ return GLOBAL_PALETTE.getObject((int)(raw >>> 32));
|
+ return GLOBAL_PALETTE.valueFor((int)(raw >>> 32));
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static int getIndexFromRaw(final long raw) {
|
+ public static int getIndexFromRaw(final long raw) {
|
||||||
@ -772,7 +772,7 @@ index 0000000000000000000000000000000000000000..abe7f2f13ab713bf1cb0343059377ab7
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static long getRawFromValues(final int index, final int location, final BlockState data) {
|
+ public static long getRawFromValues(final int index, final int location, final BlockState data) {
|
||||||
+ return (long)index | ((long)location << 16) | (((long)GLOBAL_PALETTE.getOrCreateIdFor(data)) << 32);
|
+ return (long)index | ((long)location << 16) | (((long)GLOBAL_PALETTE.idFor(data)) << 32);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static long setIndexRawValues(final long value, final int index) {
|
+ public static long setIndexRawValues(final long value, final int index) {
|
||||||
@ -2271,26 +2271,10 @@ index 771e4b72589d7117a154ab6917bd4a56d55f19db..65e0ca442980f273d2fe5f131e174cd9
|
|||||||
|
|
||||||
public static long getEpochMillis() {
|
public static long getEpochMillis() {
|
||||||
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
||||||
index 59240bb0ce088a14f8ccb62de8b69bc7bf313975..cfc2a5145e47de86a5a738d86abf333ff3db7796 100644
|
index 59240bb0ce088a14f8ccb62de8b69bc7bf313975..ed52d042f41942ae512148fbba310093358ead68 100644
|
||||||
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
||||||
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
||||||
@@ -461,6 +461,7 @@ public class BlockPos extends Vec3i {
|
@@ -525,6 +525,7 @@ public class BlockPos extends Vec3i {
|
||||||
return super.rotate(rotation).immutable();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public final BlockPos.MutableBlockPos setValues(int i, int j, int k) { return set(i, j, k);} // Paper - OBFHELPER
|
|
||||||
public BlockPos.MutableBlockPos set(int x, int y, int z) {
|
|
||||||
this.setX(x);
|
|
||||||
this.setY(y);
|
|
||||||
@@ -468,6 +469,7 @@ public class BlockPos extends Vec3i {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public final BlockPos.MutableBlockPos setValues(double d0, double d1, double d2) { return set(d0, d1, d2);} // Paper - OBFHELPER
|
|
||||||
public BlockPos.MutableBlockPos set(double x, double y, double z) {
|
|
||||||
return this.set(Mth.floor(x), Mth.floor(y), Mth.floor(z));
|
|
||||||
}
|
|
||||||
@@ -525,6 +527,7 @@ public class BlockPos extends Vec3i {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2298,7 +2282,7 @@ index 59240bb0ce088a14f8ccb62de8b69bc7bf313975..cfc2a5145e47de86a5a738d86abf333f
|
|||||||
@Override
|
@Override
|
||||||
public BlockPos.MutableBlockPos setX(int i) {
|
public BlockPos.MutableBlockPos setX(int i) {
|
||||||
super.setX(i);
|
super.setX(i);
|
||||||
@@ -542,6 +545,7 @@ public class BlockPos extends Vec3i {
|
@@ -542,6 +543,7 @@ public class BlockPos extends Vec3i {
|
||||||
super.setZ(i);
|
super.setZ(i);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -2307,7 +2291,7 @@ index 59240bb0ce088a14f8ccb62de8b69bc7bf313975..cfc2a5145e47de86a5a738d86abf333f
|
|||||||
@Override
|
@Override
|
||||||
public BlockPos immutable() {
|
public BlockPos immutable() {
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
index 3d374000cd61d4a29dae21035c5ee9a93a1ff0f9..a16fa7c0effdd192e873eb1afdee79103bb8308e 100644
|
index 3d374000cd61d4a29dae21035c5ee9a93a1ff0f9..e59475b7bb3e000afece0033c5d3f112d643c4f2 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
@@ -60,7 +60,7 @@ public class CompoundTag implements Tag {
|
@@ -60,7 +60,7 @@ public class CompoundTag implements Tag {
|
||||||
@ -2319,12 +2303,7 @@ index 3d374000cd61d4a29dae21035c5ee9a93a1ff0f9..a16fa7c0effdd192e873eb1afdee7910
|
|||||||
|
|
||||||
protected CompoundTag(Map<String, Tag> entries) {
|
protected CompoundTag(Map<String, Tag> entries) {
|
||||||
this.tags = entries;
|
this.tags = entries;
|
||||||
@@ -119,10 +119,15 @@ public class CompoundTag implements Tag {
|
@@ -123,6 +123,10 @@ public class CompoundTag implements Tag {
|
||||||
this.tags.put(key, LongTag.valueOf(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public void setUUID(String prefix, UUID uuid) { putUUID(prefix, uuid); } // Paper - OBFHELPER
|
|
||||||
public void putUUID(String key, UUID value) {
|
|
||||||
this.tags.put(key, NbtUtils.createUUID(value));
|
this.tags.put(key, NbtUtils.createUUID(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2335,18 +2314,6 @@ index 3d374000cd61d4a29dae21035c5ee9a93a1ff0f9..a16fa7c0effdd192e873eb1afdee7910
|
|||||||
public UUID getUUID(String key) {
|
public UUID getUUID(String key) {
|
||||||
return NbtUtils.loadUUID(this.get(key));
|
return NbtUtils.loadUUID(this.get(key));
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
|
||||||
index 0ae24c8080391410756f101a1e40c2eef887c739..3b8207046d38d3d14719ff6761a22e60a93628b7 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
|
||||||
@@ -68,6 +68,7 @@ public class FriendlyByteBuf extends ByteBuf {
|
|
||||||
this.source = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public static int countBytes(int i) { return FriendlyByteBuf.getVarIntSize(i); } // Paper - OBFHELPER
|
|
||||||
public static int getVarIntSize(int value) {
|
|
||||||
for (int j = 1; j < 5; ++j) {
|
|
||||||
if ((value & -1 << j * 7) == 0) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
|
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
index f189a72bd101a99d9350072a06953665fc5d6fee..83e99af925c87433b59f9bed30dfbf4e490c1b84 100644
|
index f189a72bd101a99d9350072a06953665fc5d6fee..83e99af925c87433b59f9bed30dfbf4e490c1b84 100644
|
||||||
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
@ -2877,7 +2844,7 @@ index 75801343b14a5555e974168170af95f8513926f5..1b76d1b929b85b130639e7937a118342
|
|||||||
MinecraftServer.LOGGER.info("Saving usercache.json");
|
MinecraftServer.LOGGER.info("Saving usercache.json");
|
||||||
this.getProfileCache().save();
|
this.getProfileCache().save();
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f5db63075 100644
|
index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..24f72050229031898fd9da585ad2ceec835f83f9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -52,9 +52,9 @@ public class ChunkHolder {
|
@@ -52,9 +52,9 @@ public class ChunkHolder {
|
||||||
@ -2902,7 +2869,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f
|
|||||||
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
||||||
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
||||||
this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||||
@@ -93,14 +95,16 @@ public class ChunkHolder {
|
@@ -93,10 +95,11 @@ public class ChunkHolder {
|
||||||
this.queueLevel = this.oldTicketLevel;
|
this.queueLevel = this.oldTicketLevel;
|
||||||
this.setTicketLevel(level);
|
this.setTicketLevel(level);
|
||||||
this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()];
|
this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()];
|
||||||
@ -2915,23 +2882,16 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f
|
|||||||
if (!ChunkHolder.getFullChunkStatus(this.oldTicketLevel).isOrAfter(ChunkHolder.FullChunkStatus.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks
|
if (!ChunkHolder.getFullChunkStatus(this.oldTicketLevel).isOrAfter(ChunkHolder.FullChunkStatus.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks
|
||||||
return this.getFullChunkUnchecked();
|
return this.getFullChunkUnchecked();
|
||||||
}
|
}
|
||||||
|
@@ -118,20 +121,20 @@ public class ChunkHolder {
|
||||||
+ @Deprecated public final LevelChunk getFullChunkIfCached() { return this.getFullChunkUnchecked(); } // Paper - OBFHELPER
|
|
||||||
public LevelChunk getFullChunkUnchecked() {
|
|
||||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> statusFuture = this.getFutureIfPresentUnchecked(ChunkStatus.FULL);
|
|
||||||
Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = (Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>) statusFuture.getNow(null);
|
|
||||||
@@ -118,20 +122,22 @@ public class ChunkHolder {
|
|
||||||
return ChunkHolder.getStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE;
|
return ChunkHolder.getStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() {
|
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() {
|
||||||
+ @Deprecated public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingFuture() { return this.getTickingChunkFuture(); } // Paper - OBFHELPER
|
|
||||||
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() { // Paper - final for inline
|
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() { // Paper - final for inline
|
||||||
return this.tickingChunkFuture;
|
return this.tickingChunkFuture;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() {
|
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() {
|
||||||
+ @Deprecated public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingFuture() { return this.getEntityTickingChunkFuture(); } // Paper - OBFHELPER
|
|
||||||
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() { // Paper - final for inline
|
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() { // Paper - final for inline
|
||||||
return this.entityTickingChunkFuture;
|
return this.entityTickingChunkFuture;
|
||||||
}
|
}
|
||||||
@ -2947,7 +2907,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f
|
|||||||
CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getTickingChunkFuture();
|
CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getTickingChunkFuture();
|
||||||
Either<LevelChunk, ChunkHolder.ChunkLoadingFailure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
Either<LevelChunk, ChunkHolder.ChunkLoadingFailure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
||||||
|
|
||||||
@@ -170,7 +176,7 @@ public class ChunkHolder {
|
@@ -170,7 +173,7 @@ public class ChunkHolder {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2956,7 +2916,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f
|
|||||||
return this.chunkToSave;
|
return this.chunkToSave;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,11 +334,11 @@ public class ChunkHolder {
|
@@ -328,11 +331,11 @@ public class ChunkHolder {
|
||||||
return ChunkHolder.getFullChunkStatus(this.ticketLevel);
|
return ChunkHolder.getFullChunkStatus(this.ticketLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2970,7 +2930,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f
|
|||||||
return this.ticketLevel;
|
return this.ticketLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,14 +427,27 @@ public class ChunkHolder {
|
@@ -421,14 +424,27 @@ public class ChunkHolder {
|
||||||
|
|
||||||
this.wasAccessibleSinceLastSave |= flag3;
|
this.wasAccessibleSinceLastSave |= flag3;
|
||||||
if (!flag2 && flag3) {
|
if (!flag2 && flag3) {
|
||||||
@ -2998,7 +2958,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f
|
|||||||
this.updateChunkToSave(((CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>>) completablefuture).thenApply((either1) -> { // CraftBukkit - decompile error
|
this.updateChunkToSave(((CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>>) completablefuture).thenApply((either1) -> { // CraftBukkit - decompile error
|
||||||
Objects.requireNonNull(chunkStorage);
|
Objects.requireNonNull(chunkStorage);
|
||||||
return either1.ifLeft(chunkStorage::packTicks);
|
return either1.ifLeft(chunkStorage::packTicks);
|
||||||
@@ -441,11 +460,19 @@ public class ChunkHolder {
|
@@ -441,11 +457,19 @@ public class ChunkHolder {
|
||||||
if (!flag4 && flag5) {
|
if (!flag4 && flag5) {
|
||||||
this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this);
|
this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this);
|
||||||
this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING);
|
this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING);
|
||||||
@ -3019,7 +2979,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..9a8fc112dd19964c848127a8dd2f100f
|
|||||||
this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,11 +486,18 @@ public class ChunkHolder {
|
@@ -459,11 +483,18 @@ public class ChunkHolder {
|
||||||
|
|
||||||
this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this.pos);
|
this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this.pos);
|
||||||
this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING);
|
this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING);
|
||||||
@ -3119,7 +3079,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index cfe9930490489d506c91d174b5aad199314ffd17..db2bcc20d50f1833347f6edde67c366501d29c0f 100644
|
index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465e879deaa 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -45,6 +45,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
|
@@ -45,6 +45,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
|
||||||
@ -3214,7 +3174,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..db2bcc20d50f1833347f6edde67c3665
|
|||||||
+ });
|
+ });
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ this.getChunkFutureAsynchronously(x, z, 31, ChunkHolder::getEntityTickingFuture, onLoad);
|
+ this.getChunkFutureAsynchronously(x, z, 31, ChunkHolder::getEntityTickingChunkFuture, onLoad);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void getTickingChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
|
+ public void getTickingChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
|
||||||
@ -3224,7 +3184,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..db2bcc20d50f1833347f6edde67c3665
|
|||||||
+ });
|
+ });
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ this.getChunkFutureAsynchronously(x, z, 32, ChunkHolder::getTickingFuture, onLoad);
|
+ this.getChunkFutureAsynchronously(x, z, 32, ChunkHolder::getTickingChunkFuture, onLoad);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void getFullChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
|
+ public void getFullChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
|
||||||
@ -3306,7 +3266,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..db2bcc20d50f1833347f6edde67c3665
|
|||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return playerChunk.getFullChunkIfCached();
|
+ return playerChunk.getFullChunkUnchecked();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Nullable
|
+ @Nullable
|
||||||
@ -3514,21 +3474,8 @@ index d31c62b612a5a8016ffbfbb9dc85d9a941c08cf4..fc34cfa8bfb3b82a8e1b28d261f0e901
|
|||||||
protected Monster(EntityType<? extends Monster> type, Level world) {
|
protected Monster(EntityType<? extends Monster> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
this.xpReward = 5;
|
this.xpReward = 5;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
|
||||||
index 6d0b9f8834e86a465cae3fa2af830b797c65a4fb..911cecb3c1d0cd682dcff37636e1fefd979456ae 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
|
||||||
@@ -44,7 +44,7 @@ public class Inventory implements Container, Nameable {
|
|
||||||
public final NonNullList<ItemStack> items;
|
|
||||||
public final NonNullList<ItemStack> armor;
|
|
||||||
public final NonNullList<ItemStack> offhand;
|
|
||||||
- private final List<NonNullList<ItemStack>> compartments;
|
|
||||||
+ private final List<NonNullList<ItemStack>> compartments; @Deprecated public final List<NonNullList<ItemStack>> getComponents() { return compartments; } // Paper - OBFHELPER
|
|
||||||
public int selected;
|
|
||||||
public final Player player;
|
|
||||||
private int timesChanged;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
index 48902f822ccb6e231201f888a2a92923a946e8cf..680c4eb99b650c8ec7fe50022ba36070feb0a0e5 100644
|
index 48902f822ccb6e231201f888a2a92923a946e8cf..280519717d32385a74d6e942a6f42fc12ad8c57e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -725,6 +725,24 @@ public final class ItemStack {
|
@@ -725,6 +725,24 @@ public final class ItemStack {
|
||||||
@ -3556,15 +3503,7 @@ index 48902f822ccb6e231201f888a2a92923a946e8cf..680c4eb99b650c8ec7fe50022ba36070
|
|||||||
public void setTag(@Nullable CompoundTag tag) {
|
public void setTag(@Nullable CompoundTag tag) {
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
if (this.getItem().canBeDepleted()) {
|
if (this.getItem().canBeDepleted()) {
|
||||||
@@ -1043,6 +1061,7 @@ public final class ItemStack {
|
@@ -1128,6 +1146,7 @@ public final class ItemStack {
|
||||||
return this.tag != null && this.tag.contains("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public void getOrCreateTagAndSet(String s, net.minecraft.nbt.Tag nbtbase) { addTagElement(s, nbtbase);} // Paper - OBFHELPER
|
|
||||||
public void addTagElement(String key, net.minecraft.nbt.Tag tag) {
|
|
||||||
this.getOrCreateTag().put(key, tag);
|
|
||||||
}
|
|
||||||
@@ -1128,6 +1147,7 @@ public final class ItemStack {
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setItem(Item item) {
|
public void setItem(Item item) {
|
||||||
@ -3572,18 +3511,6 @@ index 48902f822ccb6e231201f888a2a92923a946e8cf..680c4eb99b650c8ec7fe50022ba36070
|
|||||||
this.item = item;
|
this.item = item;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/alchemy/PotionUtils.java b/src/main/java/net/minecraft/world/item/alchemy/PotionUtils.java
|
|
||||||
index 3d9fffa3f07264743b9323557a0b2ac360e01fb9..eca0f3b95b3af4dade992889a5e310a467c2e9fc 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/item/alchemy/PotionUtils.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/item/alchemy/PotionUtils.java
|
|
||||||
@@ -126,6 +126,7 @@ public class PotionUtils {
|
|
||||||
return compound == null ? Potions.EMPTY : Potion.byName(compound.getString("Potion"));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public static ItemStack addPotionToItemStack(ItemStack itemstack, Potion potionregistry) { return setPotion(itemstack, potionregistry); } // Paper - OBFHELPER
|
|
||||||
public static ItemStack setPotion(ItemStack stack, Potion potion) {
|
|
||||||
ResourceLocation resourceLocation = Registry.POTION.getKey(potion);
|
|
||||||
if (potion == Potions.EMPTY) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
index 083122a2e051b23b2cb9bdb8eb70af01af9df400..e85e4a2dfceb0aa40e73b43a5e122a5906cac585 100644
|
index 083122a2e051b23b2cb9bdb8eb70af01af9df400..e85e4a2dfceb0aa40e73b43a5e122a5906cac585 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
@ -3686,7 +3613,7 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..c7d499bfc22152e0a49f50a2a8133f31
|
|||||||
public BlockState getBlockState(BlockPos pos) {
|
public BlockState getBlockState(BlockPos pos) {
|
||||||
return Blocks.AIR.defaultBlockState();
|
return Blocks.AIR.defaultBlockState();
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..20fafb95e98ac2e656999ea2208db166d841db9f 100644
|
index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f21610899d97 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -84,6 +84,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
@@ -84,6 +84,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
||||||
@ -3775,19 +3702,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..20fafb95e98ac2e656999ea2208db166
|
|||||||
return this.setBlock(pos, state, flags, 512);
|
return this.setBlock(pos, state, flags, 512);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,8 +468,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -588,7 +623,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
public void onBlockStateChange(BlockPos pos, BlockState oldBlock, BlockState newBlock) {}
|
|
||||||
|
|
||||||
- @Override
|
|
||||||
- public boolean removeBlock(BlockPos pos, boolean move) {
|
|
||||||
+ @Deprecated public boolean setAir(BlockPos blockposition) { return this.removeBlock(blockposition, false); } // Paper - OBFHELPER
|
|
||||||
+ @Deprecated public boolean setAir(BlockPos blockposition, boolean moved) { return this.removeBlock(blockposition, moved); } // Paper - OBFHELPER
|
|
||||||
+ @Override public boolean removeBlock(BlockPos pos, boolean move) { // Paper - OBFHELPER
|
|
||||||
FluidState fluid = this.getFluidState(pos);
|
|
||||||
|
|
||||||
return this.setBlock(pos, fluid.createLegacyBlock(), 3 | (move ? 64 : 0));
|
|
||||||
@@ -588,7 +624,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
||||||
if (this.isOutsideBuildHeight(pos)) {
|
if (this.isOutsideBuildHeight(pos)) {
|
||||||
return Blocks.VOID_AIR.defaultBlockState();
|
return Blocks.VOID_AIR.defaultBlockState();
|
||||||
} else {
|
} else {
|
||||||
@ -3851,7 +3766,7 @@ index 00118cc80ebc31e5fac95c31c07634f0e2904263..138b6792bc6ee26e0b9aaaef7bf58fb2
|
|||||||
@Override
|
@Override
|
||||||
public BlockEntity getBlockEntity(BlockPos pos) {
|
public BlockEntity getBlockEntity(BlockPos pos) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 62417156dd3e7e68e657f322c089fb6f30a11c0e..34d108a3177b31d0094d6d81c180081cc728bcd4 100644
|
index 62417156dd3e7e68e657f322c089fb6f30a11c0e..0d0f721fe80c52d92d91843ae9970c5fd55ca143 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -33,6 +33,7 @@ import net.minecraft.core.SectionPos;
|
@@ -33,6 +33,7 @@ import net.minecraft.core.SectionPos;
|
||||||
@ -3862,15 +3777,6 @@ index 62417156dd3e7e68e657f322c089fb6f30a11c0e..34d108a3177b31d0094d6d81c180081c
|
|||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.util.profiling.ProfilerFiller;
|
import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
@@ -86,7 +87,7 @@ public class LevelChunk implements ChunkAccess {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@Nullable
|
|
||||||
- public static final LevelChunkSection EMPTY_SECTION = null;
|
|
||||||
+ public static final LevelChunkSection EMPTY_SECTION = null; @Deprecated public static final LevelChunkSection EMPTY_CHUNK_SECTION = EMPTY_SECTION; // Paper - OBFHELPER
|
|
||||||
private final LevelChunkSection[] sections;
|
|
||||||
private ChunkBiomeContainer biomes;
|
|
||||||
private final Map<BlockPos, CompoundTag> pendingBlockEntities;
|
|
||||||
@@ -107,7 +108,7 @@ public class LevelChunk implements ChunkAccess {
|
@@ -107,7 +108,7 @@ public class LevelChunk implements ChunkAccess {
|
||||||
private Supplier<ChunkHolder.FullChunkStatus> fullStatus;
|
private Supplier<ChunkHolder.FullChunkStatus> fullStatus;
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -4099,65 +4005,6 @@ index 62417156dd3e7e68e657f322c089fb6f30a11c0e..34d108a3177b31d0094d6d81c180081c
|
|||||||
this.setUnsaved(true);
|
this.setUnsaved(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/Palette.java b/src/main/java/net/minecraft/world/level/chunk/Palette.java
|
|
||||||
index 967cc874eacdb8f589e548b0ee3d60efff72392e..b5c67a9733ef2f738d00174bb4f4251a6c2f24ea 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/Palette.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/Palette.java
|
|
||||||
@@ -6,10 +6,12 @@ import net.minecraft.nbt.ListTag;
|
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
|
||||||
|
|
||||||
public interface Palette<T> {
|
|
||||||
+ @Deprecated default int getOrCreateIdFor(T object) { return this.idFor(object); } // Paper - OBFHELPER
|
|
||||||
int idFor(T object);
|
|
||||||
|
|
||||||
boolean maybeHas(Predicate<T> predicate);
|
|
||||||
|
|
||||||
+ @Deprecated @Nullable default T getObject(int dataBits) { return this.valueFor(dataBits); } // Paper - OBFHELPER
|
|
||||||
@Nullable
|
|
||||||
T valueFor(int index);
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
|
||||||
index 527238373b944a1e4a6e3a408534c72dd4c84035..c874515f1f460bd66baa47c9b8984ef875e735fb 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
|
||||||
@@ -20,7 +20,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
|
||||||
private static final int SIZE = 4096;
|
|
||||||
public static final int GLOBAL_PALETTE_BITS = 9;
|
|
||||||
public static final int MIN_PALETTE_SIZE = 4;
|
|
||||||
- private final Palette<T> globalPalette;
|
|
||||||
+ private final Palette<T> globalPalette; @Deprecated private final Palette<T> getDataPaletteGlobal() { return this.globalPalette; } // Paper - OBFHELPER
|
|
||||||
private final PaletteResize<T> dummyPaletteResize = (newSize, added) -> {
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
@@ -28,9 +28,9 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
|
||||||
private final Function<CompoundTag, T> reader;
|
|
||||||
private final Function<T, CompoundTag> writer;
|
|
||||||
private final T defaultValue;
|
|
||||||
- protected BitStorage storage;
|
|
||||||
- private Palette<T> palette;
|
|
||||||
- private int bits;
|
|
||||||
+ protected BitStorage storage; @Deprecated public final BitStorage getDataBits() { return this.storage; } // Paper - OBFHELPER
|
|
||||||
+ private Palette<T> palette; @Deprecated private Palette<T> getDataPalette() { return this.palette; } // Paper - OBFHELPER
|
|
||||||
+ private int bits; @Deprecated private int getBitsPerObject() { return this.bits; } // Paper - OBFHELPER
|
|
||||||
private final Semaphore lock = new Semaphore(1);
|
|
||||||
@Nullable
|
|
||||||
private final DebugBuffer<Pair<Thread, StackTraceElement[]>> traces = null;
|
|
||||||
@@ -61,6 +61,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
|
||||||
return y << 8 | z << 4 | x;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated private void initialize(int bitsPerObject) { this.setBits(bitsPerObject); } // Paper - OBFHELPER
|
|
||||||
private void setBits(int size) {
|
|
||||||
if (size != this.bits) {
|
|
||||||
this.bits = size;
|
|
||||||
@@ -159,6 +160,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public void writeDataPaletteBlock(FriendlyByteBuf packetDataSerializer) { this.write(packetDataSerializer); } // Paper - OBFHELPER
|
|
||||||
public void write(FriendlyByteBuf buf) {
|
|
||||||
try {
|
|
||||||
this.acquire();
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
index c0b68bd470d245121e14b75e2c97f6616b83c92a..39fe8f64528ad08594aaaa88e5c989c82e4e29d3 100644
|
index c0b68bd470d245121e14b75e2c97f6616b83c92a..39fe8f64528ad08594aaaa88e5c989c82e4e29d3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
@ -4181,43 +4028,6 @@ index c0b68bd470d245121e14b75e2c97f6616b83c92a..39fe8f64528ad08594aaaa88e5c989c8
|
|||||||
@Override
|
@Override
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
public BlockState getBlockState(BlockPos pos) {
|
||||||
int i = pos.getY();
|
int i = pos.getY();
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java b/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java
|
|
||||||
index ed4539f25dbd5b1c5c48b70a8d1e9f63fff5d964..79c8315e145befac4cab7d42d006e8f42105b6d9 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/IOWorker.java
|
|
||||||
@@ -26,7 +26,7 @@ public class IOWorker implements AutoCloseable {
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
|
||||||
private final AtomicBoolean shutdownRequested = new AtomicBoolean();
|
|
||||||
private final ProcessorMailbox<StrictQueue.IntRunnable> mailbox;
|
|
||||||
- private final RegionFileStorage storage;
|
|
||||||
+ private final RegionFileStorage storage;@Deprecated public RegionFileStorage getRegionFileCache() { return storage; } // Paper - OBFHELPER
|
|
||||||
private final Map<ChunkPos, IOWorker.PendingStore> pendingWrites = Maps.newLinkedHashMap();
|
|
||||||
|
|
||||||
protected IOWorker(File directory, boolean dsync, String name) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
|
||||||
index 1441888430687b9de2a67f21ed426f16d5b30538..289c82bc490201eff896534261e6a2edef2ea8dc 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
|
||||||
@@ -121,6 +121,7 @@ public class RegionFile implements AutoCloseable {
|
|
||||||
return this.externalFileDir.resolve(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated @Nullable public synchronized DataInputStream getReadStream(ChunkPos chunkCoordIntPair) throws IOException { return getChunkDataInputStream(chunkCoordIntPair);} // Paper - OBFHELPER
|
|
||||||
@Nullable
|
|
||||||
public synchronized DataInputStream getChunkDataInputStream(ChunkPos pos) throws IOException {
|
|
||||||
int i = this.getOffset(pos);
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
|
||||||
index 5af90e0f7222356cb0e905a9b6e0c4eac5617a41..eaf5b5794061d034cc5e1f80f5acd7f5b6688a30 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
|
||||||
@@ -34,6 +34,7 @@ public final class Shapes {
|
|
||||||
return EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public static final VoxelShape fullCube() {return block();} // Paper - OBFHELPER
|
|
||||||
public static VoxelShape block() {
|
|
||||||
return BLOCK;
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
index 836ee63b7ea73165257acbcdf5c7336a2a2e36f3..2b4a922b84eeb2b1b64e43a2ca8bf16dcf58218e 100644
|
index 836ee63b7ea73165257acbcdf5c7336a2a2e36f3..2b4a922b84eeb2b1b64e43a2ca8bf16dcf58218e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
|
@ -767,7 +767,7 @@ index b3a6aeba2363d283f03982cf749f25cfa11a5052..449f1b2f5dca350dc0912e14c8c2bf3e
|
|||||||
PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet);
|
PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 1b76d1b929b85b130639e7937a118342b568e795..46bd0b6f8b13c64993ed1deeb8cfa7c105ee3cd9 100644
|
index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b403ef2dff6 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -183,7 +183,7 @@ import org.bukkit.craftbukkit.Main;
|
@@ -183,7 +183,7 @@ import org.bukkit.craftbukkit.Main;
|
||||||
@ -779,17 +779,6 @@ index 1b76d1b929b85b130639e7937a118342b568e795..46bd0b6f8b13c64993ed1deeb8cfa7c1
|
|||||||
import org.spigotmc.SlackActivityAccountant; // Spigot
|
import org.spigotmc.SlackActivityAccountant; // Spigot
|
||||||
|
|
||||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements SnooperPopulator, CommandSource, AutoCloseable {
|
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements SnooperPopulator, CommandSource, AutoCloseable {
|
||||||
@@ -259,8 +259,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
||||||
private long lastServerStatus;
|
|
||||||
public final Thread serverThread;
|
|
||||||
private long nextTickTime;
|
|
||||||
- private long delayedTasksMaxNextTickTime;
|
|
||||||
- private boolean mayHaveDelayedTasks;
|
|
||||||
+ private long delayedTasksMaxNextTickTime; @Deprecated final long getTickOversleepMaxTime() { return this.delayedTasksMaxNextTickTime; } // Paper - OBFHELPER
|
|
||||||
+ private boolean mayHaveDelayedTasks; @Deprecated final boolean hasExecutedTask() { return this.mayHaveDelayedTasks; } // Paper - OBFHELPER
|
|
||||||
private boolean hasWorldScreenshot;
|
|
||||||
private final PackRepository packRepository;
|
|
||||||
private final ServerScoreboard scoreboard;
|
|
||||||
@@ -887,6 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -887,6 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@ -809,7 +798,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..46bd0b6f8b13c64993ed1deeb8cfa7c1
|
|||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ boolean isOversleep = false;
|
+ boolean isOversleep = false;
|
||||||
+ private boolean canOversleep() {
|
+ private boolean canOversleep() {
|
||||||
+ return this.hasExecutedTask() && Util.getMillis() < this.getTickOversleepMaxTime();
|
+ return this.mayHaveDelayedTasks && Util.getMillis() < this.delayedTasksMaxNextTickTime;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ private boolean canSleepForTickNoOversleep() {
|
+ private boolean canSleepForTickNoOversleep() {
|
||||||
@ -1141,7 +1130,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
|
|||||||
|
|
||||||
public void broadcast(Entity entity, Packet<?> packet) {
|
public void broadcast(Entity entity, Packet<?> packet) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index db2bcc20d50f1833347f6edde67c366501d29c0f..e3abeb839c36b5238ec115329ce05b58e3383a55 100644
|
index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029eefdbb090 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -349,13 +349,15 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -349,13 +349,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@ -1627,7 +1616,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
|
|||||||
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
|
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
|
||||||
this.hurt(DamageSource.DROWN, 1.0F);
|
this.hurt(DamageSource.DROWN, 1.0F);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 20fafb95e98ac2e656999ea2208db166d841db9f..e967d612ffb2e4d2834e2057e9953f82c7a3d50b 100644
|
index e9dc71fb74698b2f11220e4eb379f21610899d97..b73b40e8f55a6f9e671878b81ef513b9416c9c8c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -82,7 +82,6 @@ import org.bukkit.Bukkit;
|
@@ -82,7 +82,6 @@ import org.bukkit.Bukkit;
|
||||||
@ -1656,7 +1645,7 @@ index 20fafb95e98ac2e656999ea2208db166d841db9f..e967d612ffb2e4d2834e2057e9953f82
|
|||||||
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
|
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
|
||||||
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
|
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
|
||||||
}
|
}
|
||||||
@@ -721,15 +720,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -720,15 +719,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
timings.tileEntityTick.stopTiming(); // Spigot
|
timings.tileEntityTick.stopTiming(); // Spigot
|
||||||
this.tickingBlockEntities = false;
|
this.tickingBlockEntities = false;
|
||||||
@ -1765,7 +1754,7 @@ index 92b042080f06fb95958ff5e824830a84f2d1f2a6..7b333e2d6884b272abefbc820bcce802
|
|||||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||||
public CraftPersistentDataContainer persistentDataContainer;
|
public CraftPersistentDataContainer persistentDataContainer;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 34d108a3177b31d0094d6d81c180081cc728bcd4..f8873d76b675e062619d849ffe78376668c8289f 100644
|
index 0d0f721fe80c52d92d91843ae9970c5fd55ca143..3e2bc640a06667f0d4f3c2367ac794514a1be35c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -725,6 +725,7 @@ public class LevelChunk implements ChunkAccess {
|
@@ -725,6 +725,7 @@ public class LevelChunk implements ChunkAccess {
|
||||||
|
@ -966,7 +966,7 @@ index b82b218be1bd849fa280ea1fe0336e279bebfc18..2fb444653118816f1250841cb4c6c486
|
|||||||
public static ChatFormatting getById(int colorIndex) {
|
public static ChatFormatting getById(int colorIndex) {
|
||||||
if (colorIndex < 0) {
|
if (colorIndex < 0) {
|
||||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
index 3b8207046d38d3d14719ff6761a22e60a93628b7..c15860c77c7c24b1946c22f140f1b5c12b052ade 100644
|
index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d8689d9381a 100644
|
||||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
@@ -14,6 +14,7 @@ import io.netty.handler.codec.EncoderException;
|
@@ -14,6 +14,7 @@ import io.netty.handler.codec.EncoderException;
|
||||||
@ -985,7 +985,7 @@ index 3b8207046d38d3d14719ff6761a22e60a93628b7..c15860c77c7c24b1946c22f140f1b5c1
|
|||||||
public static final short MAX_STRING_LENGTH = 32767;
|
public static final short MAX_STRING_LENGTH = 32767;
|
||||||
public static final int MAX_COMPONENT_STRING_LENGTH = 262144;
|
public static final int MAX_COMPONENT_STRING_LENGTH = 262144;
|
||||||
|
|
||||||
@@ -327,8 +329,15 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -326,8 +328,15 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
return Component.Serializer.fromJson(this.readUtf(262144));
|
return Component.Serializer.fromJson(this.readUtf(262144));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1251,7 +1251,7 @@ index 2b0d989119c9f69a68a6c1c69fb09dbbedd16716..172536147305f283bd14d356ff4f3953
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.chatVisibility = packet.getChatVisibility();
|
this.chatVisibility = packet.getChatVisibility();
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index f4f6f3e388a39efd2b076616350c49a0e8e65908..cfe2361b0af12e6333f65487f27b50e2cbc16168 100644
|
index 8a77e28c9b12a110c721943aca545270ef8bbaef..8b082713c1bd41ff9d26ce45c949514ae8aec6ef 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -162,6 +162,8 @@ import org.apache.logging.log4j.LogManager;
|
@@ -162,6 +162,8 @@ import org.apache.logging.log4j.LogManager;
|
||||||
|
@ -31,7 +31,7 @@ index 0b63d81ecbcb56bf3dc25661cc2b219cd8c25592..018792503e5d18470ad17b9f4b4524d5
|
|||||||
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
|
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1456dd2ef7ff28701555f4ac4b7645794ccee640 100644
|
index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1dde3e92725883c277f9a8e78cb6a56238af3254 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
@@ -103,6 +103,7 @@ public abstract class Mob extends LivingEntity {
|
@@ -103,6 +103,7 @@ public abstract class Mob extends LivingEntity {
|
||||||
@ -49,7 +49,7 @@ index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1456dd2ef7ff28701555f4ac4b764579
|
|||||||
- if (!this.aware) return; // CraftBukkit
|
- if (!this.aware) return; // CraftBukkit
|
||||||
+ if (!this.aware) { // Paper start - Allow nerfed mobs to jump, float and take water damage
|
+ if (!this.aware) { // Paper start - Allow nerfed mobs to jump, float and take water damage
|
||||||
+ if (goalFloat != null) {
|
+ if (goalFloat != null) {
|
||||||
+ if (goalFloat.validConditions()) goalFloat.tick();
|
+ if (goalFloat.canUse()) goalFloat.tick();
|
||||||
+ this.getJumpControl().tick();
|
+ this.getJumpControl().tick();
|
||||||
+ }
|
+ }
|
||||||
+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) {
|
+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) {
|
||||||
@ -62,10 +62,10 @@ index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1456dd2ef7ff28701555f4ac4b764579
|
|||||||
this.sensing.tick();
|
this.sensing.tick();
|
||||||
this.level.getProfiler().pop();
|
this.level.getProfiler().pop();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
|
||||||
index 54085b104547f2fe7c08ff8aa4839b1230877bca..730788a1ceba4390d2638e22c6409ab86f6351e6 100644
|
index 54085b104547f2fe7c08ff8aa4839b1230877bca..08bb9a723dd11be66bec2e852dc345a22d926bea 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
|
||||||
@@ -9,10 +9,12 @@ public class FloatGoal extends Goal {
|
@@ -9,6 +9,7 @@ public class FloatGoal extends Goal {
|
||||||
|
|
||||||
public FloatGoal(Mob mob) {
|
public FloatGoal(Mob mob) {
|
||||||
this.mob = mob;
|
this.mob = mob;
|
||||||
@ -73,8 +73,3 @@ index 54085b104547f2fe7c08ff8aa4839b1230877bca..730788a1ceba4390d2638e22c6409ab8
|
|||||||
this.setFlags(EnumSet.of(Goal.Flag.JUMP));
|
this.setFlags(EnumSet.of(Goal.Flag.JUMP));
|
||||||
mob.getNavigation().setCanFloat(true);
|
mob.getNavigation().setCanFloat(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ @Deprecated public final boolean validConditions() { return this.canUse(); } // Paper - OBFHELPER
|
|
||||||
@Override
|
|
||||||
public boolean canUse() {
|
|
||||||
return this.mob.isInWater() && this.mob.getFluidHeight(FluidTags.WATER) > this.mob.getFluidJumpThreshold() || this.mob.isInLava();
|
|
||||||
|
@ -4,18 +4,6 @@ Date: Tue, 1 Mar 2016 14:47:52 -0600
|
|||||||
Subject: [PATCH] Player affects spawning API
|
Subject: [PATCH] Player affects spawning API
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
index 018792503e5d18470ad17b9f4b4524d5dfba31e9..023396b4cb9eeeb345cde43a4d7bdf514575f350 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
@@ -1498,6 +1498,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
|
||||||
return Mth.sqrt(f * f + f1 * f1 + f2 * f2);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public double getDistanceSquared(double x, double y, double z) { return distanceToSqr(x, y, z); } // Paper - OBFHELPER
|
|
||||||
public double distanceToSqr(double x, double y, double z) {
|
|
||||||
double d3 = this.getX() - x;
|
|
||||||
double d4 = this.getY() - y;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||||
index 195989667c7d844399a72787819f62a3fd0d9c78..d17b75ad13bbc8a38cdc2f2d77ee5d88438cec31 100644
|
index 195989667c7d844399a72787819f62a3fd0d9c78..d17b75ad13bbc8a38cdc2f2d77ee5d88438cec31 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||||
@ -33,7 +21,7 @@ index 195989667c7d844399a72787819f62a3fd0d9c78..d17b75ad13bbc8a38cdc2f2d77ee5d88
|
|||||||
public static Predicate<Entity> withinDistance(double x, double y, double z, double max) {
|
public static Predicate<Entity> withinDistance(double x, double y, double z, double max) {
|
||||||
double d4 = max * max;
|
double d4 = max * max;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
index 2b34b4680afd2d0c22fbae798fe1efd5df33a14f..18ea26c8e17da03f35c3fd0788a385cc492ff544 100644
|
index 26d5b58eb665da53eda30a19300df4c0928c41ef..1039c379b5f39178c568ff9c357a1cf948e0429a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
@@ -766,7 +766,7 @@ public abstract class Mob extends LivingEntity {
|
@@ -766,7 +766,7 @@ public abstract class Mob extends LivingEntity {
|
||||||
@ -86,7 +74,7 @@ index 03bdbb832ff6a86f2dac9c008de45f3bb53aa688..a003e1c0d99a4d4c88269ea5bad250ba
|
|||||||
|
|
||||||
public void clientTick(Level world, BlockPos pos) {
|
public void clientTick(Level world, BlockPos pos) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||||
index 389985e022b82c675fb21f363422471bd15b84b0..1a921a7e4ff5a1947559c30116ddb5e0596961e7 100644
|
index 389985e022b82c675fb21f363422471bd15b84b0..849616d9ad140285f7aa4d2ffafd6371f3904bd5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
|
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||||
@@ -71,8 +71,8 @@ public interface EntityGetter {
|
@@ -71,8 +71,8 @@ public interface EntityGetter {
|
||||||
@ -118,7 +106,7 @@ index 389985e022b82c675fb21f363422471bd15b84b0..1a921a7e4ff5a1947559c30116ddb5e0
|
|||||||
+ entityhuman = (Player) iterator.next();
|
+ entityhuman = (Player) iterator.next();
|
||||||
+ } while (!EntitySelector.affectsSpawning.test(entityhuman));
|
+ } while (!EntitySelector.affectsSpawning.test(entityhuman));
|
||||||
+
|
+
|
||||||
+ d4 = entityhuman.getDistanceSquared(d0, d1, d2);
|
+ d4 = entityhuman.distanceToSqr(d0, d1, d2);
|
||||||
+ } while (d3 >= 0.0D && d4 >= d3 * d3);
|
+ } while (d3 >= 0.0D && d4 >= d3 * d3);
|
||||||
+
|
+
|
||||||
+ return true;
|
+ return true;
|
||||||
|
@ -21,7 +21,7 @@ index 5c5cfc31ced6695af7b1dd06cb867274fa38d85f..d5a12238317f1c85b9ad8cb63b936e50
|
|||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index a65646832867e62c758eae3ee1359bdd0d810835..110177551183d1ac33a22b5b8c2c5c39697c220b 100644
|
index 018792503e5d18470ad17b9f4b4524d5dfba31e9..5d4d5628e5c0d82301f988691eac363758af6a4b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -280,6 +280,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -280,6 +280,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@ -52,20 +52,20 @@ index a65646832867e62c758eae3ee1359bdd0d810835..110177551183d1ac33a22b5b8c2c5c39
|
|||||||
// Spigot start
|
// Spigot start
|
||||||
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
|
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
|
||||||
public final boolean defaultActivationState;
|
public final boolean defaultActivationState;
|
||||||
@@ -1813,6 +1834,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1812,6 +1833,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
this.bukkitEntity.storeBukkitValues(nbt);
|
this.bukkitEntity.storeBukkitValues(nbt);
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
+ // Paper start - Save the entity's origin location
|
+ // Paper start - Save the entity's origin location
|
||||||
+ if (this.origin != null) {
|
+ if (this.origin != null) {
|
||||||
+ nbt.setUUID("Paper.OriginWorld", originWorld);
|
+ nbt.putUUID("Paper.OriginWorld", originWorld);
|
||||||
+ nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
+ nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
return nbt;
|
return nbt;
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||||
@@ -1939,6 +1966,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1938,6 +1965,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity and entity crashes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index d106ab5bbe0647aa2ad285baaabb62b79ced3c06..c427c105c653a0b0de6ad33d1d6f622a31a5a680 100644
|
index d29334b5dee6fe3f292f774442304b7dc6b0e2f0..d6ed061e36668ea1cbaee44c06575534336008fc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -730,11 +730,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -729,11 +729,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
try {
|
try {
|
||||||
tickConsumer.accept(entity);
|
tickConsumer.accept(entity);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@ -26,7 +26,7 @@ index d106ab5bbe0647aa2ad285baaabb62b79ced3c06..c427c105c653a0b0de6ad33d1d6f622a
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||||
index 0e70d9df226e0843a943b3a57d1319ce1bca2543..d6a4a2a59f1be0cc2e373dc326287b60db5559d2 100644
|
index 7b333e2d6884b272abefbc820bcce8026a4cdf7e..66ab4deedd177f507d170a61ceca4c3ebbac9adc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||||
@@ -196,7 +196,12 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
|
@@ -196,7 +196,12 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
|
||||||
@ -44,7 +44,7 @@ index 0e70d9df226e0843a943b3a57d1319ce1bca2543..d6a4a2a59f1be0cc2e373dc326287b60
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index ee2df7de72c75e4fbf8a681ff254260554969b66..a6e8a8de17acc6c7c0bdeea01544a334797b69b6 100644
|
index 743aafec1f1c819846813688355dd90534dddb3e..21f613b8d7785b996866b5059f3cb1bc87533d2e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -1241,11 +1241,11 @@ public class LevelChunk implements ChunkAccess {
|
@@ -1241,11 +1241,11 @@ public class LevelChunk implements ChunkAccess {
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 794d43e6f1a2019f67daf7a93498225924c4394b..56362678e8de38c541fc851abf783f385a7903bf 100644
|
index f599b1e7eb6fddb339294265fe635fa7b3bb5996..da8e6f5b48a83ca4178c0de439200b7952f409d9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -696,9 +696,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -695,9 +695,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Spigot start
|
// Spigot start
|
||||||
// Iterator iterator = this.blockEntityTickers.iterator();
|
// Iterator iterator = this.blockEntityTickers.iterator();
|
||||||
int tilesThisCycle = 0;
|
int tilesThisCycle = 0;
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
index c15860c77c7c24b1946c22f140f1b5c12b052ade..c0966a873ea5e265936e17796bf6bbee62eea9b4 100644
|
index cbc968d0d514f01b26888f3ff8264d8689d9381a..e38e53bd39c384bac4d7111e6a2c721744a122f1 100644
|
||||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
@@ -333,6 +333,11 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -332,6 +332,11 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) {
|
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) {
|
||||||
return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
|
return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4
|
|||||||
// Paper end
|
// Paper end
|
||||||
buf.writeComponent(this.text);
|
buf.writeComponent(this.text);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 184ef22ba2f58f38ac1cc81818fc75eb9fb82a59..dab62713b33cdb7b2324216f7ad229db06e524d6 100644
|
index 4d73fa595ffdf04646f53f0e8ef7795d632ca4f2..8b2f018875d64de96abe99b587f113b256889a0e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
|
@ -23,10 +23,10 @@ index 416a6760883cb40367535c7c5acd779742bb8af5..670efbe53241a0ae32d618c83da601cc
|
|||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index dbe30ad6a729c5a99f7ff977134738e509dcadad..881e295be6908d0e14147e2d57dd2974aa972725 100644
|
index 43ebe01b6b19870cdc130292fe69e6943fc745df..c6f1ca72cd368925051fcfc46c524198c7693d67 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2896,7 +2896,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2895,7 +2895,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
double d4 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType());
|
double d4 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType());
|
||||||
BlockPos blockposition = new BlockPos(Mth.clamp(this.getX() * d4, d0, d2), this.getY(), Mth.clamp(this.getZ() * d4, d1, d3));
|
BlockPos blockposition = new BlockPos(Mth.clamp(this.getX() * d4, d0, d2), this.getY(), Mth.clamp(this.getZ() * d4, d1, d3));
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 39cfa8211f02acaa0851e0cfc1c2890475d609f4..da97afe93a98daac33f143c6da0b42f71db25dba 100644
|
index 3b1565309165e10b147d08b8245ea0bce50dc3c2..4ebb839076a2d1f5e2acc6d5a8dfcf3545b37721 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -825,6 +825,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -825,6 +825,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@ -61,7 +61,7 @@ index 39cfa8211f02acaa0851e0cfc1c2890475d609f4..da97afe93a98daac33f143c6da0b42f7
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
||||||
index 60a6d35e8467545e211aa1756cd1494f440f1d78..da515ac94aa3c294855f28e6deb9094cc7187dd9 100644
|
index 741bc569617c66f90ded58a28dd3ad0e4e8b1e8c..8e27b43e2f6ce4d7f5007fe02db1722e73c30a58 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@ -108,7 +108,7 @@ index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962de
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 56362678e8de38c541fc851abf783f385a7903bf..a6b1572a82fd22eea5b3d4124c510d94fea5917d 100644
|
index da8e6f5b48a83ca4178c0de439200b7952f409d9..969a5ed2484036103834dc23b57b33c11896d72f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1,5 +1,10 @@
|
@@ -1,5 +1,10 @@
|
||||||
@ -122,7 +122,7 @@ index 56362678e8de38c541fc851abf783f385a7903bf..a6b1572a82fd22eea5b3d4124c510d94
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.mojang.serialization.Codec;
|
import com.mojang.serialization.Codec;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -730,8 +735,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -729,8 +734,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
tickConsumer.accept(entity);
|
tickConsumer.accept(entity);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
// Paper start - Prevent tile entity and entity crashes
|
// Paper start - Prevent tile entity and entity crashes
|
||||||
@ -155,7 +155,7 @@ index b4a7776ba9486bbca42ffb596c8a8bcdf6471ce3..59fae60116167baf989e85596334824e
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index cbc2a9a3e9943c20cae645fbb18f0aa29415bd63..b36a893ded952d1a5ed1a55eae9c3c406848e1f3 100644
|
index 21f613b8d7785b996866b5059f3cb1bc87533d2e..249f39bc0c5820e313cad7813bd1087cb2e09ed6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -1,6 +1,7 @@
|
@@ -1,6 +1,7 @@
|
||||||
@ -199,10 +199,10 @@ index cbc2a9a3e9943c20cae645fbb18f0aa29415bd63..b36a893ded952d1a5ed1a55eae9c3c40
|
|||||||
// Paper end
|
// Paper end
|
||||||
// Spigot start
|
// Spigot start
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
index 2da42f1bc6922adae32d782aac780a7e0e94e352..659305865e9c6d9996fcf2596d086050508059cd 100644
|
index 1441888430687b9de2a67f21ed426f16d5b30538..f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
@@ -278,6 +278,7 @@ public class RegionFile implements AutoCloseable {
|
@@ -277,6 +277,7 @@ public class RegionFile implements AutoCloseable {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
@ -210,7 +210,7 @@ index 2da42f1bc6922adae32d782aac780a7e0e94e352..659305865e9c6d9996fcf2596d086050
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -359,6 +360,7 @@ public class RegionFile implements AutoCloseable {
|
@@ -358,6 +359,7 @@ public class RegionFile implements AutoCloseable {
|
||||||
((java.nio.Buffer) bytebuffer).position(5); // CraftBukkit - decompile error
|
((java.nio.Buffer) bytebuffer).position(5); // CraftBukkit - decompile error
|
||||||
filechannel.write(bytebuffer);
|
filechannel.write(bytebuffer);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
|
@ -25,10 +25,10 @@ index abbbe1786eb68af02f9d39650aad730ac44aac8a..3ac2ac3db9b1c271b3c21930bb137166
|
|||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 881e295be6908d0e14147e2d57dd2974aa972725..0d8590368ed35bd95f3b8abcd34eb172ef8ae43b 100644
|
index c6f1ca72cd368925051fcfc46c524198c7693d67..4b2240329e86f190d396418cc7c585ee49247602 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2545,6 +2545,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2544,6 +2544,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Team getTeam() {
|
public Team getTeam() {
|
||||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Chunk Save Reattempt
|
|||||||
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
|
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
index 659305865e9c6d9996fcf2596d086050508059cd..1a35ef48c487c92f55fcbbfc19a708ededc6a32d 100644
|
index f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9..84327c8fe1dc62c7b99950261a344042b4456616 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
@@ -278,7 +278,7 @@ public class RegionFile implements AutoCloseable {
|
@@ -277,7 +277,7 @@ public class RegionFile implements AutoCloseable {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
|
@ -19,7 +19,7 @@ index 9b98eddb8238e36b17989d6f685ddc950151a7f8..b8a816a2f58c1ab51271f027f500d08b
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 76182fd83d6dcd2359dd8d8a75e7e15304dc5d0f..fc7896e22b31f6ca0bb4b249d327f3f3ef52caf6 100644
|
index 76182fd83d6dcd2359dd8d8a75e7e15304dc5d0f..9f69dfcb5d9cbbcd01dd2e5e02437967da7a4a17 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -309,11 +309,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -309,11 +309,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -34,7 +34,7 @@ index 76182fd83d6dcd2359dd8d8a75e7e15304dc5d0f..fc7896e22b31f6ca0bb4b249d327f3f3
|
|||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public final boolean isLoadedAndInBounds(BlockPos blockposition) { // Paper - final for inline
|
+ public final boolean isLoadedAndInBounds(BlockPos blockposition) { // Paper - final for inline
|
||||||
+ return getWorldBorder().isInBounds(blockposition) && getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
|
+ return getWorldBorder().isWithinBounds(blockposition) && getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public LevelChunk getChunkIfLoaded(int x, int z) { // Overridden in WorldServer for ABI compat which has final
|
+ public LevelChunk getChunkIfLoaded(int x, int z) { // Overridden in WorldServer for ABI compat which has final
|
||||||
@ -46,20 +46,8 @@ index 76182fd83d6dcd2359dd8d8a75e7e15304dc5d0f..fc7896e22b31f6ca0bb4b249d327f3f3
|
|||||||
+
|
+
|
||||||
+ // reduces need to do isLoaded before getType
|
+ // reduces need to do isLoaded before getType
|
||||||
+ public final BlockState getTypeIfLoadedAndInBounds(BlockPos blockposition) {
|
+ public final BlockState getTypeIfLoadedAndInBounds(BlockPos blockposition) {
|
||||||
+ return getWorldBorder().isInBounds(blockposition) ? getTypeIfLoaded(blockposition) : null;
|
+ return getWorldBorder().isWithinBounds(blockposition) ? getTypeIfLoaded(blockposition) : null;
|
||||||
+ }
|
+ }
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
|
||||||
index a0c4bc4eb42a3d2de6f66510d88f92c06b535353..5c1a2e88f4f5e78a481b8845b77be9c38aa8497f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
|
||||||
@@ -32,6 +32,7 @@ public class WorldBorder {
|
|
||||||
|
|
||||||
public WorldBorder() {}
|
|
||||||
|
|
||||||
+ @Deprecated public final boolean isInBounds(BlockPos blockposition) { return this.isWithinBounds(blockposition); } // Paper - OBFHELPER
|
|
||||||
public boolean isWithinBounds(BlockPos pos) {
|
|
||||||
return (double) (pos.getX() + 1) > this.getMinX() && (double) pos.getX() < this.getMaxX() && (double) (pos.getZ() + 1) > this.getMinZ() && (double) pos.getZ() < this.getMaxZ();
|
|
||||||
}
|
|
||||||
|
@ -13,7 +13,7 @@ Replace all calls to the new place to the unnecessary forward.
|
|||||||
Optimize getType and getBlockData to manually inline and optimize the calls
|
Optimize getType and getBlockData to manually inline and optimize the calls
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
|
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
|
||||||
index f4b5792e080d5181184eb661d005ce6cab649bf3..35b26f4a4554541affbf76df38fed0f7e555c9b9 100644
|
index 964bec1d3fecfe43a43bd9968159fca069f00dfd..e188f130e47ef319477050981de53a7410452592 100644
|
||||||
--- a/src/main/java/net/minecraft/core/Vec3i.java
|
--- a/src/main/java/net/minecraft/core/Vec3i.java
|
||||||
+++ b/src/main/java/net/minecraft/core/Vec3i.java
|
+++ b/src/main/java/net/minecraft/core/Vec3i.java
|
||||||
@@ -21,6 +21,15 @@ public class Vec3i implements Comparable<Vec3i> {
|
@@ -21,6 +21,15 @@ public class Vec3i implements Comparable<Vec3i> {
|
||||||
@ -33,7 +33,7 @@ index f4b5792e080d5181184eb661d005ce6cab649bf3..35b26f4a4554541affbf76df38fed0f7
|
|||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index aee97243cc3e73f9e07ba8ed5d6dbe8c73ba016e..fdab998241a682bc3d75094e0893f98886e06266 100644
|
index 8592de5a5541fbff8ec85bfce8635a780097c4d4..bbe2d5eab844880f2fde674aa1c78d60d6152231 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -90,7 +90,7 @@ index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1
|
|||||||
@Override
|
@Override
|
||||||
public FluidState getFluidState(BlockPos pos) {
|
public FluidState getFluidState(BlockPos pos) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index b36a893ded952d1a5ed1a55eae9c3c406848e1f3..092f2cd5806e8609b952e7678c0c38b235c52264 100644
|
index 249f39bc0c5820e313cad7813bd1087cb2e09ed6..b737ffb8af88e7978c3bfc0b2e61639aca3376c0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess {
|
@@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess {
|
||||||
@ -152,10 +152,10 @@ index 03fd5684aec8fa0d87963f2adcd8244e92840917..5fd66020a937b641e2a060cf38df731a
|
|||||||
|
|
||||||
public FluidState getFluidState(int x, int y, int z) {
|
public FluidState getFluidState(int x, int y, int z) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
index 4a6781919eb78abc33f549693d88019b42ef6e95..5ea60bbb56450502f1ceb41959239ab579458ac2 100644
|
index 527238373b944a1e4a6e3a408534c72dd4c84035..bb8fd88aebb550edec8c679622a02a595cbc6694 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
@@ -136,7 +136,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -135,7 +135,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public T get(int x, int y, int z) {
|
public T get(int x, int y, int z) {
|
||||||
@ -165,7 +165,7 @@ index 4a6781919eb78abc33f549693d88019b42ef6e95..5ea60bbb56450502f1ceb41959239ab5
|
|||||||
|
|
||||||
protected T get(int index) {
|
protected T get(int index) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
index 39fe8f64528ad08594aaaa88e5c989c82e4e29d3..da36e6d40ad3e8b7cdbe09ef911d1e5b8c28670f 100644
|
index 39fe8f64528ad08594aaaa88e5c989c82e4e29d3..873fea54aecca411b6dee1ed3566f93c4fb9670f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
@@ -104,14 +104,18 @@ public class ProtoChunk implements ChunkAccess {
|
@@ -104,14 +104,18 @@ public class ProtoChunk implements ChunkAccess {
|
||||||
@ -184,7 +184,7 @@ index 39fe8f64528ad08594aaaa88e5c989c82e4e29d3..da36e6d40ad3e8b7cdbe09ef911d1e5b
|
|||||||
- LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(i)];
|
- LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(i)];
|
||||||
- return LevelChunkSection.isEmpty(levelChunkSection) ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15);
|
- return LevelChunkSection.isEmpty(levelChunkSection) ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15);
|
||||||
+ LevelChunkSection chunksection = this.getSections()[this.getSectionIndex(y)];
|
+ LevelChunkSection chunksection = this.getSections()[this.getSectionIndex(y)];
|
||||||
+ return chunksection == LevelChunk.EMPTY_CHUNK_SECTION || chunksection.isEmpty() ? Blocks.AIR.defaultBlockState() : chunksection.getBlockState(x & 15, y & 15, z & 15);
|
+ return chunksection == LevelChunk.EMPTY_SECTION || chunksection.isEmpty() ? Blocks.AIR.defaultBlockState() : chunksection.getBlockState(x & 15, y & 15, z & 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
|
|||||||
Saves on some object allocation and processing when no plugin listens to this
|
Saves on some object allocation and processing when no plugin listens to this
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 3b4e679cc3c711635e6e2f3906a0afd2142c7849..9e936078b388459bed7da3c6edfd0e65f3b1b1bf 100644
|
index 6826d1e4b7f1595f17a118e8f146bb19f3ef9256..e250db8035b2d53e724a47da6dc6118d85ca148b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1363,6 +1363,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1363,6 +1363,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -18,7 +18,7 @@ index 3b4e679cc3c711635e6e2f3906a0afd2142c7849..9e936078b388459bed7da3c6edfd0e65
|
|||||||
this.profiler.push(() -> {
|
this.profiler.push(() -> {
|
||||||
return worldserver + " " + worldserver.dimension().location();
|
return worldserver + " " + worldserver.dimension().location();
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 07c9a4438a940e85625e715ceb4e01821dc9cc4b..f97df3dcc1dac794591dceea0fe41bcd0843e2ce 100644
|
index 0d6a67fdd83de0c62f6e2a90d0107cbebbac3a37..a846f7136d29bd1d8f8ed30d79fa8936fe386618 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -201,6 +201,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
@@ -201,6 +201,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
||||||
@ -30,7 +30,7 @@ index 07c9a4438a940e85625e715ceb4e01821dc9cc4b..f97df3dcc1dac794591dceea0fe41bcd
|
|||||||
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
|
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
|
||||||
return this.chunkSource.getChunk(x, z, false);
|
return this.chunkSource.getChunk(x, z, false);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index fdab998241a682bc3d75094e0893f98886e06266..81a8e314b5073a5888a3c04d53ff279c8142a7d4 100644
|
index bbe2d5eab844880f2fde674aa1c78d60d6152231..285389edd01b1b36dfa8363e7ceea3903229a618 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -470,7 +470,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -470,7 +470,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -42,7 +42,7 @@ index fdab998241a682bc3d75094e0893f98886e06266..81a8e314b5073a5888a3c04d53ff279c
|
|||||||
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
|
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
|
||||||
this.getCraftServer().getPluginManager().callEvent(event);
|
this.getCraftServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
@@ -580,7 +580,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -579,7 +579,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
try {
|
try {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
CraftWorld world = ((ServerLevel) this).getWorld();
|
CraftWorld world = ((ServerLevel) this).getWorld();
|
||||||
|
@ -32,7 +32,7 @@ index d2e71f1e70a8b3360110f7e5e6c5ec278218ae27..0ac90b5fefa9720a9d0130f5438e5ef5
|
|||||||
|
|
||||||
private int getSurfaceY() {
|
private int getSurfaceY() {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
index 92e1c43b0b7d901636b7fee7136e573f440e0179..34ce42afc6e822d209d2facc130b32e76836f40a 100644
|
index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..989a0c44d6685b5824a055d077fb0f28c1ba4b17 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
@@ -10,6 +10,7 @@ import net.minecraft.core.BlockPos;
|
@@ -10,6 +10,7 @@ import net.minecraft.core.BlockPos;
|
||||||
@ -43,15 +43,6 @@ index 92e1c43b0b7d901636b7fee7136e573f440e0179..34ce42afc6e822d209d2facc130b32e7
|
|||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.Mob;
|
import net.minecraft.world.entity.Mob;
|
||||||
@@ -26,7 +27,7 @@ import net.minecraft.world.phys.Vec3;
|
|
||||||
|
|
||||||
public abstract class PathNavigation {
|
|
||||||
private static final int MAX_TIME_RECOMPUTE = 20;
|
|
||||||
- protected final Mob mob;
|
|
||||||
+ protected final Mob mob; @Deprecated public Entity getEntity() { return mob; } // Paper - OBFHELPER
|
|
||||||
protected final Level level;
|
|
||||||
@Nullable
|
|
||||||
protected Path path;
|
|
||||||
@@ -108,7 +109,12 @@ public abstract class PathNavigation {
|
@@ -108,7 +109,12 @@ public abstract class PathNavigation {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -99,8 +90,8 @@ index 92e1c43b0b7d901636b7fee7136e573f440e0179..34ce42afc6e822d209d2facc130b32e7
|
|||||||
+ // Paper start - Pathfind event
|
+ // Paper start - Pathfind event
|
||||||
+ boolean copiedSet = false;
|
+ boolean copiedSet = false;
|
||||||
+ for (BlockPos possibleTarget : positions) {
|
+ for (BlockPos possibleTarget : positions) {
|
||||||
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(),
|
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(),
|
||||||
+ MCUtil.toLocation(getEntity().level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
|
+ MCUtil.toLocation(this.mob.level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
|
||||||
+ if (!copiedSet) {
|
+ if (!copiedSet) {
|
||||||
+ copiedSet = true;
|
+ copiedSet = true;
|
||||||
+ positions = new java.util.HashSet<>(positions);
|
+ positions = new java.util.HashSet<>(positions);
|
||||||
|
@ -4,32 +4,6 @@ Date: Thu, 31 Mar 2016 19:17:58 -0400
|
|||||||
Subject: [PATCH] Do not load chunks for Pathfinding
|
Subject: [PATCH] Do not load chunks for Pathfinding
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
||||||
index 34ce42afc6e822d209d2facc130b32e76836f40a..8b3513e4e2881bc4ba59e50fda399ecb88540323 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
||||||
@@ -46,7 +46,7 @@ public abstract class PathNavigation {
|
|
||||||
private BlockPos targetPos;
|
|
||||||
private int reachRange;
|
|
||||||
private float maxVisitedNodesMultiplier = 1.0F;
|
|
||||||
- private final PathFinder pathFinder;
|
|
||||||
+ private final PathFinder pathFinder; @Deprecated public PathFinder getPathfinder() { return this.pathFinder; } // Paper - OBFHELPER
|
|
||||||
private boolean isStuck;
|
|
||||||
|
|
||||||
public PathNavigation(Mob mob, Level world) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
||||||
index e855754bdb8431efc06c77b42d9a90b870abab8d..a9048cabf88b1309cc6dc90a9ba928564cbc18cf 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
||||||
@@ -21,7 +21,7 @@ public class PathFinder {
|
|
||||||
private static final float FUDGING = 1.5F;
|
|
||||||
private final Node[] neighbors = new Node[32];
|
|
||||||
private final int maxVisitedNodes;
|
|
||||||
- private final NodeEvaluator nodeEvaluator;
|
|
||||||
+ private final NodeEvaluator nodeEvaluator; @Deprecated public NodeEvaluator getPathfinder() { return this.nodeEvaluator; } // Paper - OBFHELPER
|
|
||||||
private static final boolean DEBUG = false;
|
|
||||||
private final BinaryHeap openSet = new BinaryHeap();
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||||
index 204ed5665adf2df7252fe2d21872db6956415311..b37acb6e6e253529a38f44a518a02c7747d3145e 100644
|
index 204ed5665adf2df7252fe2d21872db6956415311..b37acb6e6e253529a38f44a518a02c7747d3145e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 81a8e314b5073a5888a3c04d53ff279c8142a7d4..fa567322ca3f09d81479826b0119ddc922c41d11 100644
|
index 285389edd01b1b36dfa8363e7ceea3903229a618..ce86590b4060d9705831303ab23f0294129760b9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -538,6 +538,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -537,6 +537,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {}
|
public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {}
|
||||||
|
|
||||||
public void updateNeighborsAt(BlockPos pos, Block block) {
|
public void updateNeighborsAt(BlockPos pos, Block block) {
|
||||||
|
@ -192,7 +192,7 @@ index 0000000000000000000000000000000000000000..16b3527d7bc782c47e6f6c3ecd7165bd
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..115a6fad53655f356866032054db36777a791b4e
|
index 0000000000000000000000000000000000000000..20cfe7b9b7127ddeb97aa91d759fc17b4a548eaf
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||||
@@ -0,0 +1,179 @@
|
@@ -0,0 +1,179 @@
|
||||||
@ -342,7 +342,7 @@ index 0000000000000000000000000000000000000000..115a6fad53655f356866032054db3677
|
|||||||
+ ListTag list = new ListTag();
|
+ ListTag list = new ListTag();
|
||||||
+ for (Map.Entry<UUID, Long> entry : this.lootedPlayers.entrySet()) {
|
+ for (Map.Entry<UUID, Long> entry : this.lootedPlayers.entrySet()) {
|
||||||
+ CompoundTag cmp = new CompoundTag();
|
+ CompoundTag cmp = new CompoundTag();
|
||||||
+ cmp.setUUID("UUID", entry.getKey());
|
+ cmp.putUUID("UUID", entry.getKey());
|
||||||
+ cmp.putLong("Time", entry.getValue());
|
+ cmp.putLong("Time", entry.getValue());
|
||||||
+ list.add(cmp);
|
+ list.add(cmp);
|
||||||
+ }
|
+ }
|
||||||
@ -515,7 +515,7 @@ index 0000000000000000000000000000000000000000..3377b86c337d0234bbb9b0349e4034a7
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index a5fa826f895fc8660521496ad1e9de5c55ffbdaa..c0ea34cacbc1b042f79b441f57a11fa646a5c872 100644
|
index 4888c77c3bc415bc69d4aaf89899da7dcc81f402..27a6caea54ddd9efe3fc8da19877bee7fa7f4e3e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -168,6 +168,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -168,6 +168,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
@ -13,15 +13,15 @@ by adding code to all overrides in:
|
|||||||
to return BLOCKED if it is outside the world border.
|
to return BLOCKED if it is outside the world border.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
index 6c063351c76e92a8a91142a12db846d1c1f11921..8212aab2884c2a894bc981850e483ce31814c708 100644
|
index 989a0c44d6685b5824a055d077fb0f28c1ba4b17..98953769a4418385971651e43e2ff6f4ea1ec638 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
@@ -156,7 +156,7 @@ public abstract class PathNavigation {
|
@@ -156,7 +156,7 @@ public abstract class PathNavigation {
|
||||||
// Paper start - Pathfind event
|
// Paper start - Pathfind event
|
||||||
boolean copiedSet = false;
|
boolean copiedSet = false;
|
||||||
for (BlockPos possibleTarget : positions) {
|
for (BlockPos possibleTarget : positions) {
|
||||||
- if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(),
|
- if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(),
|
||||||
+ if (!getEntity().getCommandSenderWorld().getWorldBorder().isInBounds(possibleTarget) || !new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), // Paper - don't path out of world border
|
+ if (!this.mob.getCommandSenderWorld().getWorldBorder().isWithinBounds(possibleTarget) || !new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(), // Paper - don't path out of world border
|
||||||
MCUtil.toLocation(getEntity().level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
|
MCUtil.toLocation(this.mob.level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
|
||||||
if (!copiedSet) {
|
if (!copiedSet) {
|
||||||
copiedSet = true;
|
copiedSet = true;
|
||||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z
|
|||||||
Reduce method invocations for World.isLoaded(BlockPosition)Z
|
Reduce method invocations for World.isLoaded(BlockPosition)Z
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index e26cb05a91cf2b3ac059dcb55bc52f1e4f30b362..52d80086deff664fcfd8952b7cabbfa1f48ad131 100644
|
index 69f74f6e9750b34e735c8fe68a90a3f1e0eed2fb..c85caffd2dcb47d127b508791f78aea8f3657c8d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -316,6 +316,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -316,6 +316,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -19,5 +19,5 @@ index e26cb05a91cf2b3ac059dcb55bc52f1e4f30b362..52d80086deff664fcfd8952b7cabbfa1
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
public final boolean isLoadedAndInBounds(BlockPos blockposition) { // Paper - final for inline
|
public final boolean isLoadedAndInBounds(BlockPos blockposition) { // Paper - final for inline
|
||||||
return getWorldBorder().isInBounds(blockposition) && getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
|
return getWorldBorder().isWithinBounds(blockposition) && getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
|
||||||
}
|
}
|
||||||
|
@ -11,22 +11,22 @@ that is outside happens to be closer, but unreachable, yet another reachable
|
|||||||
one is in border that would of been missed.
|
one is in border that would of been missed.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||||
index 02b10be4878b871742efb0f65980d9672f32b388..4a61153eaf9cf4c8aa532f770c0e449325448107 100644
|
index a0c4bc4eb42a3d2de6f66510d88f92c06b535353..c2c54dc4bbfe469f2b8c751012b93d5e728936d6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||||
@@ -37,6 +37,18 @@ public class WorldBorder {
|
@@ -36,6 +36,18 @@ public class WorldBorder {
|
||||||
return (double) (pos.getX() + 1) > this.getMinX() && (double) pos.getX() < this.getMaxX() && (double) (pos.getZ() + 1) > this.getMinZ() && (double) pos.getZ() < this.getMaxZ();
|
return (double) (pos.getX() + 1) > this.getMinX() && (double) pos.getX() < this.getMaxX() && (double) (pos.getZ() + 1) > this.getMinZ() && (double) pos.getZ() < this.getMaxZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ private final BlockPos.MutableBlockPos mutPos = new BlockPos.MutableBlockPos();
|
+ private final BlockPos.MutableBlockPos mutPos = new BlockPos.MutableBlockPos();
|
||||||
+ public boolean isBlockInBounds(int chunkX, int chunkZ) {
|
+ public boolean isBlockInBounds(int chunkX, int chunkZ) {
|
||||||
+ this.mutPos.setValues(chunkX, 64, chunkZ);
|
+ this.mutPos.set(chunkX, 64, chunkZ);
|
||||||
+ return this.isInBounds(this.mutPos);
|
+ return this.isWithinBounds(this.mutPos);
|
||||||
+ }
|
+ }
|
||||||
+ public boolean isChunkInBounds(int chunkX, int chunkZ) {
|
+ public boolean isChunkInBounds(int chunkX, int chunkZ) {
|
||||||
+ this.mutPos.setValues(((chunkX << 4) + 15), 64, (chunkZ << 4) + 15);
|
+ this.mutPos.set(((chunkX << 4) + 15), 64, (chunkZ << 4) + 15);
|
||||||
+ return this.isInBounds(this.mutPos);
|
+ return this.isWithinBounds(this.mutPos);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Firework API's
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||||
index 28e32cdac5b8c51dfcef14b585860f3181e814f3..5bfebe072ec722e7d6f3161d5d6cc709a9b80032 100644
|
index 28e32cdac5b8c51dfcef14b585860f3181e814f3..3ac0d0419cbdacabf647a530a82ddf67ddaa13b7 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||||
@@ -39,6 +39,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
@@ -39,6 +39,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
||||||
@ -22,7 +22,7 @@ index 28e32cdac5b8c51dfcef14b585860f3181e814f3..5bfebe072ec722e7d6f3161d5d6cc709
|
|||||||
nbt.putBoolean("ShotAtAngle", (Boolean) this.entityData.get(FireworkRocketEntity.DATA_SHOT_AT_ANGLE));
|
nbt.putBoolean("ShotAtAngle", (Boolean) this.entityData.get(FireworkRocketEntity.DATA_SHOT_AT_ANGLE));
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (this.spawningEntity != null) {
|
+ if (this.spawningEntity != null) {
|
||||||
+ nbt.setUUID("SpawningEntity", this.spawningEntity);
|
+ nbt.putUUID("SpawningEntity", this.spawningEntity);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 3cc6b1afe465ca57df2f22d4d735a95439174e30..7f080d8aac9198dd935a8af090ee82f618551203 100644
|
index 27a6caea54ddd9efe3fc8da19877bee7fa7f4e3e..c9bb5427d68b1a4717e3f8bf584c40820ef0a4f0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2240,6 +2240,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2239,6 +2239,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean addPassenger(Entity entity) { // CraftBukkit
|
protected boolean addPassenger(Entity entity) { // CraftBukkit
|
||||||
|
@ -21,7 +21,7 @@ index f772924217c0531b09662a145d8ee5d22dd5ca51..ecfb88b4d9727ad20a2c33475cc6b1ec
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||||
index 4000480a14d2ba52149f4fa47f824abfa2e0e5f8..cb0194d688ae176e0fba6c48cf59a51ceb1a5c4e 100644
|
index 4000480a14d2ba52149f4fa47f824abfa2e0e5f8..ea01f84448693ca740b5f3381a9c500e5aa3914e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||||
@@ -38,13 +38,63 @@ public class ExperienceOrb extends Entity {
|
@@ -38,13 +38,63 @@ public class ExperienceOrb extends Entity {
|
||||||
@ -56,10 +56,10 @@ index 4000480a14d2ba52149f4fa47f824abfa2e0e5f8..cb0194d688ae176e0fba6c48cf59a51c
|
|||||||
+ private void savePaperNBT(CompoundTag nbttagcompound) {
|
+ private void savePaperNBT(CompoundTag nbttagcompound) {
|
||||||
+ CompoundTag comp = new CompoundTag();
|
+ CompoundTag comp = new CompoundTag();
|
||||||
+ if (this.sourceEntityId != null) {
|
+ if (this.sourceEntityId != null) {
|
||||||
+ comp.setUUID("source", this.sourceEntityId);
|
+ comp.putUUID("source", this.sourceEntityId);
|
||||||
+ }
|
+ }
|
||||||
+ if (this.triggerEntityId != null) {
|
+ if (this.triggerEntityId != null) {
|
||||||
+ comp.setUUID("trigger", triggerEntityId);
|
+ comp.putUUID("trigger", triggerEntityId);
|
||||||
+ }
|
+ }
|
||||||
+ if (this.spawnReason != null && this.spawnReason != org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN) {
|
+ if (this.spawnReason != null && this.spawnReason != org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN) {
|
||||||
+ comp.putString("reason", this.spawnReason.name());
|
+ comp.putString("reason", this.spawnReason.name());
|
||||||
@ -204,7 +204,7 @@ index 9d5b78880ea9d7efb8a6c5ffa26122e08b45f494..401a105a161c23a8d3fe45d0a7c84507
|
|||||||
|
|
||||||
if (this.dragonFight != null) {
|
if (this.dragonFight != null) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||||
index f7b3b11bd6b395d199e725bc0c0192c28cc3cd86..98085ea2b5baf99697f2992354918e15691c888f 100644
|
index a8820e811be1adecf864541400dc6907d3c2f0bb..32132911f3431c7d1390edbc69bf4b98e123a713 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||||
@@ -616,7 +616,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
@@ -616,7 +616,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||||
@ -255,19 +255,6 @@ index 467f9814e0991d31bff7259f266262c81328f05f..11d1db5ef709dfb6fa596ebc4f5fff14
|
|||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/inventory/FurnaceResultSlot.java b/src/main/java/net/minecraft/world/inventory/FurnaceResultSlot.java
|
|
||||||
index d486b8d7d80bc79c5af6106de56a3ba49021258e..97c76e7a6b3be6422d15744ce299deba48b1de02 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/inventory/FurnaceResultSlot.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/inventory/FurnaceResultSlot.java
|
|
||||||
@@ -8,7 +8,7 @@ import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
|
|
||||||
|
|
||||||
public class FurnaceResultSlot extends Slot {
|
|
||||||
|
|
||||||
- private final Player player;
|
|
||||||
+ private final Player player; @Deprecated public final Player getPlayer() { return this.player; } // Paper OBFHELPER
|
|
||||||
private int removeCount;
|
|
||||||
|
|
||||||
public FurnaceResultSlot(Player player, Container inventory, int index, int x, int y) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||||
index 473e17d87637cd1a85880e2956f83de0b510b488..34574f3945d2a7b4ab6a71adb2408b9811a3cb0d 100644
|
index 473e17d87637cd1a85880e2956f83de0b510b488..34574f3945d2a7b4ab6a71adb2408b9811a3cb0d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||||
|
@ -474,18 +474,10 @@ index c8385460701395cb5c65fba41335469ffb2d9b9a..fb0b3c5770f66cc3590f5ac4e690a33c
|
|||||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||||
GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
|
GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||||
index 3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554..8ea7d9a2070074a45d3276b8d2abac6285edbbdb 100644
|
index 3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554..9a428e166561b4bc028732ec563d3b2e99f81a8e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||||
@@ -118,6 +118,7 @@ public class GameProfileCache {
|
@@ -190,6 +190,13 @@ public class GameProfileCache {
|
||||||
return com.destroystokyo.paper.PaperConfig.isProxyOnlineMode(); // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public void saveProfile(GameProfile gameprofile) { add(gameprofile); } // Paper - OBFHELPER
|
|
||||||
public synchronized void add(GameProfile profile) { // Paper - synchronize
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
|
|
||||||
@@ -190,6 +191,13 @@ public class GameProfileCache {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Entity#fromMobSpawner()
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index f858da07ca3d49ad338a4e77c986ddd5494d74f0..f3b5df4e693d923796929b79f9a43bfa4cbe03e7 100644
|
index 267ecf9c5a6c9e696cb2a5c8be13bbc4ab14cd41..a6c26bd5a23799659db03fc2db55009391936f2a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -321,6 +321,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -321,6 +321,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@ -16,8 +16,8 @@ index f858da07ca3d49ad338a4e77c986ddd5494d74f0..f3b5df4e693d923796929b79f9a43bfa
|
|||||||
protected int numCollisions = 0; // Paper
|
protected int numCollisions = 0; // Paper
|
||||||
public void inactiveTick() { }
|
public void inactiveTick() { }
|
||||||
// Spigot end
|
// Spigot end
|
||||||
@@ -1860,6 +1861,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1859,6 +1860,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
nbt.setUUID("Paper.OriginWorld", originWorld);
|
nbt.putUUID("Paper.OriginWorld", originWorld);
|
||||||
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||||
}
|
}
|
||||||
+ // Save entity's from mob spawner status
|
+ // Save entity's from mob spawner status
|
||||||
@ -27,7 +27,7 @@ index f858da07ca3d49ad338a4e77c986ddd5494d74f0..f3b5df4e693d923796929b79f9a43bfa
|
|||||||
// Paper end
|
// Paper end
|
||||||
return nbt;
|
return nbt;
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@@ -1997,6 +2002,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1996,6 +2001,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
this.originWorld = originWorld;
|
this.originWorld = originWorld;
|
||||||
origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
|
origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index a86b5272c0ac4dd64f796f7fd025c7a34a5d2f8d..f8554943783754618bc04cbbe7df61cebfc98b80 100644
|
index 5b88064b42012f7480adcc9e77da7017347db5af..30347baabcace53bcad0b6ffddab9f1debf03ed5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -724,6 +724,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -723,6 +723,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Spigot start
|
// Spigot start
|
||||||
// Iterator iterator = this.blockEntityTickers.iterator();
|
// Iterator iterator = this.blockEntityTickers.iterator();
|
||||||
int tilesThisCycle = 0;
|
int tilesThisCycle = 0;
|
||||||
@ -17,7 +17,7 @@ index a86b5272c0ac4dd64f796f7fd025c7a34a5d2f8d..f8554943783754618bc04cbbe7df61ce
|
|||||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
||||||
@@ -731,7 +733,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -730,7 +732,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
if (tickingblockentity == null) {
|
if (tickingblockentity == null) {
|
||||||
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
|
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
|
||||||
tilesThisCycle--;
|
tilesThisCycle--;
|
||||||
@ -25,7 +25,7 @@ index a86b5272c0ac4dd64f796f7fd025c7a34a5d2f8d..f8554943783754618bc04cbbe7df61ce
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Spigot end
|
// Spigot end
|
||||||
@@ -739,12 +740,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -738,12 +739,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
if (tickingblockentity.isRemoved()) {
|
if (tickingblockentity.isRemoved()) {
|
||||||
// Spigot start
|
// Spigot start
|
||||||
tilesThisCycle--;
|
tilesThisCycle--;
|
||||||
|
@ -18,7 +18,7 @@ the blockstate that will be valid for restoration, as opposed to dropping
|
|||||||
information on restoration when the event is cancelled.
|
information on restoration when the event is cancelled.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index f8554943783754618bc04cbbe7df61cebfc98b80..4e7644f875b8ed10cb402e5e1c8b71b4842e0e40 100644
|
index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278542809f0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -140,7 +140,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -140,7 +140,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -49,7 +49,7 @@ index f8554943783754618bc04cbbe7df61cebfc98b80..4e7644f875b8ed10cb402e5e1c8b71b4
|
|||||||
this.capturedBlockStates.put(pos.immutable(), blockstate);
|
this.capturedBlockStates.put(pos.immutable(), blockstate);
|
||||||
captured = true;
|
captured = true;
|
||||||
}
|
}
|
||||||
@@ -644,7 +645,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -643,7 +644,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
public BlockState getBlockState(BlockPos pos) {
|
||||||
// CraftBukkit start - tree generation
|
// CraftBukkit start - tree generation
|
||||||
if (this.captureTreeGeneration) {
|
if (this.captureTreeGeneration) {
|
||||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString()
|
|||||||
UUID, ticks lived, valid, dead
|
UUID, ticks lived, valid, dead
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index f3b5df4e693d923796929b79f9a43bfa4cbe03e7..a6ba0c7fe05aae72b98072aaa008a1346bf2704e 100644
|
index a6c26bd5a23799659db03fc2db55009391936f2a..8880ff82691bef78b85d226d133d216f80fff832 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2805,7 +2805,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2804,7 +2804,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -31,10 +31,10 @@ index 6d717d3852afb3a3a4bef30c68980c402bdfefff..b47b1215e685c453c3496439bb350a91
|
|||||||
|
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 4e7644f875b8ed10cb402e5e1c8b71b4842e0e40..2d13cbfb5e4ea359106fc008f203b104a179b9c0 100644
|
index 08f612b7d2e861ef7e8b91e622c7a278542809f0..00e5672f4d302d5ccfe3942e61fe0c0beb782b82 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -769,6 +769,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -768,6 +768,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ index 67afaab789041f49407233ca8a856a3b0131fcf6..1b874f8a72f5b1ac64dd66621b039295
|
|||||||
|
|
||||||
this.horse.setTrap(false);
|
this.horse.setTrap(false);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||||
index 1a921a7e4ff5a1947559c30116ddb5e0596961e7..35430db8efc0b5697921f8ef188c61beb628d535 100644
|
index 849616d9ad140285f7aa4d2ffafd6371f3904bd5..325e244c46ec208a2e7e18d71ccbbfcc25fc1bce 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
|
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||||
@@ -89,6 +89,28 @@ public interface EntityGetter {
|
@@ -89,6 +89,28 @@ public interface EntityGetter {
|
||||||
@ -49,7 +49,7 @@ index 1a921a7e4ff5a1947559c30116ddb5e0596961e7..35430db8efc0b5697921f8ef188c61be
|
|||||||
+
|
+
|
||||||
+ for (Player human : this.players()) {
|
+ for (Player human : this.players()) {
|
||||||
+ if (predicate == null || predicate.test(human)) {
|
+ if (predicate == null || predicate.test(human)) {
|
||||||
+ double distanceSquared = human.getDistanceSquared(x, y, z);
|
+ double distanceSquared = human.distanceToSqr(x, y, z);
|
||||||
+
|
+
|
||||||
+ if (radius < 0.0D || distanceSquared < radius * radius) {
|
+ if (radius < 0.0D || distanceSquared < radius * radius) {
|
||||||
+ builder.add(human.getBukkitEntity());
|
+ builder.add(human.getBukkitEntity());
|
||||||
|
@ -21,7 +21,7 @@ index 401a105a161c23a8d3fe45d0a7c845072afb8bd9..c98202092752a9015aaf95bd1471135b
|
|||||||
|
|
||||||
this.level.removeBlock(blockposition, false);
|
this.level.removeBlock(blockposition, false);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
||||||
index dd19c31360891245dbe465cf94a9f456cf71e23d..ad0b485dbc77717f16191d6950a2e91faaede94a 100644
|
index dd19c31360891245dbe465cf94a9f456cf71e23d..becf80cdbbeb6327958758779cc42ea894127988 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
||||||
@@ -290,7 +290,7 @@ public class FireBlock extends BaseFireBlock {
|
@@ -290,7 +290,7 @@ public class FireBlock extends BaseFireBlock {
|
||||||
@ -42,7 +42,7 @@ index dd19c31360891245dbe465cf94a9f456cf71e23d..ad0b485dbc77717f16191d6950a2e91f
|
|||||||
+ if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.FIRE, null).callEvent()) {
|
+ if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.FIRE, null).callEvent()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ world.setAir(blockposition, false);
|
+ world.removeBlock(blockposition, false);
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
TntBlock.explode(world, blockposition);
|
TntBlock.explode(world, blockposition);
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,10 @@ This allows the client to render multiple skull textures from the same user,
|
|||||||
for when different skins were used when skull was made.
|
for when different skins were used when skull was made.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
index c0966a873ea5e265936e17796bf6bbee62eea9b4..813814a09ad4c8040d9bf7fff12c8c7b88f164c2 100644
|
index e38e53bd39c384bac4d7111e6a2c721744a122f1..70fb9001b12b105fbf471bd0127d8414e03f9329 100644
|
||||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
@@ -473,9 +473,18 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -472,9 +472,18 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) {
|
if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) {
|
||||||
// Spigot start - filter
|
// Spigot start - filter
|
||||||
stack = stack.copy();
|
stack = stack.copy();
|
||||||
@ -27,7 +27,7 @@ index c0966a873ea5e265936e17796bf6bbee62eea9b4..813814a09ad4c8040d9bf7fff12c8c7b
|
|||||||
+ if (nbttagcompound != null && nbttagcompound.contains("SkullOwner", 10)) {
|
+ if (nbttagcompound != null && nbttagcompound.contains("SkullOwner", 10)) {
|
||||||
+ CompoundTag owner = nbttagcompound.getCompound("SkullOwner");
|
+ CompoundTag owner = nbttagcompound.getCompound("SkullOwner");
|
||||||
+ if (owner.hasUUID("Id")) {
|
+ if (owner.hasUUID("Id")) {
|
||||||
+ nbttagcompound.setUUID("SkullOwnerOrig", owner.getUUID("Id"));
|
+ nbttagcompound.putUUID("SkullOwnerOrig", owner.getUUID("Id"));
|
||||||
+ net.minecraft.world.level.block.entity.SkullBlockEntity.sanitizeUUID(owner);
|
+ net.minecraft.world.level.block.entity.SkullBlockEntity.sanitizeUUID(owner);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -35,7 +35,7 @@ index c0966a873ea5e265936e17796bf6bbee62eea9b4..813814a09ad4c8040d9bf7fff12c8c7b
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.writeNbt(nbttagcompound);
|
this.writeNbt(nbttagcompound);
|
||||||
@@ -495,7 +504,16 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -494,7 +503,16 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
itemstack.setTag(this.readNbt());
|
itemstack.setTag(this.readNbt());
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (itemstack.getTag() != null) {
|
if (itemstack.getTag() != null) {
|
||||||
@ -66,7 +66,7 @@ index 3bdb09ab00ec05ed532a0c26b9fd321e1f05c1a0..1451a98d69b185dd15a2d1d7681bcecb
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
index eaf586eb386e13e954bc593f6ddbc45929cec204..f0192a009f6a21d1781ce709624a9187048d9a08 100644
|
index eaf586eb386e13e954bc593f6ddbc45929cec204..172413fc0f303d5e15bc2bc55c09ce4faf5298a0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
@@ -10,6 +10,7 @@ import java.util.function.Consumer;
|
@@ -10,6 +10,7 @@ import java.util.function.Consumer;
|
||||||
@ -105,11 +105,11 @@ index eaf586eb386e13e954bc593f6ddbc45929cec204..f0192a009f6a21d1781ce709624a9187
|
|||||||
+ String textures = ((CompoundTag)list.get(0)).getString("Value");
|
+ String textures = ((CompoundTag)list.get(0)).getString("Value");
|
||||||
+ if (textures != null && textures.length() > 3) {
|
+ if (textures != null && textures.length() > 3) {
|
||||||
+ UUID uuid = UUID.nameUUIDFromBytes(textures.getBytes());
|
+ UUID uuid = UUID.nameUUIDFromBytes(textures.getBytes());
|
||||||
+ owner.setUUID("Id", uuid);
|
+ owner.putUUID("Id", uuid);
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ owner.setUUID("Id", UUID.randomUUID());
|
+ owner.putUUID("Id", UUID.randomUUID());
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
index 5df9ad398ba173bb0ff4770673f8eb5967325c5a..d2a3927a263c445e647a4bbc5fe12addaf290c0e 100644
|
index 5df9ad398ba173bb0ff4770673f8eb5967325c5a..877095c93e944293dfb52471eda59a24fad2dbc9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
@@ -172,6 +172,11 @@ public class Phantom extends FlyingMob implements Enemy {
|
@@ -172,6 +172,11 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
@ -26,7 +26,7 @@ index 5df9ad398ba173bb0ff4770673f8eb5967325c5a..d2a3927a263c445e647a4bbc5fe12add
|
|||||||
nbt.putInt("Size", this.getPhantomSize());
|
nbt.putInt("Size", this.getPhantomSize());
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (this.spawningEntity != null) {
|
+ if (this.spawningEntity != null) {
|
||||||
+ nbt.setUUID("Paper.SpawningEntity", this.spawningEntity);
|
+ nbt.putUUID("Paper.SpawningEntity", this.spawningEntity);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
@ -2299,7 +2299,7 @@ index fb0b3c5770f66cc3590f5ac4e690a33cb6179be3..7ce854edba32ffcafaa5268d4bb2822a
|
|||||||
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataFixers.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, LoggerChunkProgressListener::new);
|
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataFixers.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, LoggerChunkProgressListener::new);
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 9f7e89ccd716edac22d3bee907c39eedbffb05b5..8750199325adf72da10bf292bf56f75bafe10726 100644
|
index a7244e66b7bbf2b474304ab41ad31a606ab6ba9c..bd892f477a04172aaae3925d81cb30cda74abfdc 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -976,7 +976,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -976,7 +976,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -2312,10 +2312,10 @@ index 9f7e89ccd716edac22d3bee907c39eedbffb05b5..8750199325adf72da10bf292bf56f75b
|
|||||||
|
|
||||||
public String getLocalIp() {
|
public String getLocalIp() {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index 9a8fc112dd19964c848127a8dd2f100f5db63075..165e72873da877f7a29d58e4da489f68979725ad 100644
|
index 24f72050229031898fd9da585ad2ceec835f83f9..828e885baf2d47962cdd4188c66d8345a7f46707 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -154,6 +154,18 @@ public class ChunkHolder {
|
@@ -151,6 +151,18 @@ public class ChunkHolder {
|
||||||
return chunkstatus;
|
return chunkstatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2334,7 +2334,7 @@ index 9a8fc112dd19964c848127a8dd2f100f5db63075..165e72873da877f7a29d58e4da489f68
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -378,7 +390,7 @@ public class ChunkHolder {
|
@@ -375,7 +387,7 @@ public class ChunkHolder {
|
||||||
ChunkStatus chunkstatus = ChunkHolder.getStatus(this.oldTicketLevel);
|
ChunkStatus chunkstatus = ChunkHolder.getStatus(this.oldTicketLevel);
|
||||||
ChunkStatus chunkstatus1 = ChunkHolder.getStatus(this.ticketLevel);
|
ChunkStatus chunkstatus1 = ChunkHolder.getStatus(this.ticketLevel);
|
||||||
boolean flag = this.oldTicketLevel <= ChunkMap.MAX_CHUNK_DISTANCE;
|
boolean flag = this.oldTicketLevel <= ChunkMap.MAX_CHUNK_DISTANCE;
|
||||||
@ -2343,7 +2343,7 @@ index 9a8fc112dd19964c848127a8dd2f100f5db63075..165e72873da877f7a29d58e4da489f68
|
|||||||
ChunkHolder.FullChunkStatus playerchunk_state = ChunkHolder.getFullChunkStatus(this.oldTicketLevel);
|
ChunkHolder.FullChunkStatus playerchunk_state = ChunkHolder.getFullChunkStatus(this.oldTicketLevel);
|
||||||
ChunkHolder.FullChunkStatus playerchunk_state1 = ChunkHolder.getFullChunkStatus(this.ticketLevel);
|
ChunkHolder.FullChunkStatus playerchunk_state1 = ChunkHolder.getFullChunkStatus(this.ticketLevel);
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -414,6 +426,12 @@ public class ChunkHolder {
|
@@ -411,6 +423,12 @@ public class ChunkHolder {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -2636,7 +2636,7 @@ index b794922eeccc845632f2442a3ed923f1d826a9e1..36bc19cbb5242207ff019f62f59205e1
|
|||||||
return this.poiManager;
|
return this.poiManager;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 853056ad5c5eeff03e7d6fe0dfd6f837a03ad882..672f78d1560ccd45d1a0ca04d6daf8188105c3e9 100644
|
index 03c90069e8fca2291e66f5d99175f029530a4434..1176dd8ebd59c5bda1b74c532ca21ae335078805 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -323,10 +323,128 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -323,10 +323,128 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@ -3348,7 +3348,7 @@ index 00470d96be2500a0516125771304e76dfd4268a4..6f13c7adce7d4b3d170045ea5ef2a841
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
index a38494d577a929dd9be0503b54c888425a361881..da66cc41c6a6c7e4986b744af0355b63830bd1d1 100644
|
index 84327c8fe1dc62c7b99950261a344042b4456616..298b5abbc792dd33be38acbd1c572c9778c4d2d2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
@@ -47,6 +47,7 @@ public class RegionFile implements AutoCloseable {
|
@@ -47,6 +47,7 @@ public class RegionFile implements AutoCloseable {
|
||||||
@ -3359,7 +3359,7 @@ index a38494d577a929dd9be0503b54c888425a361881..da66cc41c6a6c7e4986b744af0355b63
|
|||||||
|
|
||||||
public RegionFile(File file, File directory, boolean dsync) throws IOException {
|
public RegionFile(File file, File directory, boolean dsync) throws IOException {
|
||||||
this(file.toPath(), directory.toPath(), RegionFileVersion.VERSION_DEFLATE, dsync);
|
this(file.toPath(), directory.toPath(), RegionFileVersion.VERSION_DEFLATE, dsync);
|
||||||
@@ -232,7 +233,7 @@ public class RegionFile implements AutoCloseable {
|
@@ -231,7 +232,7 @@ public class RegionFile implements AutoCloseable {
|
||||||
return (byteCount + 4096 - 1) / 4096;
|
return (byteCount + 4096 - 1) / 4096;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3368,7 +3368,7 @@ index a38494d577a929dd9be0503b54c888425a361881..da66cc41c6a6c7e4986b744af0355b63
|
|||||||
int i = this.getOffset(pos);
|
int i = this.getOffset(pos);
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
@@ -399,6 +400,11 @@ public class RegionFile implements AutoCloseable {
|
@@ -398,6 +399,11 @@ public class RegionFile implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
@ -3380,7 +3380,7 @@ index a38494d577a929dd9be0503b54c888425a361881..da66cc41c6a6c7e4986b744af0355b63
|
|||||||
try {
|
try {
|
||||||
this.padToFullSector();
|
this.padToFullSector();
|
||||||
} finally {
|
} finally {
|
||||||
@@ -408,6 +414,10 @@ public class RegionFile implements AutoCloseable {
|
@@ -407,6 +413,10 @@ public class RegionFile implements AutoCloseable {
|
||||||
this.file.close();
|
this.file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3641,7 +3641,7 @@ index ad9a4d4a9363741cc47f142c24fa6f4858dd947f..a19de8405de8ee29afc112556e4684b0
|
|||||||
// Spigot start
|
// Spigot start
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
index 16e8cfb21f090e0c17e55c1b45ff56bed01839eb..7f1d9932e0e4e09c3727544d053ad61a365290af 100644
|
index 16e8cfb21f090e0c17e55c1b45ff56bed01839eb..bcb616ade47b445dd6faec0fd938ee4d728d6d16 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
@@ -13,6 +13,7 @@ import net.minecraft.nbt.CompoundTag;
|
@@ -13,6 +13,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||||
@ -3666,7 +3666,7 @@ index 16e8cfb21f090e0c17e55c1b45ff56bed01839eb..7f1d9932e0e4e09c3727544d053ad61a
|
|||||||
+ ((CraftWorld) loc.getWorld()).getHandle().getChunkSource().addTicketAtLevel(TicketType.POST_TELEPORT, pair, 31, 0);
|
+ ((CraftWorld) loc.getWorld()).getHandle().getChunkSource().addTicketAtLevel(TicketType.POST_TELEPORT, pair, 31, 0);
|
||||||
+ net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pair.toLong());
|
+ net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pair.toLong());
|
||||||
+ if (updatingChunk != null) {
|
+ if (updatingChunk != null) {
|
||||||
+ return updatingChunk.getEntityTickingFuture();
|
+ return updatingChunk.getEntityTickingChunkFuture();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return java.util.concurrent.CompletableFuture.completedFuture(com.mojang.datafixers.util.Either.left(((org.bukkit.craftbukkit.CraftChunk)chunk).getHandle()));
|
+ return java.util.concurrent.CompletableFuture.completedFuture(com.mojang.datafixers.util.Either.left(((org.bukkit.craftbukkit.CraftChunk)chunk).getHandle()));
|
||||||
+ }
|
+ }
|
||||||
|
@ -7,7 +7,7 @@ Implements Pathfinding API for mobs
|
|||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acdca9fb377
|
index 0000000000000000000000000000000000000000..8c9f0c6c38627beded373ca29f1989ae3ba6f873
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||||
@@ -0,0 +1,139 @@
|
@@ -0,0 +1,139 @@
|
||||||
@ -40,18 +40,18 @@ index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acd
|
|||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void stopPathfinding() {
|
+ public void stopPathfinding() {
|
||||||
+ entity.getNavigation().stopPathfinding();
|
+ entity.getNavigation().stop();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean hasPath() {
|
+ public boolean hasPath() {
|
||||||
+ return entity.getNavigation().getPathEntity() != null;
|
+ return entity.getNavigation().getPath() != null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Nullable
|
+ @Nullable
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public PathResult getCurrentPath() {
|
+ public PathResult getCurrentPath() {
|
||||||
+ Path path = entity.getNavigation().getPathEntity();
|
+ Path path = entity.getNavigation().getPath();
|
||||||
+ return path != null ? new PaperPathResult(path) : null;
|
+ return path != null ? new PaperPathResult(path) : null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acd
|
|||||||
+ @Override
|
+ @Override
|
||||||
+ public PathResult findPath(Location loc) {
|
+ public PathResult findPath(Location loc) {
|
||||||
+ Validate.notNull(loc, "Location can not be null");
|
+ Validate.notNull(loc, "Location can not be null");
|
||||||
+ Path path = entity.getNavigation().calculateDestination(loc.getX(), loc.getY(), loc.getZ());
|
+ Path path = entity.getNavigation().createPath(loc.getX(), loc.getY(), loc.getZ(), 0);
|
||||||
+ return path != null ? new PaperPathResult(path) : null;
|
+ return path != null ? new PaperPathResult(path) : null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acd
|
|||||||
+ @Override
|
+ @Override
|
||||||
+ public PathResult findPath(LivingEntity target) {
|
+ public PathResult findPath(LivingEntity target) {
|
||||||
+ Validate.notNull(target, "Target can not be null");
|
+ Validate.notNull(target, "Target can not be null");
|
||||||
+ Path path = entity.getNavigation().calculateDestination(((CraftLivingEntity) target).getHandle());
|
+ Path path = entity.getNavigation().createPath(((CraftLivingEntity) target).getHandle(), 0);
|
||||||
+ return path != null ? new PaperPathResult(path) : null;
|
+ return path != null ? new PaperPathResult(path) : null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -75,37 +75,37 @@ index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acd
|
|||||||
+ public boolean moveTo(@Nonnull PathResult path, double speed) {
|
+ public boolean moveTo(@Nonnull PathResult path, double speed) {
|
||||||
+ Validate.notNull(path, "PathResult can not be null");
|
+ Validate.notNull(path, "PathResult can not be null");
|
||||||
+ Path pathEntity = ((PaperPathResult) path).path;
|
+ Path pathEntity = ((PaperPathResult) path).path;
|
||||||
+ return entity.getNavigation().setDestination(pathEntity, speed);
|
+ return entity.getNavigation().moveTo(pathEntity, speed);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean canOpenDoors() {
|
+ public boolean canOpenDoors() {
|
||||||
+ return entity.getNavigation().getPathfinder().getPathfinder().shouldOpenDoors();
|
+ return entity.getNavigation().pathFinder.nodeEvaluator.canOpenDoors();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void setCanOpenDoors(boolean canOpenDoors) {
|
+ public void setCanOpenDoors(boolean canOpenDoors) {
|
||||||
+ entity.getNavigation().getPathfinder().getPathfinder().setShouldOpenDoors(canOpenDoors);
|
+ entity.getNavigation().pathFinder.nodeEvaluator.setCanOpenDoors(canOpenDoors);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean canPassDoors() {
|
+ public boolean canPassDoors() {
|
||||||
+ return entity.getNavigation().getPathfinder().getPathfinder().shouldPassDoors();
|
+ return entity.getNavigation().pathFinder.nodeEvaluator.canPassDoors();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void setCanPassDoors(boolean canPassDoors) {
|
+ public void setCanPassDoors(boolean canPassDoors) {
|
||||||
+ entity.getNavigation().getPathfinder().getPathfinder().setShouldPassDoors(canPassDoors);
|
+ entity.getNavigation().pathFinder.nodeEvaluator.setCanPassDoors(canPassDoors);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean canFloat() {
|
+ public boolean canFloat() {
|
||||||
+ return entity.getNavigation().getPathfinder().getPathfinder().shouldFloat();
|
+ return entity.getNavigation().pathFinder.nodeEvaluator.canFloat();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void setCanFloat(boolean canFloat) {
|
+ public void setCanFloat(boolean canFloat) {
|
||||||
+ entity.getNavigation().getPathfinder().getPathfinder().setShouldFloat(canFloat);
|
+ entity.getNavigation().pathFinder.nodeEvaluator.setCanFloat(canFloat);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public class PaperPathResult implements com.destroystokyo.paper.entity.PaperPathfinder.PathResult {
|
+ public class PaperPathResult implements com.destroystokyo.paper.entity.PaperPathfinder.PathResult {
|
||||||
@ -118,14 +118,14 @@ index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acd
|
|||||||
+ @Nullable
|
+ @Nullable
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public Location getFinalPoint() {
|
+ public Location getFinalPoint() {
|
||||||
+ Node point = path.getFinalPoint();
|
+ Node point = path.getEndNode();
|
||||||
+ return point != null ? toLoc(point) : null;
|
+ return point != null ? toLoc(point) : null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public List<Location> getPoints() {
|
+ public List<Location> getPoints() {
|
||||||
+ List<Location> points = new ArrayList<>();
|
+ List<Location> points = new ArrayList<>();
|
||||||
+ for (Node point : path.getPoints()) {
|
+ for (Node point : path.nodes) {
|
||||||
+ points.add(toLoc(point));
|
+ points.add(toLoc(point));
|
||||||
+ }
|
+ }
|
||||||
+ return points;
|
+ return points;
|
||||||
@ -133,7 +133,7 @@ index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acd
|
|||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public int getNextPointIndex() {
|
+ public int getNextPointIndex() {
|
||||||
+ return path.getNextIndex();
|
+ return path.getNextNodeIndex();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Nullable
|
+ @Nullable
|
||||||
@ -142,135 +142,26 @@ index 0000000000000000000000000000000000000000..92d1bb8b9cdb9eb0c04574c0b6ba5acd
|
|||||||
+ if (!path.hasNext()) {
|
+ if (!path.hasNext()) {
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ return toLoc(path.getPoints().get(path.getNextIndex()));
|
+ return toLoc(path.nodes.get(path.getNextNodeIndex()));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ private Location toLoc(Node point) {
|
+ private Location toLoc(Node point) {
|
||||||
+ return new Location(entity.level.getWorld(), point.getX(), point.getY(), point.getZ());
|
+ return new Location(entity.level.getWorld(), point.x, point.y, point.z);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
||||||
index 83243e1d35829a384f8680b18e96d82e630310ed..289494db53d368d56f1abd34abad8ce57e4694b1 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
||||||
@@ -93,7 +93,7 @@ public abstract class PathNavigation {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
- public final Path createPath(double x, double y, double z, int distance) {
|
|
||||||
+ @Deprecated public final Path calculateDestination(double d0, double d1, double d2) { return createPath(d0, d1, d2, 0); } public final Path createPath(double x, double y, double z, int distance) { // Paper - OBFHELPER
|
|
||||||
return this.createPath(new BlockPos(x, y, z), distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ public abstract class PathNavigation {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
- public Path createPath(Entity entity, int distance) {
|
|
||||||
+ public final Path calculateDestination(Entity entity) { return createPath(entity, 0); } public Path createPath(Entity entity, int distance) {
|
|
||||||
return this.createPath(ImmutableSet.of(entity.blockPosition()), entity, 16, true, distance); // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -195,6 +195,7 @@ public abstract class PathNavigation {
|
|
||||||
return path != null && this.moveTo(path, speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public boolean setDestination(@Nullable Path pathentity, double speed) { return moveTo(pathentity, speed); } // Paper - OBFHELPER
|
|
||||||
public boolean moveTo(@Nullable Path path, double speed) {
|
|
||||||
if (path == null) {
|
|
||||||
this.path = null;
|
|
||||||
@@ -221,7 +222,7 @@ public abstract class PathNavigation {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- @Nullable
|
|
||||||
+ @Deprecated @Nullable public Path getPathEntity() { return getPath(); } @Nullable // Paper - OBFHELPER
|
|
||||||
public Path getPath() {
|
|
||||||
return this.path;
|
|
||||||
}
|
|
||||||
@@ -335,6 +336,7 @@ public abstract class PathNavigation {
|
|
||||||
return !this.isDone();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public void stopPathfinding() { stop(); } // Paper - OBFHELPER
|
|
||||||
public void stop() {
|
|
||||||
this.path = null;
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Node.java b/src/main/java/net/minecraft/world/level/pathfinder/Node.java
|
|
||||||
index d7a86444d0e76154319c409317fc5ac9c54403a8..9f8ecc9eb5d5f8b45d03f333ca43295f3d3ce3d3 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/Node.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/Node.java
|
|
||||||
@@ -6,9 +6,9 @@ import net.minecraft.util.Mth;
|
|
||||||
import net.minecraft.world.phys.Vec3;
|
|
||||||
|
|
||||||
public class Node {
|
|
||||||
- public final int x;
|
|
||||||
- public final int y;
|
|
||||||
- public final int z;
|
|
||||||
+ public final int x; @Deprecated public final int getX() { return x; } // Paper - OBFHELPER
|
|
||||||
+ public final int y; @Deprecated public final int getY() { return y; } // Paper - OBFHELPER
|
|
||||||
+ public final int z; @Deprecated public final int getZ() { return z; } // Paper - OBFHELPER
|
|
||||||
private final int hash;
|
|
||||||
public int heapIdx = -1;
|
|
||||||
public float g;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/NodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/NodeEvaluator.java
|
|
||||||
index 72ca8adb9fa65588c6b1e19be2dc27a36c0146a6..a2126606fa727e24a524f74289d498ef2cb881c7 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/NodeEvaluator.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/NodeEvaluator.java
|
|
||||||
@@ -15,9 +15,9 @@ public abstract class NodeEvaluator {
|
|
||||||
protected int entityWidth;
|
|
||||||
protected int entityHeight;
|
|
||||||
protected int entityDepth;
|
|
||||||
- protected boolean canPassDoors;
|
|
||||||
- protected boolean canOpenDoors;
|
|
||||||
- protected boolean canFloat;
|
|
||||||
+ protected boolean canPassDoors; @Deprecated public boolean shouldPassDoors() { return canPassDoors; } @Deprecated public void setShouldPassDoors(boolean b) { canPassDoors = b; } // Paper - obfhelper
|
|
||||||
+ protected boolean canOpenDoors; @Deprecated public boolean shouldOpenDoors() { return canOpenDoors; } @Deprecated public void setShouldOpenDoors(boolean b) { canOpenDoors = b; } // Paper - obfhelper
|
|
||||||
+ protected boolean canFloat; @Deprecated public boolean shouldFloat() { return canFloat; } @Deprecated public void setShouldFloat(boolean b) { canFloat = b; } // Paper - obfhelper
|
|
||||||
|
|
||||||
public void prepare(PathNavigationRegion cachedWorld, Mob entity) {
|
|
||||||
this.level = cachedWorld;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||||
index 6928c415e328dd7cff2e9ec553bc4faa1ff8facf..c704c126ad1844110dcd8013b1cf0916857dd7ed 100644
|
index 31d4431a60e742e2ca3b1a2abcce33954f599488..f4b6c2bf74884c0b53956788dcfcca784cfafca2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
--- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
+++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||||
@@ -12,14 +12,15 @@ import net.minecraft.world.entity.Entity;
|
@@ -20,6 +20,7 @@ public class Path {
|
||||||
import net.minecraft.world.phys.Vec3;
|
|
||||||
|
|
||||||
public class Path {
|
|
||||||
- private final List<Node> nodes;
|
|
||||||
+ private final List<Node> nodes; @Deprecated public List<Node> getPoints() { return nodes; } // Paper - OBFHELPER
|
|
||||||
private Node[] openSet = new Node[0];
|
|
||||||
private Node[] closedSet = new Node[0];
|
|
||||||
private Set<Target> targetNodes;
|
|
||||||
- private int nextNodeIndex;
|
|
||||||
+ private int nextNodeIndex; @Deprecated public int getNextIndex() { return this.nextNodeIndex; } // Paper - OBFHELPER
|
|
||||||
private final BlockPos target;
|
private final BlockPos target;
|
||||||
private final float distToTarget;
|
private final float distToTarget;
|
||||||
private final boolean reached;
|
private final boolean reached;
|
||||||
+ public boolean hasNext() { return getNextIndex() < getPoints().size(); } // Paper
|
+ public boolean hasNext() { return getNextNodeIndex() < this.nodes.size(); } // Paper
|
||||||
|
|
||||||
public Path(List<Node> nodes, BlockPos target, boolean reachesTarget) {
|
public Path(List<Node> nodes, BlockPos target, boolean reachesTarget) {
|
||||||
this.nodes = nodes;
|
this.nodes = nodes;
|
||||||
@@ -41,7 +42,7 @@ public class Path {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
- public Node getEndNode() {
|
|
||||||
+ @Deprecated public Node getFinalPoint() { return getEndNode(); } @Nullable public Node getEndNode() { // Paper - OBFHELPER
|
|
||||||
return !this.nodes.isEmpty() ? this.nodes.get(this.nodes.size() - 1) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ public class Path {
|
|
||||||
return this.getEntityPosAtNode(entity, this.nextNodeIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
- public BlockPos getNextNodePos() {
|
|
||||||
+ @Deprecated public BlockPos getNext() { return getNextNodePos(); } public BlockPos getNextNodePos() { // Paper - OBFHELPER
|
|
||||||
return this.nodes.get(this.nextNodeIndex).asBlockPos();
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
index 71872fdfafca82cf745eecee4bf984726d49f5a4..9c9fa83615cd06539ce5e4e3d4feaa69f65b7931 100644
|
index 71872fdfafca82cf745eecee4bf984726d49f5a4..9c9fa83615cd06539ce5e4e3d4feaa69f65b7931 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
|
@ -4,20 +4,8 @@ Date: Sat, 22 Sep 2018 00:33:08 -0500
|
|||||||
Subject: [PATCH] Add LivingEntity#getTargetEntity
|
Subject: [PATCH] Add LivingEntity#getTargetEntity
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
index 734559b4f36128afb4178fecbba99e8e4ac0aa7e..e62427c4dcd77eac147180349b95f76749d5ba56 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
@@ -2362,6 +2362,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
|
||||||
this.setYHeadRot(yaw);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public final float getCollisionBorderSize() { return getPickRadius(); } // Paper - OBFHELPER
|
|
||||||
public float getPickRadius() {
|
|
||||||
return 0.0F;
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 3e7a2e37108f07c6057d1cd0bf673b0ed162f16a..205c3cf4b9c602c6765060a669b41dcdec1a854a 100644
|
index 3e7a2e37108f07c6057d1cd0bf673b0ed162f16a..5e781d0af08ba7faba84ee774e87f1c0d484ae9f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
|
@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
|
||||||
@ -47,7 +35,7 @@ index 3e7a2e37108f07c6057d1cd0bf673b0ed162f16a..205c3cf4b9c602c6765060a669b41dcd
|
|||||||
+ EntityHitResult result = null;
|
+ EntityHitResult result = null;
|
||||||
+
|
+
|
||||||
+ for (Entity entity : entityList) {
|
+ for (Entity entity : entityList) {
|
||||||
+ final double inflationAmount = (double) entity.getCollisionBorderSize();
|
+ final double inflationAmount = (double) entity.getPickRadius();
|
||||||
+ AABB aabb = entity.getBoundingBox().inflate(inflationAmount, inflationAmount, inflationAmount);
|
+ AABB aabb = entity.getBoundingBox().inflate(inflationAmount, inflationAmount, inflationAmount);
|
||||||
+ Optional<Vec3> rayTraceResult = aabb.clip(start, end);
|
+ Optional<Vec3> rayTraceResult = aabb.clip(start, end);
|
||||||
+
|
+
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
||||||
index 5e2e8cb5eba4ba36065f07abed954b2aad022321..cc00bfd72cc106a170731f4dfdb3bebeb8bb0c21 100644
|
index e26ce4d8b3a3af8d6347f8c8c36703aeb06da520..8c3e8c12d7405ad388342e304430834a5fad12a9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
||||||
@@ -1,5 +1,8 @@
|
@@ -1,5 +1,8 @@
|
||||||
@ -17,15 +17,6 @@ index 5e2e8cb5eba4ba36065f07abed954b2aad022321..cc00bfd72cc106a170731f4dfdb3bebe
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -49,7 +52,7 @@ public class Witch extends Raider implements RangedAttackMob {
|
|
||||||
private static final UUID SPEED_MODIFIER_DRINKING_UUID = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
|
|
||||||
private static final AttributeModifier SPEED_MODIFIER_DRINKING = new AttributeModifier(Witch.SPEED_MODIFIER_DRINKING_UUID, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION);
|
|
||||||
private static final EntityDataAccessor<Boolean> DATA_USING_ITEM = SynchedEntityData.defineId(Witch.class, EntityDataSerializers.BOOLEAN);
|
|
||||||
- private int usingTime;
|
|
||||||
+ private int usingTime; @Deprecated public int getPotionUseTimeLeft() { return usingTime; } @Deprecated public void setPotionUseTimeLeft(int timeLeft) { usingTime = timeLeft; } // Paper - OBFHELPER
|
|
||||||
private NearestHealableRaiderTargetGoal<Raider> healRaidersGoal;
|
|
||||||
private NearestAttackableWitchTargetGoal<Player> attackPlayersGoal;
|
|
||||||
|
|
||||||
@@ -157,21 +160,24 @@ public class Witch extends Raider implements RangedAttackMob {
|
@@ -157,21 +160,24 @@ public class Witch extends Raider implements RangedAttackMob {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +80,7 @@ index 5e2e8cb5eba4ba36065f07abed954b2aad022321..cc00bfd72cc106a170731f4dfdb3bebe
|
|||||||
public SoundEvent getCelebrateSound() {
|
public SoundEvent getCelebrateSound() {
|
||||||
return SoundEvents.WITCH_CELEBRATE;
|
return SoundEvents.WITCH_CELEBRATE;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||||
index d4eeb071dbbfca3ecea256228853bcb5c11f49ee..bb40b5af0f2a6a971f78350394099e3a48d5d04a 100644
|
index d4eeb071dbbfca3ecea256228853bcb5c11f49ee..8625d8d7ac94dca2acc348a4c3c912d39cd22b47 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||||
@@ -3,6 +3,13 @@ package org.bukkit.craftbukkit.entity;
|
@@ -3,6 +3,13 @@ package org.bukkit.craftbukkit.entity;
|
||||||
@ -117,12 +108,12 @@ index d4eeb071dbbfca3ecea256228853bcb5c11f49ee..bb40b5af0f2a6a971f78350394099e3a
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public int getPotionUseTimeLeft() {
|
+ public int getPotionUseTimeLeft() {
|
||||||
+ return getHandle().getPotionUseTimeLeft();
|
+ return getHandle().usingTime;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void setPotionUseTimeLeft(int ticks) {
|
+ public void setPotionUseTimeLeft(int ticks) {
|
||||||
+ getHandle().setPotionUseTimeLeft(ticks);
|
+ getHandle().usingTime = ticks;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public ItemStack getDrinkingPotion() {
|
+ public ItemStack getDrinkingPotion() {
|
||||||
|
@ -41,10 +41,10 @@ index 085bdf17a0e844ff813bf1107b686b33943659ba..e9dc0288ea1bb7645622ac6d9fc7567b
|
|||||||
|
|
||||||
if (entity1 != entity && this.connection != null) {
|
if (entity1 != entity && this.connection != null) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 6b451733da0ccd5f300ccf1614ff301d641f0996..21aebe12db1544d0b8958c7db35a98cb92174630 100644
|
index 6ec242804b8a52216cf4148eed7d33109021c4de..2f9e6781e501a76994edc208a7981030d8fb4ea2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2235,12 +2235,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2234,12 +2234,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ index 6b451733da0ccd5f300ccf1614ff301d641f0996..21aebe12db1544d0b8958c7db35a98cb
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2303,7 +2306,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2302,7 +2305,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
return true; // CraftBukkit
|
return true; // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ index 6b451733da0ccd5f300ccf1614ff301d641f0996..21aebe12db1544d0b8958c7db35a98cb
|
|||||||
if (entity.getVehicle() == this) {
|
if (entity.getVehicle() == this) {
|
||||||
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
|
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
|
||||||
} else {
|
} else {
|
||||||
@@ -2313,7 +2319,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2312,7 +2318,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
|
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
|
||||||
VehicleExitEvent event = new VehicleExitEvent(
|
VehicleExitEvent event = new VehicleExitEvent(
|
||||||
(Vehicle) this.getBukkitEntity(),
|
(Vehicle) this.getBukkitEntity(),
|
||||||
@ -83,7 +83,7 @@ index 6b451733da0ccd5f300ccf1614ff301d641f0996..21aebe12db1544d0b8958c7db35a98cb
|
|||||||
);
|
);
|
||||||
// Suppress during worldgen
|
// Suppress during worldgen
|
||||||
if (this.valid) {
|
if (this.valid) {
|
||||||
@@ -2327,7 +2333,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2326,7 +2332,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
// Spigot start
|
// Spigot start
|
||||||
@ -93,7 +93,7 @@ index 6b451733da0ccd5f300ccf1614ff301d641f0996..21aebe12db1544d0b8958c7db35a98cb
|
|||||||
if (this.valid) {
|
if (this.valid) {
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 77d816a5a98f3118abb91eb65e0bb316b8b0c549..32507c52d90393101ef5140de0d82518e5cbfbcc 100644
|
index 5e781d0af08ba7faba84ee774e87f1c0d484ae9f..4e366fd032cf0ac37a7a851994625b905029cd4a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -3329,11 +3329,13 @@ public abstract class LivingEntity extends Entity {
|
@@ -3329,11 +3329,13 @@ public abstract class LivingEntity extends Entity {
|
||||||
|
@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent
|
|||||||
is undefined.
|
is undefined.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||||
index 8bbf13a7aea1142b3154a1c76837a98aa5ed431d..9f0537799a3cae43fb120056b8fe805a4883cc4d 100644
|
index 8bbf13a7aea1142b3154a1c76837a98aa5ed431d..7387990152e512cb186d76b5aa9d51838312ac03 100644
|
||||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||||
@@ -418,6 +418,26 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
@@ -418,6 +418,26 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||||
@ -51,7 +51,7 @@ index 8bbf13a7aea1142b3154a1c76837a98aa5ed431d..9f0537799a3cae43fb120056b8fe805a
|
|||||||
+ } else if (packetListener instanceof ServerLoginPacketListenerImpl) {
|
+ } else if (packetListener instanceof ServerLoginPacketListenerImpl) {
|
||||||
+ /* Player is login stage */
|
+ /* Player is login stage */
|
||||||
+ final ServerLoginPacketListenerImpl loginListener = (ServerLoginPacketListenerImpl) packetListener;
|
+ final ServerLoginPacketListenerImpl loginListener = (ServerLoginPacketListenerImpl) packetListener;
|
||||||
+ switch (loginListener.getLoginState()) {
|
+ switch (loginListener.state) {
|
||||||
+ case READY_TO_ACCEPT:
|
+ case READY_TO_ACCEPT:
|
||||||
+ case DELAY_ACCEPT:
|
+ case DELAY_ACCEPT:
|
||||||
+ case ACCEPTED:
|
+ case ACCEPTED:
|
||||||
@ -65,15 +65,11 @@ index 8bbf13a7aea1142b3154a1c76837a98aa5ed431d..9f0537799a3cae43fb120056b8fe805a
|
|||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
index 3d97f76f14b8c22c78c46a34c2da2e6406ba28b6..2e272db2b03bd1bf93e9d2af62b4eb43ae1be75b 100644
|
index bda4807f70806feb020eb73494079f23e6b0d90e..12f945e91827470a9a61951e45c062deee8cf281 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
@@ -56,10 +56,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
@@ -59,7 +59,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||||
private final byte[] nonce = new byte[4];
|
public ServerLoginPacketListenerImpl.State state;
|
||||||
final MinecraftServer server;
|
|
||||||
public final Connection connection;
|
|
||||||
- ServerLoginPacketListenerImpl.State state;
|
|
||||||
+ ServerLoginPacketListenerImpl.State state; @Deprecated public final ServerLoginPacketListenerImpl.State getLoginState() { return this.state; }; // Paper - OBFHELPER
|
|
||||||
private int tick;
|
private int tick;
|
||||||
@Nullable
|
@Nullable
|
||||||
- GameProfile gameProfile;
|
- GameProfile gameProfile;
|
||||||
|
@ -11,7 +11,7 @@ floating in the air.
|
|||||||
This can replace many uses of BlockPhysicsEvent
|
This can replace many uses of BlockPhysicsEvent
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 7bcb67df44a231d9b598a57c1b10bec18823bf74..9961b18178122cb44bf9bac6fceb1989d1a51b9a 100644
|
index 81ca3bf1a8f43b7c31cdb8dbba5fd234c28373ad..c85f6fedfaf756f8b17b554bcb2d94d0f00f01f1 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -28,6 +28,7 @@ import net.minecraft.nbt.CompoundTag;
|
@@ -28,6 +28,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||||
@ -22,7 +22,7 @@ index 7bcb67df44a231d9b598a57c1b10bec18823bf74..9961b18178122cb44bf9bac6fceb1989
|
|||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ChunkHolder;
|
import net.minecraft.server.level.ChunkHolder;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
@@ -568,8 +569,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -567,8 +568,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
FluidState fluid = this.getFluidState(pos);
|
FluidState fluid = this.getFluidState(pos);
|
||||||
|
@ -35,7 +35,7 @@ index ea336bdf2f15aabe74de82ef6c29b93573254e31..da3100d6577166e222164c174b280205
|
|||||||
});
|
});
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 21aebe12db1544d0b8958c7db35a98cb92174630..88b9a6b7157c9e1b6d1acf80b95fb15004e9c4d3 100644
|
index 2f9e6781e501a76994edc208a7981030d8fb4ea2..ec2cc6bcfe10896f0ae439f26659a7d14e050f0f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -67,6 +67,8 @@ import net.minecraft.world.InteractionHand;
|
@@ -67,6 +67,8 @@ import net.minecraft.world.InteractionHand;
|
||||||
@ -55,8 +55,8 @@ index 21aebe12db1544d0b8958c7db35a98cb92174630..88b9a6b7157c9e1b6d1acf80b95fb150
|
|||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||||
@@ -1863,6 +1866,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1862,6 +1865,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
nbt.setUUID("Paper.OriginWorld", originWorld);
|
nbt.putUUID("Paper.OriginWorld", originWorld);
|
||||||
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||||
}
|
}
|
||||||
+ if (spawnReason != null) {
|
+ if (spawnReason != null) {
|
||||||
@ -65,7 +65,7 @@ index 21aebe12db1544d0b8958c7db35a98cb92174630..88b9a6b7157c9e1b6d1acf80b95fb150
|
|||||||
// Save entity's from mob spawner status
|
// Save entity's from mob spawner status
|
||||||
if (spawnedViaMobSpawner) {
|
if (spawnedViaMobSpawner) {
|
||||||
nbt.putBoolean("Paper.FromMobSpawner", true);
|
nbt.putBoolean("Paper.FromMobSpawner", true);
|
||||||
@@ -2006,6 +2012,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2005,6 +2011,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
||||||
@ -105,7 +105,7 @@ index 7bf688057d684aa1b60f29294c9a7e81ab6742d1..66ae43c40d4bad373b3a5269e8c78d7a
|
|||||||
// Spigot Start
|
// Spigot Start
|
||||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
index 7f1d9932e0e4e09c3727544d053ad61a365290af..5bf488e5ed1981ef121291867062c2c2efaed6fc 100644
|
index bcb616ade47b445dd6faec0fd938ee4d728d6d16..a28afbe66363e69a502b66d4124bb8fccf07be37 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
@@ -1173,5 +1173,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@@ -1173,5 +1173,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
|
@ -8,7 +8,7 @@ Exposes a mutable array on items a player should keep on death
|
|||||||
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
|
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 401b8f203ac0147c250ffd999003d0a6f2fd90fd..943516cbf4829b16dfb2631d526a65ace78da10d 100644
|
index 401b8f203ac0147c250ffd999003d0a6f2fd90fd..c295ca30fad607feb49d58cec664a7205a493e78 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -729,6 +729,46 @@ public class ServerPlayer extends Player {
|
@@ -729,6 +729,46 @@ public class ServerPlayer extends Player {
|
||||||
@ -63,7 +63,7 @@ index 401b8f203ac0147c250ffd999003d0a6f2fd90fd..943516cbf4829b16dfb2631d526a65ac
|
|||||||
if (!event.getKeepInventory()) {
|
if (!event.getKeepInventory()) {
|
||||||
this.getInventory().clearContent();
|
this.getInventory().clearContent();
|
||||||
+ // Paper start - replace logic
|
+ // Paper start - replace logic
|
||||||
+ for (NonNullList<ItemStack> inv : this.getInventory().getComponents()) {
|
+ for (NonNullList<ItemStack> inv : this.getInventory().compartments) {
|
||||||
+ processKeep(event, inv);
|
+ processKeep(event, inv);
|
||||||
+ }
|
+ }
|
||||||
+ processKeep(event, null);
|
+ processKeep(event, null);
|
||||||
|
@ -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.
|
just do a get call since the value can never be null.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 9961b18178122cb44bf9bac6fceb1989d1a51b9a..6acff46faa03842567d5fe81609bec6ea7922c21 100644
|
index c85f6fedfaf756f8b17b554bcb2d94d0f00f01f1..5d021fbaeeb2655a775053225a9614d7881331c4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -872,9 +872,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -871,9 +871,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public BlockEntity getTileEntity(BlockPos blockposition, boolean validate) {
|
public BlockEntity getTileEntity(BlockPos blockposition, boolean validate) {
|
||||||
|
@ -32,7 +32,7 @@ https://bugs.mojang.com/browse/MC-141484?focusedCommentId=528273&page=com.atlass
|
|||||||
https://bugs.mojang.com/browse/MC-141484?focusedCommentId=528577&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-528577
|
https://bugs.mojang.com/browse/MC-141484?focusedCommentId=528577&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-528577
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
||||||
index 1fa190e098079522e0fe3593fa261c1b7ad4e24b..71ffa66973d8994e2a480435ac1ada3fe61600a4 100644
|
index 1fa190e098079522e0fe3593fa261c1b7ad4e24b..43067ef5733a29145b3e2ce386999ba518042dd7 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
||||||
@@ -6,13 +6,15 @@ import com.google.common.collect.ImmutableSet;
|
@@ -6,13 +6,15 @@ import com.google.common.collect.ImmutableSet;
|
||||||
@ -132,7 +132,7 @@ index 1fa190e098079522e0fe3593fa261c1b7ad4e24b..71ffa66973d8994e2a480435ac1ada3f
|
|||||||
+ int entityTicking = 0;
|
+ int entityTicking = 0;
|
||||||
+
|
+
|
||||||
+ for (ChunkHolder chunk : world.getChunkSource().chunkMap.updatingChunkMap.values()) {
|
+ for (ChunkHolder chunk : world.getChunkSource().chunkMap.updatingChunkMap.values()) {
|
||||||
+ if (chunk.getFullChunkIfCached() == null) {
|
+ if (chunk.getFullChunkUnchecked() == null) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -212,7 +212,7 @@ index 1fa190e098079522e0fe3593fa261c1b7ad4e24b..71ffa66973d8994e2a480435ac1ada3f
|
|||||||
* Ported from MinecraftForge - author: LexManos <LexManos@gmail.com> - License: LGPLv2.1
|
* Ported from MinecraftForge - author: LexManos <LexManos@gmail.com> - License: LGPLv2.1
|
||||||
*/
|
*/
|
||||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
index 2d0c10c72a9ddc5a26352fad6baae2f6c2678923..dcc8837d0c806a3755f1d20b6780b674edf09a11 100644
|
index 2d0c10c72a9ddc5a26352fad6baae2f6c2678923..5c1421620e02b7d4ab4171ebff41076c7ee8cd55 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
@@ -8,13 +8,27 @@ import net.minecraft.core.BlockPos;
|
@@ -8,13 +8,27 @@ import net.minecraft.core.BlockPos;
|
||||||
@ -334,7 +334,7 @@ index 2d0c10c72a9ddc5a26352fad6baae2f6c2678923..dcc8837d0c806a3755f1d20b6780b674
|
|||||||
+ int fullLoadedChunks = 0;
|
+ int fullLoadedChunks = 0;
|
||||||
+
|
+
|
||||||
+ for (ChunkHolder chunk : allChunks) {
|
+ for (ChunkHolder chunk : allChunks) {
|
||||||
+ if (chunk.getFullChunkIfCached() != null) {
|
+ if (chunk.getFullChunkUnchecked() != null) {
|
||||||
+ ++fullLoadedChunks;
|
+ ++fullLoadedChunks;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
@ -33,7 +33,7 @@ this fix, as the data will remain in the oversized file. Once the server returns
|
|||||||
to a jar with this fix, the data will be restored.
|
to a jar with this fix, the data will be restored.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
index 357da4846344d1182ab7149c4d352d5019384715..26ad58e7a73e63d2393eb277984be20472157539 100644
|
index 298b5abbc792dd33be38acbd1c572c9778c4d2d2..46226dd2d16a9f4017661712fe2bfc0c46f63cb2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
@@ -20,8 +20,12 @@ import java.nio.file.LinkOption;
|
@@ -20,8 +20,12 @@ import java.nio.file.LinkOption;
|
||||||
@ -66,7 +66,7 @@ index 357da4846344d1182ab7149c4d352d5019384715..26ad58e7a73e63d2393eb277984be204
|
|||||||
this.usedSectors = new RegionBitmap();
|
this.usedSectors = new RegionBitmap();
|
||||||
this.version = outputChunkStreamVersion;
|
this.version = outputChunkStreamVersion;
|
||||||
if (!Files.isDirectory(directory, new LinkOption[0])) {
|
if (!Files.isDirectory(directory, new LinkOption[0])) {
|
||||||
@@ -434,6 +441,74 @@ public class RegionFile implements AutoCloseable {
|
@@ -433,6 +440,74 @@ public class RegionFile implements AutoCloseable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ index 357da4846344d1182ab7149c4d352d5019384715..26ad58e7a73e63d2393eb277984be204
|
|||||||
|
|
||||||
private final ChunkPos pos;
|
private final ChunkPos pos;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
index ebb1a050beab9530942c4498335f084c89faef06..f53268f2d7d2d1909d64d06bb6a61086386830e1 100644
|
index ebb1a050beab9530942c4498335f084c89faef06..24092d3d3d234b6f1f2b90e22d90f297532358cc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
@@ -10,7 +10,9 @@ import java.io.File;
|
@@ -10,7 +10,9 @@ import java.io.File;
|
||||||
@ -182,7 +182,7 @@ index ebb1a050beab9530942c4498335f084c89faef06..f53268f2d7d2d1909d64d06bb6a61086
|
|||||||
+
|
+
|
||||||
+ private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
+ private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||||
+ synchronized (regionfile) {
|
+ synchronized (regionfile) {
|
||||||
+ try (DataInputStream datainputstream = regionfile.getReadStream(chunkCoordinate)) {
|
+ try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
||||||
+ CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
+ CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||||
+ CompoundTag chunk = NbtIo.read((DataInput) datainputstream);
|
+ CompoundTag chunk = NbtIo.read((DataInput) datainputstream);
|
||||||
+ if (oversizedData == null) {
|
+ if (oversizedData == null) {
|
||||||
|
@ -8,17 +8,17 @@ This patch also adds a chunk status cache on region files (note that
|
|||||||
its only purpose is to cache the status on DISK)
|
its only purpose is to cache the status on DISK)
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index ddaf9d682772d5dbbe6ee4891f9995a8ee365329..a3692debdf8c0df1f785794bff29235b95750809 100644
|
index 0dbd72761bd605473d1643ac1ad16a373060ddae..a066ac00ad3274a7c70edbb9cc442dc9be78a3bb 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -111,6 +111,19 @@ public class ChunkHolder {
|
@@ -110,6 +110,19 @@ public class ChunkHolder {
|
||||||
Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = (Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>) statusFuture.getNow(null);
|
Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = (Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>) statusFuture.getNow(null);
|
||||||
return (either == null) ? null : (LevelChunk) either.left().orElse(null);
|
return (either == null) ? null : (LevelChunk) either.left().orElse(null);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public ChunkAccess getAvailableChunkNow() {
|
+ public ChunkAccess getAvailableChunkNow() {
|
||||||
+ // TODO can we just getStatusFuture(EMPTY)?
|
+ // TODO can we just getStatusFuture(EMPTY)?
|
||||||
+ for (ChunkStatus curr = ChunkStatus.FULL, next = curr.getPreviousStatus(); curr != next; curr = next, next = next.getPreviousStatus()) {
|
+ for (ChunkStatus curr = ChunkStatus.FULL, next = curr.getParent(); curr != next; curr = next, next = next.getParent()) {
|
||||||
+ CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> future = this.getFutureIfPresentUnchecked(curr);
|
+ CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> future = this.getFutureIfPresentUnchecked(curr);
|
||||||
+ Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = future.getNow(null);
|
+ Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = future.getNow(null);
|
||||||
+ if (either == null || !either.left().isPresent()) {
|
+ if (either == null || !either.left().isPresent()) {
|
||||||
@ -108,7 +108,7 @@ index 36bc19cbb5242207ff019f62f59205e1a6336728..f271d7b32fef73401778682a1d4832bf
|
|||||||
// Spigot start
|
// Spigot start
|
||||||
return this.isOutsideOfRange(chunkPos, false);
|
return this.isOutsideOfRange(chunkPos, false);
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 672f78d1560ccd45d1a0ca04d6daf8188105c3e9..734b204d53a4b9e9b1112efe3a50b53cf1aa9f47 100644
|
index 1176dd8ebd59c5bda1b74c532ca21ae335078805..ddaa4dfa4611e8d659e9d0211873b6f503e3d230 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -324,6 +324,7 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -324,6 +324,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@ -120,18 +120,10 @@ index 672f78d1560ccd45d1a0ca04d6daf8188105c3e9..734b204d53a4b9e9b1112efe3a50b53c
|
|||||||
ChunkHolder holder = this.chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
|
ChunkHolder holder = this.chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
|
||||||
if (holder == null) {
|
if (holder == null) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
|
||||||
index 6e0cf8ee76143301c939fc4af5eeb091abdcbc5c..11739e01ea7188a45a3824ade8342124780ce936 100644
|
index 6e0cf8ee76143301c939fc4af5eeb091abdcbc5c..1c7b18db0053bca6e7750225a79f7d95843edabe 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
|
||||||
@@ -204,6 +204,7 @@ public class ChunkStatus {
|
@@ -224,6 +224,17 @@ public class ChunkStatus {
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated public ChunkStatus getPreviousStatus() { return this.getParent(); } // Paper - OBFHELPER
|
|
||||||
public ChunkStatus getParent() {
|
|
||||||
return this.parent;
|
|
||||||
}
|
|
||||||
@@ -224,6 +225,17 @@ public class ChunkStatus {
|
|
||||||
return this.chunkType;
|
return this.chunkType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +164,7 @@ index 21b3da831cd959e3fd85d437e1ba3c7a6c72502f..1c975b686c1e335d46e63ab12e0a97dd
|
|||||||
if (nbt != null) {
|
if (nbt != null) {
|
||||||
ChunkStatus chunkstatus = ChunkStatus.byName(nbt.getCompound("Level").getString("Status"));
|
ChunkStatus chunkstatus = ChunkStatus.byName(nbt.getCompound("Level").getString("Status"));
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
index 2f1d53037ac00bf2570def599641263fdc3859a1..933acb9bd1c6dd2baedee4bddea83a9de7f1e3d1 100644
|
index 46226dd2d16a9f4017661712fe2bfc0c46f63cb2..c22391a0d4b7db49bd3994b0887939a7d8019391 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||||
@@ -27,6 +27,7 @@ import net.minecraft.Util;
|
@@ -27,6 +27,7 @@ import net.minecraft.Util;
|
||||||
@ -214,7 +206,7 @@ index 2f1d53037ac00bf2570def599641263fdc3859a1..933acb9bd1c6dd2baedee4bddea83a9d
|
|||||||
public RegionFile(File file, File directory, boolean dsync) throws IOException {
|
public RegionFile(File file, File directory, boolean dsync) throws IOException {
|
||||||
this(file.toPath(), directory.toPath(), RegionFileVersion.VERSION_DEFLATE, dsync);
|
this(file.toPath(), directory.toPath(), RegionFileVersion.VERSION_DEFLATE, dsync);
|
||||||
}
|
}
|
||||||
@@ -402,6 +427,7 @@ public class RegionFile implements AutoCloseable {
|
@@ -401,6 +426,7 @@ public class RegionFile implements AutoCloseable {
|
||||||
return this.getOffset(pos) != 0;
|
return this.getOffset(pos) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +214,7 @@ index 2f1d53037ac00bf2570def599641263fdc3859a1..933acb9bd1c6dd2baedee4bddea83a9d
|
|||||||
private static int getOffsetIndex(ChunkPos pos) {
|
private static int getOffsetIndex(ChunkPos pos) {
|
||||||
return pos.getRegionLocalX() + pos.getRegionLocalZ() * 32;
|
return pos.getRegionLocalX() + pos.getRegionLocalZ() * 32;
|
||||||
}
|
}
|
||||||
@@ -412,6 +438,7 @@ public class RegionFile implements AutoCloseable {
|
@@ -411,6 +437,7 @@ public class RegionFile implements AutoCloseable {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
try {
|
try {
|
||||||
// Paper end
|
// Paper end
|
||||||
@ -231,7 +223,7 @@ index 2f1d53037ac00bf2570def599641263fdc3859a1..933acb9bd1c6dd2baedee4bddea83a9d
|
|||||||
this.padToFullSector();
|
this.padToFullSector();
|
||||||
} finally {
|
} finally {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
index f53268f2d7d2d1909d64d06bb6a61086386830e1..e1b9051f8537db6f023cfdeaca4fb89305ece363 100644
|
index 24092d3d3d234b6f1f2b90e22d90f297532358cc..43510774d489bfdd30f10d521e424fa1363b8919 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
@@ -219,6 +219,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -219,6 +219,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
|
@ -112,10 +112,10 @@ index 0000000000000000000000000000000000000000..55e1c448999d79ddd9781d6f8ff28998
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ecb724f4e6
|
index 0000000000000000000000000000000000000000..c69332299015d90345636cf0f4425db62068f978
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
||||||
@@ -0,0 +1,646 @@
|
@@ -0,0 +1,644 @@
|
||||||
+package com.destroystokyo.paper.antixray;
|
+package com.destroystokyo.paper.antixray;
|
||||||
+
|
+
|
||||||
+import java.util.ArrayList;
|
+import java.util.ArrayList;
|
||||||
@ -169,7 +169,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ private final int[] predefinedBlockDataBitsEndStoneGlobal;
|
+ private final int[] predefinedBlockDataBitsEndStoneGlobal;
|
||||||
+ private final boolean[] solidGlobal = new boolean[Block.BLOCK_STATE_REGISTRY.size()];
|
+ private final boolean[] solidGlobal = new boolean[Block.BLOCK_STATE_REGISTRY.size()];
|
||||||
+ private final boolean[] obfuscateGlobal = new boolean[Block.BLOCK_STATE_REGISTRY.size()];
|
+ private final boolean[] obfuscateGlobal = new boolean[Block.BLOCK_STATE_REGISTRY.size()];
|
||||||
+ private final LevelChunkSection[] emptyNearbyChunkSections = {LevelChunk.EMPTY_CHUNK_SECTION, LevelChunk.EMPTY_CHUNK_SECTION, LevelChunk.EMPTY_CHUNK_SECTION, LevelChunk.EMPTY_CHUNK_SECTION};
|
+ private final LevelChunkSection[] emptyNearbyChunkSections = {LevelChunk.EMPTY_SECTION, LevelChunk.EMPTY_SECTION, LevelChunk.EMPTY_SECTION, LevelChunk.EMPTY_SECTION};
|
||||||
+ private final int maxBlockYUpdatePosition;
|
+ private final int maxBlockYUpdatePosition;
|
||||||
+
|
+
|
||||||
+ public ChunkPacketBlockControllerAntiXray(Level world, Executor executor) {
|
+ public ChunkPacketBlockControllerAntiXray(Level world, Executor executor) {
|
||||||
@ -194,9 +194,9 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ predefinedBlockDataNetherrack = new BlockState[] {Blocks.NETHERRACK.defaultBlockState()};
|
+ predefinedBlockDataNetherrack = new BlockState[] {Blocks.NETHERRACK.defaultBlockState()};
|
||||||
+ predefinedBlockDataEndStone = new BlockState[] {Blocks.END_STONE.defaultBlockState()};
|
+ predefinedBlockDataEndStone = new BlockState[] {Blocks.END_STONE.defaultBlockState()};
|
||||||
+ predefinedBlockDataBitsGlobal = null;
|
+ predefinedBlockDataBitsGlobal = null;
|
||||||
+ predefinedBlockDataBitsStoneGlobal = new int[] {LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(Blocks.STONE.defaultBlockState())};
|
+ predefinedBlockDataBitsStoneGlobal = new int[] {LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(Blocks.STONE.defaultBlockState())};
|
||||||
+ predefinedBlockDataBitsNetherrackGlobal = new int[] {LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(Blocks.NETHERRACK.defaultBlockState())};
|
+ predefinedBlockDataBitsNetherrackGlobal = new int[] {LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(Blocks.NETHERRACK.defaultBlockState())};
|
||||||
+ predefinedBlockDataBitsEndStoneGlobal = new int[] {LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(Blocks.END_STONE.defaultBlockState())};
|
+ predefinedBlockDataBitsEndStoneGlobal = new int[] {LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(Blocks.END_STONE.defaultBlockState())};
|
||||||
+ } else {
|
+ } else {
|
||||||
+ toObfuscate = new ArrayList<>(paperWorldConfig.replacementBlocks);
|
+ toObfuscate = new ArrayList<>(paperWorldConfig.replacementBlocks);
|
||||||
+ List<BlockState> predefinedBlockDataList = new LinkedList<BlockState>();
|
+ List<BlockState> predefinedBlockDataList = new LinkedList<BlockState>();
|
||||||
@ -221,7 +221,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ predefinedBlockDataBitsGlobal = new int[predefinedBlockDataFull.length];
|
+ predefinedBlockDataBitsGlobal = new int[predefinedBlockDataFull.length];
|
||||||
+
|
+
|
||||||
+ for (int i = 0; i < predefinedBlockDataFull.length; i++) {
|
+ for (int i = 0; i < predefinedBlockDataFull.length; i++) {
|
||||||
+ predefinedBlockDataBitsGlobal[i] = LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(predefinedBlockDataFull[i]);
|
+ predefinedBlockDataBitsGlobal[i] = LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(predefinedBlockDataFull[i]);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ predefinedBlockDataBitsStoneGlobal = null;
|
+ predefinedBlockDataBitsStoneGlobal = null;
|
||||||
@ -235,10 +235,8 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ // Don't obfuscate air because air causes unnecessary block updates and causes block updates to fail in the void
|
+ // Don't obfuscate air because air causes unnecessary block updates and causes block updates to fail in the void
|
||||||
+ if (block != null && !block.defaultBlockState().isAir()) {
|
+ if (block != null && !block.defaultBlockState().isAir()) {
|
||||||
+ // Replace all block states of a specified block
|
+ // Replace all block states of a specified block
|
||||||
+ // No OBFHELPER for nms.BlockStateList#a() due to too many decompile errors
|
|
||||||
+ // The OBFHELPER should be getBlockDataList()
|
|
||||||
+ for (BlockState blockData : block.getStateDefinition().getPossibleStates()) {
|
+ for (BlockState blockData : block.getStateDefinition().getPossibleStates()) {
|
||||||
+ obfuscateGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(blockData)] = true;
|
+ obfuscateGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(blockData)] = true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -247,7 +245,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ BlockPos zeroPos = new BlockPos(0, 0, 0);
|
+ BlockPos zeroPos = new BlockPos(0, 0, 0);
|
||||||
+
|
+
|
||||||
+ for (int i = 0; i < solidGlobal.length; i++) {
|
+ for (int i = 0; i < solidGlobal.length; i++) {
|
||||||
+ BlockState blockData = LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getObject(i);
|
+ BlockState blockData = LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.valueFor(i);
|
||||||
+
|
+
|
||||||
+ if (blockData != null) {
|
+ if (blockData != null) {
|
||||||
+ solidGlobal[i] = blockData.isRedstoneConductor(emptyChunk, zeroPos)
|
+ solidGlobal[i] = blockData.isRedstoneConductor(emptyChunk, zeroPos)
|
||||||
@ -378,7 +376,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ predefinedBlockDataBitsTemp = predefinedBlockDataBits;
|
+ predefinedBlockDataBitsTemp = predefinedBlockDataBits;
|
||||||
+
|
+
|
||||||
+ for (int i = 0; i < predefinedBlockDataBitsTemp.length; i++) {
|
+ for (int i = 0; i < predefinedBlockDataBitsTemp.length; i++) {
|
||||||
+ predefinedBlockDataBitsTemp[i] = chunkPacketInfoAntiXray.getDataPalette(chunkSectionIndex).getOrCreateIdFor(predefinedBlockDataFull[i]);
|
+ predefinedBlockDataBitsTemp[i] = chunkPacketInfoAntiXray.getDataPalette(chunkSectionIndex).idFor(predefinedBlockDataFull[i]);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -393,12 +391,12 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ obfuscateTemp = readDataPalette(chunkPacketInfoAntiXray.getDataPalette(chunkSectionIndex), obfuscate, obfuscateGlobal);
|
+ obfuscateTemp = readDataPalette(chunkPacketInfoAntiXray.getDataPalette(chunkSectionIndex), obfuscate, obfuscateGlobal);
|
||||||
+ // Read the blocks of the upper layer of the chunk section below if it exists
|
+ // Read the blocks of the upper layer of the chunk section below if it exists
|
||||||
+ LevelChunkSection belowChunkSection = null;
|
+ LevelChunkSection belowChunkSection = null;
|
||||||
+ boolean skipFirstLayer = chunkSectionIndex == 0 || (belowChunkSection = chunkPacketInfoAntiXray.getChunk().getSections()[chunkSectionIndex - 1]) == LevelChunk.EMPTY_CHUNK_SECTION;
|
+ boolean skipFirstLayer = chunkSectionIndex == 0 || (belowChunkSection = chunkPacketInfoAntiXray.getChunk().getSections()[chunkSectionIndex - 1]) == LevelChunk.EMPTY_SECTION;
|
||||||
+
|
+
|
||||||
+ for (int z = 0; z < 16; z++) {
|
+ for (int z = 0; z < 16; z++) {
|
||||||
+ for (int x = 0; x < 16; x++) {
|
+ for (int x = 0; x < 16; x++) {
|
||||||
+ current[z][x] = true;
|
+ current[z][x] = true;
|
||||||
+ next[z][x] = skipFirstLayer || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(belowChunkSection.getBlockState(x, 15, z))];
|
+ next[z][x] = skipFirstLayer || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(belowChunkSection.getBlockState(x, 15, z))];
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -408,10 +406,10 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ dataBitsWriter.setBitsPerObject(chunkPacketInfoAntiXray.getBitsPerObject(chunkSectionIndex));
|
+ dataBitsWriter.setBitsPerObject(chunkPacketInfoAntiXray.getBitsPerObject(chunkSectionIndex));
|
||||||
+ nearbyChunkSections[0] = chunkPacketInfoAntiXray.getNearbyChunks()[0] == null ? LevelChunk.EMPTY_CHUNK_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[0].getSections()[chunkSectionIndex];
|
+ nearbyChunkSections[0] = chunkPacketInfoAntiXray.getNearbyChunks()[0] == null ? LevelChunk.EMPTY_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[0].getSections()[chunkSectionIndex];
|
||||||
+ nearbyChunkSections[1] = chunkPacketInfoAntiXray.getNearbyChunks()[1] == null ? LevelChunk.EMPTY_CHUNK_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[1].getSections()[chunkSectionIndex];
|
+ nearbyChunkSections[1] = chunkPacketInfoAntiXray.getNearbyChunks()[1] == null ? LevelChunk.EMPTY_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[1].getSections()[chunkSectionIndex];
|
||||||
+ nearbyChunkSections[2] = chunkPacketInfoAntiXray.getNearbyChunks()[2] == null ? LevelChunk.EMPTY_CHUNK_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[2].getSections()[chunkSectionIndex];
|
+ nearbyChunkSections[2] = chunkPacketInfoAntiXray.getNearbyChunks()[2] == null ? LevelChunk.EMPTY_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[2].getSections()[chunkSectionIndex];
|
||||||
+ nearbyChunkSections[3] = chunkPacketInfoAntiXray.getNearbyChunks()[3] == null ? LevelChunk.EMPTY_CHUNK_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[3].getSections()[chunkSectionIndex];
|
+ nearbyChunkSections[3] = chunkPacketInfoAntiXray.getNearbyChunks()[3] == null ? LevelChunk.EMPTY_SECTION : chunkPacketInfoAntiXray.getNearbyChunks()[3].getSections()[chunkSectionIndex];
|
||||||
+
|
+
|
||||||
+ // Obfuscate all layers of the current chunk section except the upper one
|
+ // Obfuscate all layers of the current chunk section except the upper one
|
||||||
+ for (int y = 0; y < 15; y++) {
|
+ for (int y = 0; y < 15; y++) {
|
||||||
@ -427,7 +425,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ // If so, obfuscate the upper layer of the current chunk section by reading blocks of the first layer from the chunk section above if it exists
|
+ // If so, obfuscate the upper layer of the current chunk section by reading blocks of the first layer from the chunk section above if it exists
|
||||||
+ LevelChunkSection aboveChunkSection;
|
+ LevelChunkSection aboveChunkSection;
|
||||||
+
|
+
|
||||||
+ if (chunkSectionIndex != worldSectionHeight && (aboveChunkSection = chunkPacketInfoAntiXray.getChunk().getSections()[chunkSectionIndex + 1]) != LevelChunk.EMPTY_CHUNK_SECTION) {
|
+ if (chunkSectionIndex != worldSectionHeight && (aboveChunkSection = chunkPacketInfoAntiXray.getChunk().getSections()[chunkSectionIndex + 1]) != LevelChunk.EMPTY_SECTION) {
|
||||||
+ boolean[][] temp = current;
|
+ boolean[][] temp = current;
|
||||||
+ current = next;
|
+ current = next;
|
||||||
+ next = nextNext;
|
+ next = nextNext;
|
||||||
@ -435,7 +433,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+
|
+
|
||||||
+ for (int z = 0; z < 16; z++) {
|
+ for (int z = 0; z < 16; z++) {
|
||||||
+ for (int x = 0; x < 16; x++) {
|
+ for (int x = 0; x < 16; x++) {
|
||||||
+ if (!solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(aboveChunkSection.getBlockState(x, 0, z))]) {
|
+ if (!solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(aboveChunkSection.getBlockState(x, 0, z))]) {
|
||||||
+ current[z][x] = true;
|
+ current[z][x] = true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -475,7 +473,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[0][1] = true;
|
+ next[0][1] = true;
|
||||||
+ next[1][0] = true;
|
+ next[1][0] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[2] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[2].getBlockState(0, y, 15))] || nearbyChunkSections[0] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[0].getBlockState(15, y, 0))] || current[0][0]) {
|
+ if (nearbyChunkSections[2] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[2].getBlockState(0, y, 15))] || nearbyChunkSections[0] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[0].getBlockState(15, y, 0))] || current[0][0]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -496,7 +494,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[0][x + 1] = true;
|
+ next[0][x + 1] = true;
|
||||||
+ next[1][x] = true;
|
+ next[1][x] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[2] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[2].getBlockState(x, y, 15))] || current[0][x]) {
|
+ if (nearbyChunkSections[2] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[2].getBlockState(x, y, 15))] || current[0][x]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -516,7 +514,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[0][14] = true;
|
+ next[0][14] = true;
|
||||||
+ next[1][15] = true;
|
+ next[1][15] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[2] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[2].getBlockState(15, y, 15))] || nearbyChunkSections[1] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[1].getBlockState(0, y, 0))] || current[0][15]) {
|
+ if (nearbyChunkSections[2] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[2].getBlockState(15, y, 15))] || nearbyChunkSections[1] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[1].getBlockState(0, y, 0))] || current[0][15]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -538,7 +536,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[z - 1][0] = true;
|
+ next[z - 1][0] = true;
|
||||||
+ next[z + 1][0] = true;
|
+ next[z + 1][0] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[0] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[0].getBlockState(15, y, z))] || current[z][0]) {
|
+ if (nearbyChunkSections[0] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[0].getBlockState(15, y, z))] || current[z][0]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -581,7 +579,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[z - 1][15] = true;
|
+ next[z - 1][15] = true;
|
||||||
+ next[z + 1][15] = true;
|
+ next[z + 1][15] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[1] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[1].getBlockState(0, y, z))] || current[z][15]) {
|
+ if (nearbyChunkSections[1] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[1].getBlockState(0, y, z))] || current[z][15]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -601,7 +599,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[15][1] = true;
|
+ next[15][1] = true;
|
||||||
+ next[14][0] = true;
|
+ next[14][0] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[3] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[3].getBlockState(0, y, 0))] || nearbyChunkSections[0] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[0].getBlockState(15, y, 15))] || current[15][0]) {
|
+ if (nearbyChunkSections[3] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[3].getBlockState(0, y, 0))] || nearbyChunkSections[0] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[0].getBlockState(15, y, 15))] || current[15][0]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -622,7 +620,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[15][x + 1] = true;
|
+ next[15][x + 1] = true;
|
||||||
+ next[14][x] = true;
|
+ next[14][x] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[3] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[3].getBlockState(x, y, 0))] || current[15][x]) {
|
+ if (nearbyChunkSections[3] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[3].getBlockState(x, y, 0))] || current[15][x]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -642,7 +640,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ next[15][14] = true;
|
+ next[15][14] = true;
|
||||||
+ next[14][15] = true;
|
+ next[14][15] = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (nearbyChunkSections[3] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[3].getBlockState(15, y, 0))] || nearbyChunkSections[1] == LevelChunk.EMPTY_CHUNK_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(nearbyChunkSections[1].getBlockState(0, y, 15))] || current[15][15]) {
|
+ if (nearbyChunkSections[3] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[3].getBlockState(15, y, 0))] || nearbyChunkSections[1] == LevelChunk.EMPTY_SECTION || !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(nearbyChunkSections[1].getBlockState(0, y, 15))] || current[15][15]) {
|
||||||
+ dataBitsWriter.skip();
|
+ dataBitsWriter.skip();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
+ dataBitsWriter.write(predefinedBlockDataBits[random.getAsInt()]);
|
||||||
@ -661,8 +659,8 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+
|
+
|
||||||
+ BlockState blockData;
|
+ BlockState blockData;
|
||||||
+
|
+
|
||||||
+ for (int i = 0; (blockData = dataPalette.getObject(i)) != null; i++) {
|
+ for (int i = 0; (blockData = dataPalette.valueFor(i)) != null; i++) {
|
||||||
+ temp[i] = global[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(blockData)];
|
+ temp[i] = global[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(blockData)];
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return temp;
|
+ return temp;
|
||||||
@ -670,7 +668,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void onBlockChange(Level world, BlockPos blockPosition, BlockState newBlockData, BlockState oldBlockData, int flag) {
|
+ public void onBlockChange(Level world, BlockPos blockPosition, BlockState newBlockData, BlockState oldBlockData, int flag) {
|
||||||
+ if (oldBlockData != null && solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(oldBlockData)] && !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(newBlockData)] && blockPosition.getY() <= maxBlockYUpdatePosition) {
|
+ if (oldBlockData != null && solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(oldBlockData)] && !solidGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(newBlockData)] && blockPosition.getY() <= maxBlockYUpdatePosition) {
|
||||||
+ updateNearbyBlocks(world, blockPosition);
|
+ updateNearbyBlocks(world, blockPosition);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -724,7 +722,7 @@ index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ec
|
|||||||
+ private void updateBlock(Level world, BlockPos blockPosition) {
|
+ private void updateBlock(Level world, BlockPos blockPosition) {
|
||||||
+ BlockState blockData = world.getTypeIfLoaded(blockPosition);
|
+ BlockState blockData = world.getTypeIfLoaded(blockPosition);
|
||||||
+
|
+
|
||||||
+ if (blockData != null && obfuscateGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.getOrCreateIdFor(blockData)]) {
|
+ if (blockData != null && obfuscateGlobal[LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE.idFor(blockData)]) {
|
||||||
+ // world.notify(blockPosition, blockData, blockData, 3);
|
+ // world.notify(blockPosition, blockData, blockData, 3);
|
||||||
+ ((ServerLevel)world).getChunkSource().blockChanged(blockPosition); // We only need to re-send to client
|
+ ((ServerLevel)world).getChunkSource().blockChanged(blockPosition); // We only need to re-send to client
|
||||||
+ }
|
+ }
|
||||||
@ -1155,7 +1153,7 @@ index f4a056185990181e486f452960159a5287947382..a695e5a0c2e8846333ccb9aea499b565
|
|||||||
|
|
||||||
public void destroyAndAck(BlockPos pos, ServerboundPlayerActionPacket.Action action, String reason) {
|
public void destroyAndAck(BlockPos pos, ServerboundPlayerActionPacket.Action action, String reason) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index fff1d38e07439ab1bc83aa9e7153b3666a351129..7e4949155914a8ea5612080bd4a13ce63c2b10d7 100644
|
index 580b3d7d993751e7c04e6b7d5d4d8fa9d150d383..83673e66aab4988e912d78fb8d1a45f807e38bd9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -164,6 +164,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -164,6 +164,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -1231,7 +1229,7 @@ index 69c2454533e6f21c70792b555ec02c6bc6d169b3..2607c7ba5cf1aca5f3e5c22be2e4e8b3
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 448f28856387cf9967063dd8c02b34e5e90d95c9..3399ca62de7ae71af7c3f537bac3345b4c46d0a5 100644
|
index 8cc0f2a74191357ab52f30439a515709f8ab80d1..fbb82d344f654b90809582916442c520f344aa39 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -456,7 +456,7 @@ public class LevelChunk implements ChunkAccess {
|
@@ -456,7 +456,7 @@ public class LevelChunk implements ChunkAccess {
|
||||||
@ -1305,7 +1303,7 @@ index 5fd66020a937b641e2a060cf38df731a43f3bf55..ec8b67c1b024df38d5e1ad81acff3353
|
|||||||
|
|
||||||
public int getSerializedSize() {
|
public int getSerializedSize() {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f26c6340e 100644
|
index bb8fd88aebb550edec8c679622a02a595cbc6694..4a6981f8bacdeca1069e1ddfe44ac9c4217ce624 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
@@ -28,6 +28,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -28,6 +28,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
@ -1313,9 +1311,9 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
private final Function<T, CompoundTag> writer;
|
private final Function<T, CompoundTag> writer;
|
||||||
private final T defaultValue;
|
private final T defaultValue;
|
||||||
+ private final T[] predefinedObjects; // Paper - Anti-Xray - Add predefined objects
|
+ private final T[] predefinedObjects; // Paper - Anti-Xray - Add predefined objects
|
||||||
protected BitStorage storage; @Deprecated public final BitStorage getDataBits() { return this.storage; } // Paper - OBFHELPER
|
protected BitStorage storage;
|
||||||
private Palette<T> palette; @Deprecated private Palette<T> getDataPalette() { return this.palette; } // Paper - OBFHELPER
|
private Palette<T> palette;
|
||||||
private int bits; @Deprecated private int getBitsPerObject() { return this.bits; } // Paper - OBFHELPER
|
private int bits;
|
||||||
@@ -48,15 +49,51 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -48,15 +49,51 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
this.lock.release();
|
this.lock.release();
|
||||||
}
|
}
|
||||||
@ -1339,7 +1337,7 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
+ if (initialize) {
|
+ if (initialize) {
|
||||||
+ if (predefinedObjects == null) {
|
+ if (predefinedObjects == null) {
|
||||||
+ // Default
|
+ // Default
|
||||||
+ this.initialize(4);
|
+ this.setBits(4);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ // MathHelper.d() is trailingBits(roundCeilPow2(n)), alternatively; (int)ceil(log2(n)); however it's trash, use numberOfLeadingZeros instead
|
+ // MathHelper.d() is trailingBits(roundCeilPow2(n)), alternatively; (int)ceil(log2(n)); however it's trash, use numberOfLeadingZeros instead
|
||||||
+ // Count the bits of the maximum array index to initialize a data palette with enough space from the beginning
|
+ // Count the bits of the maximum array index to initialize a data palette with enough space from the beginning
|
||||||
@ -1349,7 +1347,7 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
+ int bitCount = (32 - Integer.numberOfLeadingZeros(Math.max(16, maxIndex) - 1));
|
+ int bitCount = (32 - Integer.numberOfLeadingZeros(Math.max(16, maxIndex) - 1));
|
||||||
+
|
+
|
||||||
+ // Initialize with at least 15 free indixes
|
+ // Initialize with at least 15 free indixes
|
||||||
+ this.initialize((1 << bitCount) - predefinedObjects.length < 16 ? bitCount + 1 : bitCount);
|
+ this.setBits((1 << bitCount) - predefinedObjects.length < 16 ? bitCount + 1 : bitCount);
|
||||||
+ this.addPredefinedObjects();
|
+ this.addPredefinedObjects();
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -1360,7 +1358,7 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
+ private void addPredefinedObjects() {
|
+ private void addPredefinedObjects() {
|
||||||
+ if (this.predefinedObjects != null && this.palette != this.globalPalette) {
|
+ if (this.predefinedObjects != null && this.palette != this.globalPalette) {
|
||||||
+ for (T predefinedObject : this.predefinedObjects) {
|
+ for (T predefinedObject : this.predefinedObjects) {
|
||||||
+ this.palette.getOrCreateIdFor(predefinedObject);
|
+ this.palette.idFor(predefinedObject);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -1369,7 +1367,7 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
private static int getIndex(int x, int y, int z) {
|
private static int getIndex(int x, int y, int z) {
|
||||||
return y << 8 | z << 4 | x;
|
return y << 8 | z << 4 | x;
|
||||||
}
|
}
|
||||||
@@ -86,6 +123,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -85,6 +122,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
Palette<T> palette = this.palette;
|
Palette<T> palette = this.palette;
|
||||||
this.setBits(newSize);
|
this.setBits(newSize);
|
||||||
|
|
||||||
@ -1377,10 +1375,10 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
for(int i = 0; i < bitStorage.getSize(); ++i) {
|
for(int i = 0; i < bitStorage.getSize(); ++i) {
|
||||||
T object = palette.valueFor(bitStorage.get(i));
|
T object = palette.valueFor(bitStorage.get(i));
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
@@ -161,11 +199,26 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -159,11 +197,26 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated public void writeDataPaletteBlock(FriendlyByteBuf packetDataSerializer) { this.write(packetDataSerializer); } // Paper - OBFHELPER
|
|
||||||
- public void write(FriendlyByteBuf buf) {
|
- public void write(FriendlyByteBuf buf) {
|
||||||
+ // Paper start - Anti-Xray - Add chunk packet info
|
+ // Paper start - Anti-Xray - Add chunk packet info
|
||||||
+ @Deprecated public void write(FriendlyByteBuf buf) {
|
+ @Deprecated public void write(FriendlyByteBuf buf) {
|
||||||
@ -1405,7 +1403,7 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
buf.writeLongArray(this.storage.getRaw());
|
buf.writeLongArray(this.storage.getRaw());
|
||||||
} finally {
|
} finally {
|
||||||
this.release();
|
this.release();
|
||||||
@@ -176,12 +229,14 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -174,12 +227,14 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
public void read(ListTag paletteNbt, long[] data) {
|
public void read(ListTag paletteNbt, long[] data) {
|
||||||
try {
|
try {
|
||||||
this.acquire();
|
this.acquire();
|
||||||
@ -1423,7 +1421,7 @@ index 3dfe539a9ca08d85ddbcc334cfec0734bf92f348..bb3311edffb7a460df8321f00d7d1d9f
|
|||||||
if (this.palette == this.globalPalette) {
|
if (this.palette == this.globalPalette) {
|
||||||
Palette<T> palette = new HashMapPalette<>(this.registry, i, this.dummyPaletteResize, this.reader, this.writer);
|
Palette<T> palette = new HashMapPalette<>(this.registry, i, this.dummyPaletteResize, this.reader, this.writer);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
index 245998e2cea32cf15ee2659639c647f449704ec0..d455eafe3810b6d8f3c6cbbfc0df85d3e6c90567 100644
|
index 64cb0658021866c3875d145cc4266896e57c081e..f0c537e1d6b32ecde52b3d456f0f3889ff554824 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||||
@@ -63,7 +63,7 @@ public class ProtoChunk implements ChunkAccess {
|
@@ -63,7 +63,7 @@ public class ProtoChunk implements ChunkAccess {
|
||||||
|
@ -39,7 +39,7 @@ index b8ca1f73b2451307c3711076eaa43e2adb34d92e..45e30c0d78b7625a6a55e6d7d60a823b
|
|||||||
public EngineMode engineMode;
|
public EngineMode engineMode;
|
||||||
public int maxBlockHeight;
|
public int maxBlockHeight;
|
||||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
index dcc8837d0c806a3755f1d20b6780b674edf09a11..530916b8d0c5eb3b7b379100df1e6e0d4ade273d 100644
|
index 5c1421620e02b7d4ab4171ebff41076c7ee8cd55..4bc418f45c6f16a9a1c78b6688625268870a96ad 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
@@ -636,7 +636,8 @@ public final class MCUtil {
|
@@ -636,7 +636,8 @@ public final class MCUtil {
|
||||||
@ -53,7 +53,7 @@ index dcc8837d0c806a3755f1d20b6780b674edf09a11..530916b8d0c5eb3b7b379100df1e6e0d
|
|||||||
worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange);
|
worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange);
|
||||||
worldData.addProperty("visible-chunk-count", visibleChunks.size());
|
worldData.addProperty("visible-chunk-count", visibleChunks.size());
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index a3692debdf8c0df1f785794bff29235b95750809..5ff96851e7f7c51c365dde0d24da49be6412ab82 100644
|
index a066ac00ad3274a7c70edbb9cc442dc9be78a3bb..edf0432967c4621e101611924c4ce826f54e3e34 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -75,6 +75,17 @@ public class ChunkHolder {
|
@@ -75,6 +75,17 @@ public class ChunkHolder {
|
||||||
@ -74,7 +74,7 @@ index a3692debdf8c0df1f785794bff29235b95750809..5ff96851e7f7c51c365dde0d24da49be
|
|||||||
|
|
||||||
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
||||||
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
||||||
@@ -207,7 +218,7 @@ public class ChunkHolder {
|
@@ -204,7 +215,7 @@ public class ChunkHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void blockChanged(BlockPos pos) {
|
public void blockChanged(BlockPos pos) {
|
||||||
@ -83,7 +83,7 @@ index a3692debdf8c0df1f785794bff29235b95750809..5ff96851e7f7c51c365dde0d24da49be
|
|||||||
|
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
int i = this.levelHeightAccessor.getSectionIndex(pos.getY());
|
int i = this.levelHeightAccessor.getSectionIndex(pos.getY());
|
||||||
@@ -223,7 +234,7 @@ public class ChunkHolder {
|
@@ -220,7 +231,7 @@ public class ChunkHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sectionLightChanged(LightLayer lightType, int y) {
|
public void sectionLightChanged(LightLayer lightType, int y) {
|
||||||
@ -92,7 +92,7 @@ index a3692debdf8c0df1f785794bff29235b95750809..5ff96851e7f7c51c365dde0d24da49be
|
|||||||
|
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
chunk.setUnsaved(true);
|
chunk.setUnsaved(true);
|
||||||
@@ -313,9 +324,48 @@ public class ChunkHolder {
|
@@ -310,9 +321,48 @@ public class ChunkHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void broadcast(Packet<?> packet, boolean onlyOnWatchDistanceEdge) {
|
public void broadcast(Packet<?> packet, boolean onlyOnWatchDistanceEdge) {
|
||||||
@ -145,7 +145,7 @@ index a3692debdf8c0df1f785794bff29235b95750809..5ff96851e7f7c51c365dde0d24da49be
|
|||||||
|
|
||||||
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) {
|
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index c8cc8fa2d210acf82d9c3fa96c0b0c3912dec4d8..6f4c350f486aa70b94be8cf5a7b0e22599283ba9 100644
|
index 06e581bc0c0ea4e8141f7b9610cc5a7ef350c287..5bcb9613beb5cd650c670de73e946f1f9dcddb2c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -127,7 +127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -127,7 +127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@ -520,7 +520,7 @@ index 45c7ebe67019cdbe88b6617a95d5c40d3a68286c..38eebda226e007c8910e04f502ce218c
|
|||||||
if (withinViewDistance) {
|
if (withinViewDistance) {
|
||||||
DistanceManager.this.ticketThrottlerInput.tell(ChunkTaskPriorityQueueSorter.message(() -> {
|
DistanceManager.this.ticketThrottlerInput.tell(ChunkTaskPriorityQueueSorter.message(() -> {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 7ce027a7352d2ab34c27046d86ae32100c0baeb4..6ecf85579acb186f076f258368051a4ae09c3354 100644
|
index 2a493097cba7bde598eafcd2986c4ab0fd20b4e6..be01191507ff677de586355abbae27d30de5a837 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -241,6 +241,7 @@ public class ServerPlayer extends Player {
|
@@ -241,6 +241,7 @@ public class ServerPlayer extends Player {
|
||||||
@ -563,7 +563,7 @@ index bcc946d2747443c34ee8ac2485a5ab41773c93af..2730923bd0bf3b0f928765b9e09e2299
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 7357319e9186c9ffd878268ed9c1f4846ceb3ea9..91bd27148f5b699b72d56844ded76e0e25e2693c 100644
|
index 83673e66aab4988e912d78fb8d1a45f807e38bd9..d58a7adb58abc91f66fc893ee7a7a7bded3619a8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -527,8 +527,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -527,8 +527,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -582,7 +582,7 @@ index 7357319e9186c9ffd878268ed9c1f4846ceb3ea9..91bd27148f5b699b72d56844ded76e0e
|
|||||||
|
|
||||||
if ((i & 1) != 0) {
|
if ((i & 1) != 0) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 164df6e9a91d9fbdbf6e4b835ea1946d81f3be55..a088cb005525fda2c9d5521ab3bac43cfa38a393 100644
|
index fbb82d344f654b90809582916442c520f344aa39..750895bed591c9f15cd2ea2d8f0611864782c912 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -33,7 +33,10 @@ import net.minecraft.core.Registry;
|
@@ -33,7 +33,10 @@ import net.minecraft.core.Registry;
|
||||||
|
@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the
|
|||||||
heightmap resolves the issue without having to load all spawn chunks.
|
heightmap resolves the issue without having to load all spawn chunks.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index fe2535aa505232df1b6c5a71e463c5c0004b4de6..6084222c0f46534c4cba81fa32478a467114cceb 100644
|
index c64155d9da55db0745a8f37de01f8b28739692c2..80bf2f5e7390bf586b0eab4bac796d32158e1f3f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -3004,6 +3004,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -3002,6 +3002,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
BlockPos blockposition1;
|
BlockPos blockposition1;
|
||||||
|
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
|
@ -14,10 +14,10 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
|
|||||||
Combined, this adds up a lot.
|
Combined, this adds up a lot.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 91bd27148f5b699b72d56844ded76e0e25e2693c..a4f446eff2a9e7f8ab99b156d0efe45d60e6c575 100644
|
index d58a7adb58abc91f66fc893ee7a7a7bded3619a8..af1cee79e27667b78413760286f517c91d1517cb 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -991,7 +991,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -990,7 +990,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ index f2e4939c8144b9bc7441130302ab3e2358c42063..3d14a7dbcc6bc46141596a7e04f790bf
|
|||||||
private void lightQueueSize() {
|
private void lightQueueSize() {
|
||||||
lightQueueSize = getInt("light-queue-size", lightQueueSize);
|
lightQueueSize = getInt("light-queue-size", lightQueueSize);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 6084222c0f46534c4cba81fa32478a467114cceb..7e314890b52621f18ff697a545e3e289a0c0d989 100644
|
index 80bf2f5e7390bf586b0eab4bac796d32158e1f3f..d7a4fd6ce9d35500a7c6a21b456f5f0a075e43e8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -328,6 +328,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -328,6 +328,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@ -32,7 +32,7 @@ index 6084222c0f46534c4cba81fa32478a467114cceb..7e314890b52621f18ff697a545e3e289
|
|||||||
protected int numCollisions = 0; // Paper
|
protected int numCollisions = 0; // Paper
|
||||||
public void inactiveTick() { }
|
public void inactiveTick() { }
|
||||||
// Spigot end
|
// Spigot end
|
||||||
@@ -1882,6 +1883,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1881,6 +1882,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
if (spawnedViaMobSpawner) {
|
if (spawnedViaMobSpawner) {
|
||||||
nbt.putBoolean("Paper.FromMobSpawner", true);
|
nbt.putBoolean("Paper.FromMobSpawner", true);
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ index 6084222c0f46534c4cba81fa32478a467114cceb..7e314890b52621f18ff697a545e3e289
|
|||||||
// Paper end
|
// Paper end
|
||||||
return nbt;
|
return nbt;
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@@ -2021,6 +2025,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2020,6 +2024,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
||||||
|
@ -889,7 +889,7 @@ index 0000000000000000000000000000000000000000..118988c39e58f28e8a2851792b9c014f
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index 5ff96851e7f7c51c365dde0d24da49be6412ab82..55f355d1218ddb3f320752666407151291c0f398 100644
|
index edf0432967c4621e101611924c4ce826f54e3e34..413743bc1bf82c07f85192924e4783b08dbcee79 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -86,6 +86,19 @@ public class ChunkHolder {
|
@@ -86,6 +86,19 @@ public class ChunkHolder {
|
||||||
@ -912,7 +912,7 @@ index 5ff96851e7f7c51c365dde0d24da49be6412ab82..55f355d1218ddb3f3207526664071512
|
|||||||
|
|
||||||
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
||||||
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
||||||
@@ -547,6 +560,10 @@ public class ChunkHolder {
|
@@ -544,6 +557,10 @@ public class ChunkHolder {
|
||||||
either.ifLeft(chunk -> {
|
either.ifLeft(chunk -> {
|
||||||
// note: Here is a very good place to add callbacks to logic waiting on this.
|
// note: Here is a very good place to add callbacks to logic waiting on this.
|
||||||
ChunkHolder.this.isTickingReady = true;
|
ChunkHolder.this.isTickingReady = true;
|
||||||
@ -924,7 +924,7 @@ index 5ff96851e7f7c51c365dde0d24da49be6412ab82..55f355d1218ddb3f3207526664071512
|
|||||||
});
|
});
|
||||||
// Paper end
|
// Paper end
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 77f88e081991e85d03540e30b9def5dac9ad59be..43007f8cc9a88d7e6fb435551edac4d93a5668a9 100644
|
index d2d0350bd16cd818be328afcc2c07f4381dac169..0d948d4d247a12a49fae99e68874a9e65bf76a68 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -220,6 +220,12 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -220,6 +220,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
|
@ -26,7 +26,7 @@ index 2730923bd0bf3b0f928765b9e09e2299fa9a393d..f98a1c32e0c209473cf7268cbd8245ab
|
|||||||
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 7e314890b52621f18ff697a545e3e289a0c0d989..fa63a52cba5355612ce417f4bb8077a89ce59398 100644
|
index d7a4fd6ce9d35500a7c6a21b456f5f0a075e43e8..1a3d6368b84aa24b6d0361dd30bc06b79f1d5133 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -172,6 +172,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -172,6 +172,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@ -52,7 +52,7 @@ index b980c26ab5cac02e03525177a9dc4fb0b6a2f9f6..2a784a8342e708e0813c7076a2ca8e42
|
|||||||
|
|
||||||
Stream<VoxelShape> getEntityCollisions(@Nullable Entity entity, AABB box, Predicate<Entity> predicate);
|
Stream<VoxelShape> getEntityCollisions(@Nullable Entity entity, AABB box, Predicate<Entity> predicate);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
diff --git a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
||||||
index e6190bfb893de12e87e1da49001ebd963b3d6318..7f8a914085e3d89668e8f41fd099e3b77867f03e 100644
|
index e6190bfb893de12e87e1da49001ebd963b3d6318..6f4acf1c7c98a6069b79db483b8c79a8f4b46d54 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
--- a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
+++ b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
||||||
@@ -64,21 +64,35 @@ public class CollisionSpliterator extends AbstractSpliterator<VoxelShape> {
|
@@ -64,21 +64,35 @@ public class CollisionSpliterator extends AbstractSpliterator<VoxelShape> {
|
||||||
@ -74,7 +74,7 @@ index e6190bfb893de12e87e1da49001ebd963b3d6318..7f8a914085e3d89668e8f41fd099e3b7
|
|||||||
- if (blockGetter == null) {
|
- if (blockGetter == null) {
|
||||||
+ // Paper start - ensure we don't load chunks
|
+ // Paper start - ensure we don't load chunks
|
||||||
+ boolean far = this.source != null && net.minecraft.server.MCUtil.distanceSq(this.source.getX(), y, this.source.getZ(), x, y, z) > 14;
|
+ boolean far = this.source != null && net.minecraft.server.MCUtil.distanceSq(this.source.getX(), y, this.source.getZ(), x, y, z) > 14;
|
||||||
+ this.pos.setValues(x, y, z);
|
+ this.pos.set(x, y, z);
|
||||||
+
|
+
|
||||||
+ boolean isRegionLimited = this.collisionGetter instanceof net.minecraft.server.level.WorldGenRegion;
|
+ boolean isRegionLimited = this.collisionGetter instanceof net.minecraft.server.level.WorldGenRegion;
|
||||||
+ BlockState blockState = isRegionLimited ? Blocks.VOID_AIR.defaultBlockState() : ((!far && this.source instanceof net.minecraft.server.level.ServerPlayer) || (this.source != null && this.source.collisionLoadChunks)
|
+ BlockState blockState = isRegionLimited ? Blocks.VOID_AIR.defaultBlockState() : ((!far && this.source instanceof net.minecraft.server.level.ServerPlayer) || (this.source != null && this.source.collisionLoadChunks)
|
||||||
@ -99,10 +99,10 @@ index e6190bfb893de12e87e1da49001ebd963b3d6318..7f8a914085e3d89668e8f41fd099e3b7
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
index 5d4d953f197afc402248ab73daeb6ef59134f48f..95428f13dae909bb7de552aa65e4256bd4049c65 100644
|
index 5af90e0f7222356cb0e905a9b6e0c4eac5617a41..ee5fa14d2232b145806aefcaffb5c6348a08058a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
@@ -238,7 +238,8 @@ public final class Shapes {
|
@@ -237,7 +237,8 @@ public final class Shapes {
|
||||||
|
|
||||||
if (s < 3) {
|
if (s < 3) {
|
||||||
mutableBlockPos.set(axisCycle, q, r, p);
|
mutableBlockPos.set(axisCycle, q, r, p);
|
||||||
|
@ -71,7 +71,7 @@ index bda7137b3435c9b7610be258cefb6b4ac2c1d47a..09f56e49383d3f5413ad4c28f3a7664e
|
|||||||
cause = cause.getCause();
|
cause = cause.getCause();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 577681733454da4d62cae7199f494a56bab3cfa4..ff17bd6e7ccd82201256a2c3568297c3191b7e1f 100644
|
index 44ad235710dce2b159f891d91b7a0d71e5553507..eb82dd9db7fef4b1f0f764ce153439c69c64168b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -301,7 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -301,7 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -262,7 +262,7 @@ index 0511f1921193b78cbf4d8426136bf1f79746f955..e5f7f043cbdb28d85b8aa0eea7cbaeb5
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 22f6898b96c68fa53ca5900985c18a6f2f5a8b57..538bb603b1a516f33bbe8c4e1974efc902c4bc85 100644
|
index 0aef7208937a4d35212186418beff1daf38c7a96..7aac9509849b9fb8d640437487fbfa0085b76613 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -611,6 +611,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -611,6 +611,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@ -299,10 +299,10 @@ index 7bf4bf5cb2c1b54a7e2733091f48f3a824336d36..dcce05d2f4ab16424db4ab103a12188e
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index a4f446eff2a9e7f8ab99b156d0efe45d60e6c575..738656ea69dc3c3d84f5be4799fc48e837e52ea3 100644
|
index af1cee79e27667b78413760286f517c91d1517cb..c84070d05d325a8f49c3918cc112087b9c1074e9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -844,6 +844,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -843,6 +843,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
try {
|
try {
|
||||||
tickConsumer.accept(entity);
|
tickConsumer.accept(entity);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@ -311,7 +311,7 @@ index a4f446eff2a9e7f8ab99b156d0efe45d60e6c575..738656ea69dc3c3d84f5be4799fc48e8
|
|||||||
String msg = "Entity threw exception at " + entity.level.getWorld().getName() + ":" + entity.getX() + "," + entity.getY() + "," + entity.getZ();
|
String msg = "Entity threw exception at " + entity.level.getWorld().getName() + ":" + entity.getX() + "," + entity.getY() + "," + entity.getZ();
|
||||||
System.err.println(msg);
|
System.err.println(msg);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 085914b552583f54d0eb0eb5f1e4ac2146c5225c..cc72c5c7e63794974080648abc94646819ea0924 100644
|
index e19f5d5d58a8b2e4f35907e1c88224cac7f20e57..61c70e17401ec85c0a7e6e1793f6689506b8059a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -1319,6 +1319,7 @@ public class LevelChunk implements ChunkAccess {
|
@@ -1319,6 +1319,7 @@ public class LevelChunk implements ChunkAccess {
|
||||||
|
@ -7,7 +7,7 @@ Prevents pathfinding from spamming failures for things such as
|
|||||||
arrow attacks.
|
arrow attacks.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
index 289494db53d368d56f1abd34abad8ce57e4694b1..9bf3ecfd8267bd4e49bf13fc16fc6d59e4986d10 100644
|
index 98953769a4418385971651e43e2ff6f4ea1ec638..e605daac0c90f5d0b9315d1499938feb0e478d0e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||||
@@ -190,9 +190,29 @@ public abstract class PathNavigation {
|
@@ -190,9 +190,29 @@ public abstract class PathNavigation {
|
||||||
@ -40,4 +40,4 @@ index 289494db53d368d56f1abd34abad8ce57e4694b1..9bf3ecfd8267bd4e49bf13fc16fc6d59
|
|||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated public boolean setDestination(@Nullable Path pathentity, double speed) { return moveTo(pathentity, speed); } // Paper - OBFHELPER
|
public boolean moveTo(@Nullable Path path, double speed) {
|
||||||
|
@ -8,7 +8,7 @@ is important because we clone chunk data after reading it for safety.
|
|||||||
So, reduce the impact of the clone on GC.
|
So, reduce the impact of the clone on GC.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
index 750df4ab2fbfdcf759f4d3451340e66b6764391d..1aa3af8c7714b2c850fb4264c863db8e639e6284 100644
|
index e59475b7bb3e000afece0033c5d3f112d643c4f2..5456387ade8932fb0d9804abe0fd66f1c565e1ae 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
@@ -34,7 +34,7 @@ public class CompoundTag implements Tag {
|
@@ -34,7 +34,7 @@ public class CompoundTag implements Tag {
|
||||||
@ -29,7 +29,7 @@ index 750df4ab2fbfdcf759f4d3451340e66b6764391d..1aa3af8c7714b2c850fb4264c863db8e
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -374,8 +374,16 @@ public class CompoundTag implements Tag {
|
@@ -373,8 +373,16 @@ public class CompoundTag implements Tag {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag copy() {
|
public CompoundTag copy() {
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks for Login Asynchronously
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 05e520165a86eb52e1fd4130b6f2ccc4c838934a..04260e1e8cf17d2af06504fae949958b91c86bef 100644
|
index 7886ba1c08f3bc7cb889a430419d4ddb14bda787..b05598c2234cef011aef496829dfe54a69d58900 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -172,6 +172,7 @@ public class ServerPlayer extends Player {
|
@@ -172,6 +172,7 @@ public class ServerPlayer extends Player {
|
||||||
@ -74,7 +74,7 @@ index fae06882217adf20c6f81db2793ee3930cba30c0..c57b5cf7d61eab5a45e3fa69e8804fd0
|
|||||||
this.server.getProfiler().push("keepAlive");
|
this.server.getProfiler().push("keepAlive");
|
||||||
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
|
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
index 477117affabfe07d52d3b40404613492b0bcdc56..3a7cc4f8ee62c8ff726ecf3e669c9f9ba5651487 100644
|
index 12f945e91827470a9a61951e45c062deee8cf281..195f5d1519c3fc2fdd03ecd0d49d7fba74037692 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
@@ -88,7 +88,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
@@ -88,7 +88,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||||
@ -96,7 +96,7 @@ index 477117affabfe07d52d3b40404613492b0bcdc56..3a7cc4f8ee62c8ff726ecf3e669c9f9b
|
|||||||
try {
|
try {
|
||||||
ServerPlayer entityplayer1 = this.server.getPlayerList().processLogin(this.gameProfile, s); // CraftBukkit - add player reference
|
ServerPlayer entityplayer1 = this.server.getPlayerList().processLogin(this.gameProfile, s); // CraftBukkit - add player reference
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..846b0dcee92f71d1c887ea88744c36f6a870c5e2 100644
|
index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..529fc8732b67a3349672224723725e38925f8f09 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -38,6 +38,7 @@ import net.minecraft.network.protocol.Packet;
|
@@ -38,6 +38,7 @@ import net.minecraft.network.protocol.Packet;
|
||||||
@ -152,7 +152,7 @@ index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..846b0dcee92f71d1c887ea88744c36f6
|
|||||||
+ worldserver1.getChunkSource().getChunkAtAsynchronously(chunkX, chunkZ, true, true).thenApply(chunk -> {
|
+ worldserver1.getChunkSource().getChunkAtAsynchronously(chunkX, chunkZ, true, true).thenApply(chunk -> {
|
||||||
+ net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pos.toLong());
|
+ net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pos.toLong());
|
||||||
+ if (updatingChunk != null) {
|
+ if (updatingChunk != null) {
|
||||||
+ return updatingChunk.getEntityTickingFuture();
|
+ return updatingChunk.getEntityTickingChunkFuture();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return java.util.concurrent.CompletableFuture.completedFuture(chunk);
|
+ return java.util.concurrent.CompletableFuture.completedFuture(chunk);
|
||||||
+ }
|
+ }
|
||||||
@ -244,7 +244,7 @@ index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..846b0dcee92f71d1c887ea88744c36f6
|
|||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index fa63a52cba5355612ce417f4bb8077a89ce59398..32323729f913d27170fca0e69346e8d2943089af 100644
|
index 1a3d6368b84aa24b6d0361dd30bc06b79f1d5133..4d2209baf88a3f097e0df1645f88d4afd718c414 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1511,7 +1511,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1511,7 +1511,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
@ -7,10 +7,10 @@ The code following this has better support for null worlds to move
|
|||||||
them back to the world spawn.
|
them back to the world spawn.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 32323729f913d27170fca0e69346e8d2943089af..6bc6800f8ec3900b552c5da910db577649f5d9e0 100644
|
index 4d2209baf88a3f097e0df1645f88d4afd718c414..f08c8212f7a07fd10da127c65d4cea76921585e4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2000,9 +2000,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1999,9 +1999,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
bworld = server.getWorld(worldName);
|
bworld = server.getWorld(worldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the
|
|||||||
same item twice because the source was destroyed.
|
same item twice because the source was destroyed.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 6bc6800f8ec3900b552c5da910db577649f5d9e0..677124d720105e9bda9d05a1fcc46ce10f44539d 100644
|
index f08c8212f7a07fd10da127c65d4cea76921585e4..1307a37848fcf98cfd7ed19a7b746ba57ac88411 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2147,11 +2147,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2146,11 +2146,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
} else {
|
} else {
|
||||||
// CraftBukkit start - Capture drops for death event
|
// CraftBukkit start - Capture drops for death event
|
||||||
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
|
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
|
||||||
@ -34,7 +34,7 @@ index 6bc6800f8ec3900b552c5da910db577649f5d9e0..677124d720105e9bda9d05a1fcc46ce1
|
|||||||
|
|
||||||
entityitem.setDefaultPickUpDelay();
|
entityitem.setDefaultPickUpDelay();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -2894,6 +2895,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2892,6 +2893,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@Nullable
|
@Nullable
|
||||||
public Entity teleportTo(ServerLevel worldserver, BlockPos location) {
|
public Entity teleportTo(ServerLevel worldserver, BlockPos location) {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@ -47,7 +47,7 @@ index 6bc6800f8ec3900b552c5da910db577649f5d9e0..677124d720105e9bda9d05a1fcc46ce1
|
|||||||
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
||||||
this.level.getProfiler().push("changeDimension");
|
this.level.getProfiler().push("changeDimension");
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -2914,6 +2921,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2912,6 +2919,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.level.getProfiler().popPush("reloading");
|
this.level.getProfiler().popPush("reloading");
|
||||||
@ -59,7 +59,7 @@ index 6bc6800f8ec3900b552c5da910db577649f5d9e0..677124d720105e9bda9d05a1fcc46ce1
|
|||||||
Entity entity = this.getType().create((Level) worldserver);
|
Entity entity = this.getType().create((Level) worldserver);
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
@@ -2927,10 +2939,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2925,10 +2937,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
// CraftBukkit start - Forward the CraftEntity to the new entity
|
// CraftBukkit start - Forward the CraftEntity to the new entity
|
||||||
this.getBukkitEntity().setHandle(entity);
|
this.getBukkitEntity().setHandle(entity);
|
||||||
entity.bukkitEntity = this.getBukkitEntity();
|
entity.bukkitEntity = this.getBukkitEntity();
|
||||||
@ -70,7 +70,7 @@ index 6bc6800f8ec3900b552c5da910db577649f5d9e0..677124d720105e9bda9d05a1fcc46ce1
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3055,7 +3063,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -3053,7 +3061,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canChangeDimensions() {
|
public boolean canChangeDimensions() {
|
||||||
|
@ -68,10 +68,10 @@ index 9e0afab2329e560c4b2512548dd4b02dd1a2e69f..06662dbff8180751a8684841aa35f709
|
|||||||
this.firstIndices = new int[k];
|
this.firstIndices = new int[k];
|
||||||
this.secondIndices = new int[k];
|
this.secondIndices = new int[k];
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
index 95428f13dae909bb7de552aa65e4256bd4049c65..94f58332bb1408971fe65e5fd0401457ab986441 100644
|
index ee5fa14d2232b145806aefcaffb5c6348a08058a..18eeb49a4859a8ab9cbef97caf63c0639bc63233 100644
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
@@ -337,9 +337,21 @@ public final class Shapes {
|
@@ -336,9 +336,21 @@ public final class Shapes {
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@ -94,7 +94,7 @@ index 95428f13dae909bb7de552aa65e4256bd4049c65..94f58332bb1408971fe65e5fd0401457
|
|||||||
if (first instanceof CubePointRange && second instanceof CubePointRange) {
|
if (first instanceof CubePointRange && second instanceof CubePointRange) {
|
||||||
long l = lcm(i, j);
|
long l = lcm(i, j);
|
||||||
if ((long)size * l <= 256L) {
|
if ((long)size * l <= 256L) {
|
||||||
@@ -347,13 +359,22 @@ public final class Shapes {
|
@@ -346,13 +358,22 @@ public final class Shapes {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ index cdf214fca3b0055efa56702470d9d2f890a8aead..a12af10e28f2d023ba6f916b5e7a5353
|
|||||||
|
|
||||||
this.level.getProfiler().push("explosion_blocks");
|
this.level.getProfiler().push("explosion_blocks");
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 738656ea69dc3c3d84f5be4799fc48e837e52ea3..ce5bccd6d76252309e16b946c44674f4cf74450d 100644
|
index c84070d05d325a8f49c3918cc112087b9c1074e9..81c107edb59b2068bdc78617a5ca54aa15f15c0f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -424,6 +424,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -424,6 +424,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -95,7 +95,7 @@ index 27016f964d2f6458298a9052d031a44b3d9f5f4b..878cdfc49253e7916d038495f79fec7c
|
|||||||
public co.aikar.timings.Timing getTiming() {
|
public co.aikar.timings.Timing getTiming() {
|
||||||
if (timing == null) {
|
if (timing == null) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
index c345bd7542f3ffa09719864887e1516f1182e7e3..44cc09006eac6315d167a2628857f9942eb1fc13 100644
|
index c345bd7542f3ffa09719864887e1516f1182e7e3..4eac07022a7d896ee8921afa6d35cba7f0c89941 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
@@ -200,6 +200,12 @@ public class PistonBaseBlock extends DirectionalBlock {
|
@@ -200,6 +200,12 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||||
@ -128,7 +128,7 @@ index c345bd7542f3ffa09719864887e1516f1182e7e3..44cc09006eac6315d167a2628857f994
|
|||||||
+ // Paper start - fix headless pistons breaking blocks
|
+ // Paper start - fix headless pistons breaking blocks
|
||||||
+ BlockPos headPos = pos.relative(enumdirection);
|
+ BlockPos headPos = pos.relative(enumdirection);
|
||||||
+ if (com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits || world.getBlockState(headPos) == Blocks.PISTON_HEAD.defaultBlockState().setValue(FACING, enumdirection)) { // double check to make sure we're not a headless piston.
|
+ if (com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits || world.getBlockState(headPos) == Blocks.PISTON_HEAD.defaultBlockState().setValue(FACING, enumdirection)) { // double check to make sure we're not a headless piston.
|
||||||
+ world.setAir(headPos, false);
|
+ world.removeBlock(headPos, false);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ ((ServerLevel)world).getChunkSource().blockChanged(headPos); // ... fix client desync
|
+ ((ServerLevel)world).getChunkSource().blockChanged(headPos); // ... fix client desync
|
||||||
+ }
|
+ }
|
||||||
@ -137,7 +137,7 @@ index c345bd7542f3ffa09719864887e1516f1182e7e3..44cc09006eac6315d167a2628857f994
|
|||||||
|
|
||||||
world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
|
world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
index d99ca942f5885b4d9af054547832c05ddb5634eb..6d4ef15842c6bd230543de19dd1053a4fe6ad270 100644
|
index 6a3b6611954e07760d586e2dc8c2015cfae7c0a5..736e38a6ee3dc36ed886d047484bda9516845324 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
@@ -206,7 +206,7 @@ public abstract class BlockBehaviour {
|
@@ -206,7 +206,7 @@ public abstract class BlockBehaviour {
|
||||||
|
@ -31,7 +31,7 @@ index 9e5810eb0085ad956f0bd1cd69fa88909d9d638a..77e90a6b7d29ad989fd961e00a6fd97c
|
|||||||
config.addDefault("world-settings.default." + path, def);
|
config.addDefault("world-settings.default." + path, def);
|
||||||
return config.getBoolean("world-settings." + worldName + "." + path, config.getBoolean("world-settings.default." + path));
|
return config.getBoolean("world-settings." + worldName + "." + path, config.getBoolean("world-settings.default." + path));
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 0e6ec02b011eee8c75ddc6f7db254df735be8e91..a465baa097339a5f661c2c331cbd3cbe854e53b2 100644
|
index 407f18a9c7a688eaac8ad7018ae4f1a5fc628379..9f80206f966689b79df4e3b9b82ef9f4d2170bfe 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -300,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -300,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -72,7 +72,7 @@ index 0e6ec02b011eee8c75ddc6f7db254df735be8e91..a465baa097339a5f661c2c331cbd3cbe
|
|||||||
this.profiler.push("snooper");
|
this.profiler.push("snooper");
|
||||||
if (((DedicatedServer) this).getProperties().snooperEnabled && !this.snooper.isStarted() && this.tickCount > 100) { // Spigot
|
if (((DedicatedServer) this).getProperties().snooperEnabled && !this.snooper.isStarted() && this.tickCount > 100) { // Spigot
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index 948a817a1d6f4435655931357aa094b889771e82..88c7ae09e29a32309bf2a63ac0593b42d3fe6a42 100644
|
index 38b624e5817f5b2ce70da777b2bb834784de914f..87319eadeba490bdfd0783cacd33e3ec1dcba302 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -111,6 +111,8 @@ public class ChunkHolder {
|
@@ -111,6 +111,8 @@ public class ChunkHolder {
|
||||||
@ -84,7 +84,7 @@ index 948a817a1d6f4435655931357aa094b889771e82..88c7ae09e29a32309bf2a63ac0593b42
|
|||||||
|
|
||||||
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
||||||
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
||||||
@@ -533,7 +535,19 @@ public class ChunkHolder {
|
@@ -530,7 +532,19 @@ public class ChunkHolder {
|
||||||
boolean flag2 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.BORDER);
|
boolean flag2 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.BORDER);
|
||||||
boolean flag3 = playerchunk_state1.isOrAfter(ChunkHolder.FullChunkStatus.BORDER);
|
boolean flag3 = playerchunk_state1.isOrAfter(ChunkHolder.FullChunkStatus.BORDER);
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ index 948a817a1d6f4435655931357aa094b889771e82..88c7ae09e29a32309bf2a63ac0593b42
|
|||||||
if (!flag2 && flag3) {
|
if (!flag2 && flag3) {
|
||||||
int expectCreateCount = ++this.fullChunkCreateCount; // Paper
|
int expectCreateCount = ++this.fullChunkCreateCount; // Paper
|
||||||
this.fullChunkFuture = chunkStorage.prepareAccessibleChunk(this);
|
this.fullChunkFuture = chunkStorage.prepareAccessibleChunk(this);
|
||||||
@@ -654,9 +668,33 @@ public class ChunkHolder {
|
@@ -651,9 +665,33 @@ public class ChunkHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshAccessibility() {
|
public void refreshAccessibility() {
|
||||||
@ -139,7 +139,7 @@ index 948a817a1d6f4435655931357aa094b889771e82..88c7ae09e29a32309bf2a63ac0593b42
|
|||||||
for (int i = 0; i < this.futures.length(); ++i) {
|
for (int i = 0; i < this.futures.length(); ++i) {
|
||||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(i);
|
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(i);
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 0b2329d9ab2040e0793c7920307474c347c3117e..3464593f1c1af6c6b36549496bc85f2e51655ccf 100644
|
index 36a9c0e442aa811dd85cede375640e0610197aa6..8d97e0a38a1cf6fcbc458654e2e85a8eb6033dd9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -97,6 +97,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
|
@@ -97,6 +97,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
|
||||||
@ -240,7 +240,7 @@ index 0b2329d9ab2040e0793c7920307474c347c3117e..3464593f1c1af6c6b36549496bc85f2e
|
|||||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 135d162a926bd258d2aa001b7d0ef880fd3f2fb9..334f1ad2a5ce236b58a82b1ef2e143eaa3909f12 100644
|
index 147f6fd5174a2c489dfb7ea2ce2d2dc7dacfb89d..6c565751c36daa0084196dce5d2f82df64a0c77a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -672,6 +672,15 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -672,6 +672,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@ -314,7 +314,7 @@ index a857953f3488e79fd601ac63881bc4d87708afa7..3cf3b0486f786d7d043cce75767753e1
|
|||||||
default boolean generateFlatBedrock() {
|
default boolean generateFlatBedrock() {
|
||||||
if (this instanceof ProtoChunk) {
|
if (this instanceof ProtoChunk) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index cc72c5c7e63794974080648abc94646819ea0924..199efaefef890d2695682cc695b02c6ca3f971e2 100644
|
index 61c70e17401ec85c0a7e6e1793f6689506b8059a..d866997b974b971245111cac43ac6edf92052de4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -108,6 +108,13 @@ public class LevelChunk implements ChunkAccess {
|
@@ -108,6 +108,13 @@ public class LevelChunk implements ChunkAccess {
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index fe4b09f82d36e5d7e109c86e8f4c003e92ba4e9d..8aeb00440e90f3f72d5c6fde35b4067ebc452f2f 100644
|
index 40fe3766bfe06fe15d258d3fc88fb179d2bb5d05..dcc128fdf45b23fe07a20136f498ead2ac6ee4a7 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -560,7 +560,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -560,7 +560,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@ -17,7 +17,7 @@ index fe4b09f82d36e5d7e109c86e8f4c003e92ba4e9d..8aeb00440e90f3f72d5c6fde35b4067e
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected AABB makeBoundingBox() {
|
protected AABB makeBoundingBox() {
|
||||||
@@ -3737,6 +3737,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -3735,6 +3735,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setPosRaw(double x, double y, double z) {
|
public final void setPosRaw(double x, double y, double z) {
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Optimize WorldBorder collision checks and air
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 8aeb00440e90f3f72d5c6fde35b4067ebc452f2f..7bfd4d85f5af889f6d6e13087331af12ea141238 100644
|
index dcc128fdf45b23fe07a20136f498ead2ac6ee4a7..895c4d0f8f6b829de426543c51181a88a1fd340f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1044,7 +1044,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1044,7 +1044,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@ -18,7 +18,7 @@ index 8aeb00440e90f3f72d5c6fde35b4067ebc452f2f..7bfd4d85f5af889f6d6e13087331af12
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
diff --git a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
||||||
index 7f8a914085e3d89668e8f41fd099e3b77867f03e..b7ba467d0a0c59e64cd5c1d562414b1dcc3e7df8 100644
|
index 6f4acf1c7c98a6069b79db483b8c79a8f4b46d54..e420c98d9ccc45d570984dc30fdb928883edec9f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
--- a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
+++ b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java
|
||||||
@@ -133,9 +133,10 @@ public class CollisionSpliterator extends AbstractSpliterator<VoxelShape> {
|
@@ -133,9 +133,10 @@ public class CollisionSpliterator extends AbstractSpliterator<VoxelShape> {
|
||||||
@ -36,10 +36,10 @@ index 7f8a914085e3d89668e8f41fd099e3b77867f03e..b7ba467d0a0c59e64cd5c1d562414b1d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
index 94f58332bb1408971fe65e5fd0401457ab986441..ceeec68fba8dacdc5b023c8817a6863b28c0e132 100644
|
index 18eeb49a4859a8ab9cbef97caf63c0639bc63233..16bc18cacbf7a23fb744c8a12e7fd8da699b2fea 100644
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
@@ -240,7 +240,7 @@ public final class Shapes {
|
@@ -239,7 +239,7 @@ public final class Shapes {
|
||||||
mutableBlockPos.set(axisCycle, q, r, p);
|
mutableBlockPos.set(axisCycle, q, r, p);
|
||||||
BlockState blockState = world.getTypeIfLoaded(mutableBlockPos); // Paper
|
BlockState blockState = world.getTypeIfLoaded(mutableBlockPos); // Paper
|
||||||
if (blockState == null) return 0.0D; // Paper
|
if (blockState == null) return 0.0D; // Paper
|
||||||
|
@ -8,12 +8,12 @@ We have stored UUID in plenty of places that did not get DFU'd
|
|||||||
So just look for old format and load it if it exists.
|
So just look for old format and load it if it exists.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
index c25d605e7cd59ffd69d60d53c145c531e092cdb3..cb2a9b262a918b9c410fcfd9d25e85109dbb1ba0 100644
|
index 5456387ade8932fb0d9804abe0fd66f1c565e1ae..7199be3b9c00c66f452e92ad35795017112f1658 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||||
@@ -121,6 +121,12 @@ public class CompoundTag implements Tag {
|
@@ -120,6 +120,12 @@ public class CompoundTag implements Tag {
|
||||||
|
}
|
||||||
|
|
||||||
@Deprecated public void setUUID(String prefix, UUID uuid) { putUUID(prefix, uuid); } // Paper - OBFHELPER
|
|
||||||
public void putUUID(String key, UUID value) {
|
public void putUUID(String key, UUID value) {
|
||||||
+ // Paper start - support old format
|
+ // Paper start - support old format
|
||||||
+ if (this.contains(key + "Most", 99) && this.contains(key + "Least", 99)) {
|
+ if (this.contains(key + "Most", 99) && this.contains(key + "Least", 99)) {
|
||||||
@ -24,7 +24,7 @@ index c25d605e7cd59ffd69d60d53c145c531e092cdb3..cb2a9b262a918b9c410fcfd9d25e8510
|
|||||||
this.tags.put(key, NbtUtils.createUUID(value));
|
this.tags.put(key, NbtUtils.createUUID(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,10 +135,20 @@ public class CompoundTag implements Tag {
|
@@ -128,10 +134,20 @@ public class CompoundTag implements Tag {
|
||||||
* You must use {@link #hasUUID(String)} before or else it <b>will</b> throw an NPE.
|
* You must use {@link #hasUUID(String)} before or else it <b>will</b> throw an NPE.
|
||||||
*/
|
*/
|
||||||
public UUID getUUID(String key) {
|
public UUID getUUID(String key) {
|
||||||
|
@ -68,7 +68,7 @@ index 18ae2e2b339d357fbe0f6f2b18bc14c0dfe4c222..3b7ba9c755c82a6f086d5542d32b3567
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
index 4d82abf234f67af124dff3f726a6a2e39313a780..e2e01012b4a40bb2a63d780c50d7567b173d5e41 100644
|
index 2d5b8e35d52b0dfd075af81a3a936d8a21053b31..9ddedd310eb0323a5a09f51a61bfb7b36503be93 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
@@ -671,6 +671,7 @@ public final class MCUtil {
|
@@ -671,6 +671,7 @@ public final class MCUtil {
|
||||||
@ -80,7 +80,7 @@ index 4d82abf234f67af124dff3f726a6a2e39313a780..e2e01012b4a40bb2a63d780c50d7567b
|
|||||||
chunkData.addProperty("queued-for-unload", chunkMap.toDrop.contains(playerChunk.pos.longKey));
|
chunkData.addProperty("queued-for-unload", chunkMap.toDrop.contains(playerChunk.pos.longKey));
|
||||||
chunkData.addProperty("status", status == null ? "unloaded" : status.toString());
|
chunkData.addProperty("status", status == null ? "unloaded" : status.toString());
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index 88c7ae09e29a32309bf2a63ac0593b42d3fe6a42..914678af675be57fecc92189c709da971b8b0ae8 100644
|
index 87319eadeba490bdfd0783cacd33e3ec1dcba302..f9207e3661ba630ee1791d0842e0de684b22fd17 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -60,7 +60,7 @@ public class ChunkHolder {
|
@@ -60,7 +60,7 @@ public class ChunkHolder {
|
||||||
@ -235,7 +235,7 @@ index 88c7ae09e29a32309bf2a63ac0593b42d3fe6a42..914678af675be57fecc92189c709da97
|
|||||||
// Paper start - optimise isOutsideOfRange
|
// Paper start - optimise isOutsideOfRange
|
||||||
// cached here to avoid a map lookup
|
// cached here to avoid a map lookup
|
||||||
com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> playersInMobSpawnRange;
|
com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> playersInMobSpawnRange;
|
||||||
@@ -488,7 +617,7 @@ public class ChunkHolder {
|
@@ -485,7 +614,7 @@ public class ChunkHolder {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
// ChunkUnloadEvent: Called before the chunk is unloaded: isChunkLoaded is still true and chunk can still be modified by plugins.
|
// ChunkUnloadEvent: Called before the chunk is unloaded: isChunkLoaded is still true and chunk can still be modified by plugins.
|
||||||
if (playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.BORDER) && !playerchunk_state1.isOrAfter(ChunkHolder.FullChunkStatus.BORDER)) {
|
if (playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.BORDER) && !playerchunk_state1.isOrAfter(ChunkHolder.FullChunkStatus.BORDER)) {
|
||||||
@ -244,7 +244,7 @@ index 88c7ae09e29a32309bf2a63ac0593b42d3fe6a42..914678af675be57fecc92189c709da97
|
|||||||
LevelChunk chunk = (LevelChunk)either.left().orElse(null);
|
LevelChunk chunk = (LevelChunk)either.left().orElse(null);
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
chunkStorage.callbackExecutor.execute(() -> {
|
chunkStorage.callbackExecutor.execute(() -> {
|
||||||
@@ -553,13 +682,14 @@ public class ChunkHolder {
|
@@ -550,13 +679,14 @@ public class ChunkHolder {
|
||||||
this.fullChunkFuture = chunkStorage.prepareAccessibleChunk(this);
|
this.fullChunkFuture = chunkStorage.prepareAccessibleChunk(this);
|
||||||
this.scheduleFullChunkPromotion(chunkStorage, this.fullChunkFuture, executor, ChunkHolder.FullChunkStatus.BORDER);
|
this.scheduleFullChunkPromotion(chunkStorage, this.fullChunkFuture, executor, ChunkHolder.FullChunkStatus.BORDER);
|
||||||
// Paper start - cache ticking ready status
|
// Paper start - cache ticking ready status
|
||||||
@ -260,7 +260,7 @@ index 88c7ae09e29a32309bf2a63ac0593b42d3fe6a42..914678af675be57fecc92189c709da97
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.updateChunkToSave(this.fullChunkFuture, "full");
|
this.updateChunkToSave(this.fullChunkFuture, "full");
|
||||||
@@ -583,7 +713,7 @@ public class ChunkHolder {
|
@@ -580,7 +710,7 @@ public class ChunkHolder {
|
||||||
this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this);
|
this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this);
|
||||||
this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING);
|
this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING);
|
||||||
// Paper start - cache ticking ready status
|
// Paper start - cache ticking ready status
|
||||||
@ -269,7 +269,7 @@ index 88c7ae09e29a32309bf2a63ac0593b42d3fe6a42..914678af675be57fecc92189c709da97
|
|||||||
either.ifLeft(chunk -> {
|
either.ifLeft(chunk -> {
|
||||||
// note: Here is a very good place to add callbacks to logic waiting on this.
|
// note: Here is a very good place to add callbacks to logic waiting on this.
|
||||||
ChunkHolder.this.isTickingReady = true;
|
ChunkHolder.this.isTickingReady = true;
|
||||||
@@ -613,7 +743,7 @@ public class ChunkHolder {
|
@@ -610,7 +740,7 @@ public class ChunkHolder {
|
||||||
this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this.pos);
|
this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this.pos);
|
||||||
this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING);
|
this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING);
|
||||||
// Paper start - cache ticking ready status
|
// Paper start - cache ticking ready status
|
||||||
@ -278,7 +278,7 @@ index 88c7ae09e29a32309bf2a63ac0593b42d3fe6a42..914678af675be57fecc92189c709da97
|
|||||||
either.ifLeft(chunk -> {
|
either.ifLeft(chunk -> {
|
||||||
ChunkHolder.this.isEntityTickingReady = true;
|
ChunkHolder.this.isEntityTickingReady = true;
|
||||||
});
|
});
|
||||||
@@ -631,12 +761,30 @@ public class ChunkHolder {
|
@@ -628,12 +758,30 @@ public class ChunkHolder {
|
||||||
this.demoteFullChunk(chunkStorage, playerchunk_state1);
|
this.demoteFullChunk(chunkStorage, playerchunk_state1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ index 88c7ae09e29a32309bf2a63ac0593b42d3fe6a42..914678af675be57fecc92189c709da97
|
|||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
chunkStorage.callbackExecutor.execute(() -> {
|
chunkStorage.callbackExecutor.execute(() -> {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 3464593f1c1af6c6b36549496bc85f2e51655ccf..b92eaa44434e2ee368b90d43f322cb8601d159bb 100644
|
index 8d97e0a38a1cf6fcbc458654e2e85a8eb6033dd9..15dba7f2e6a7c670b415f67345fad37873a1130c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -149,6 +149,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -149,6 +149,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@ -427,7 +427,7 @@ index 3464593f1c1af6c6b36549496bc85f2e51655ccf..b92eaa44434e2ee368b90d43f322cb86
|
|||||||
+ // Prioritize circular near
|
+ // Prioritize circular near
|
||||||
+ double playerChunkX = Mth.floor(player.getX()) >> 4;
|
+ double playerChunkX = Mth.floor(player.getX()) >> 4;
|
||||||
+ double playerChunkZ = Mth.floor(player.getZ()) >> 4;
|
+ double playerChunkZ = Mth.floor(player.getZ()) >> 4;
|
||||||
+ pos.setValues(player.getX(), 0, player.getZ());
|
+ pos.set(player.getX(), 0, player.getZ());
|
||||||
+ double twoThirdModifier = 2D / 3D;
|
+ double twoThirdModifier = 2D / 3D;
|
||||||
+ MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance)).forEach(coord -> {
|
+ MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance)).forEach(coord -> {
|
||||||
+ if (shouldSkipPrioritization(coord)) return;
|
+ if (shouldSkipPrioritization(coord)) return;
|
||||||
@ -445,7 +445,7 @@ index 3464593f1c1af6c6b36549496bc85f2e51655ccf..b92eaa44434e2ee368b90d43f322cb86
|
|||||||
+
|
+
|
||||||
+ // Prioritize Frustum near 3
|
+ // Prioritize Frustum near 3
|
||||||
+ ChunkPos front3 = player.getChunkInFront(3);
|
+ ChunkPos front3 = player.getChunkInFront(3);
|
||||||
+ pos.setValues(front3.x << 4, 0, front3.z << 4);
|
+ pos.set(front3.x << 4, 0, front3.z << 4);
|
||||||
+ MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance)).forEach(coord -> {
|
+ MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance)).forEach(coord -> {
|
||||||
+ if (shouldSkipPrioritization(coord)) return;
|
+ if (shouldSkipPrioritization(coord)) return;
|
||||||
+
|
+
|
||||||
@ -456,7 +456,7 @@ index 3464593f1c1af6c6b36549496bc85f2e51655ccf..b92eaa44434e2ee368b90d43f322cb86
|
|||||||
+ // Prioritize Frustum near 5
|
+ // Prioritize Frustum near 5
|
||||||
+ if (viewDistance > 4) {
|
+ if (viewDistance > 4) {
|
||||||
+ ChunkPos front5 = player.getChunkInFront(5);
|
+ ChunkPos front5 = player.getChunkInFront(5);
|
||||||
+ pos.setValues(front5.x << 4, 0, front5.z << 4);
|
+ pos.set(front5.x << 4, 0, front5.z << 4);
|
||||||
+ MCUtil.getSpiralOutChunks(pos, 4).forEach(coord -> {
|
+ MCUtil.getSpiralOutChunks(pos, 4).forEach(coord -> {
|
||||||
+ if (shouldSkipPrioritization(coord)) return;
|
+ if (shouldSkipPrioritization(coord)) return;
|
||||||
+
|
+
|
||||||
@ -468,7 +468,7 @@ index 3464593f1c1af6c6b36549496bc85f2e51655ccf..b92eaa44434e2ee368b90d43f322cb86
|
|||||||
+ // Prioritize Frustum far 7
|
+ // Prioritize Frustum far 7
|
||||||
+ if (viewDistance > 6) {
|
+ if (viewDistance > 6) {
|
||||||
+ ChunkPos front7 = player.getChunkInFront(7);
|
+ ChunkPos front7 = player.getChunkInFront(7);
|
||||||
+ pos.setValues(front7.x << 4, 0, front7.z << 4);
|
+ pos.set(front7.x << 4, 0, front7.z << 4);
|
||||||
+ MCUtil.getSpiralOutChunks(pos, 3).forEach(coord -> {
|
+ MCUtil.getSpiralOutChunks(pos, 3).forEach(coord -> {
|
||||||
+ if (shouldSkipPrioritization(coord)) {
|
+ if (shouldSkipPrioritization(coord)) {
|
||||||
+ return;
|
+ return;
|
||||||
@ -559,7 +559,7 @@ index 3464593f1c1af6c6b36549496bc85f2e51655ccf..b92eaa44434e2ee368b90d43f322cb86
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||||
index d94241bcca4f2fd5e464a860bd356af504dc68b7..e82dcc43ae03c31e9e3ec31dbcfecfde64bd407a 100644
|
index d94241bcca4f2fd5e464a860bd356af504dc68b7..1cc4e0a1f3d8235ef88b48e01ca8b78a263d2676 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||||
@@ -98,6 +98,7 @@ public abstract class DistanceManager {
|
@@ -98,6 +98,7 @@ public abstract class DistanceManager {
|
||||||
@ -878,16 +878,16 @@ index d94241bcca4f2fd5e464a860bd356af504dc68b7..e82dcc43ae03c31e9e3ec31dbcfecfde
|
|||||||
+ ServerPlayer player = (ServerPlayer) backingSet[index];
|
+ ServerPlayer player = (ServerPlayer) backingSet[index];
|
||||||
+
|
+
|
||||||
+ ChunkPos pointInFront = player.getChunkInFront(5);
|
+ ChunkPos pointInFront = player.getChunkInFront(5);
|
||||||
+ pos.setValues(pointInFront.x << 4, 0, pointInFront.z << 4);
|
+ pos.set(pointInFront.x << 4, 0, pointInFront.z << 4);
|
||||||
+ double frontDist = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
+ double frontDist = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
||||||
+
|
+
|
||||||
+ pos.setValues(player.getX(), 0, player.getZ());
|
+ pos.set(player.getX(), 0, player.getZ());
|
||||||
+ double center = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
+ double center = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
||||||
+
|
+
|
||||||
+ double dist = Math.min(frontDist, center);
|
+ double dist = Math.min(frontDist, center);
|
||||||
+ if (!isFront) {
|
+ if (!isFront) {
|
||||||
+ ChunkPos pointInBack = player.getChunkInFront(-7);
|
+ ChunkPos pointInBack = player.getChunkInFront(-7);
|
||||||
+ pos.setValues(pointInBack.x << 4, 0, pointInBack.z << 4);
|
+ pos.set(pointInBack.x << 4, 0, pointInBack.z << 4);
|
||||||
+ double backDist = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
+ double backDist = net.minecraft.server.MCUtil.distanceSq(pos, blockPos);
|
||||||
+ if (frontDist < backDist) {
|
+ if (frontDist < backDist) {
|
||||||
+ isFront = true;
|
+ isFront = true;
|
||||||
@ -941,7 +941,7 @@ index d94241bcca4f2fd5e464a860bd356af504dc68b7..e82dcc43ae03c31e9e3ec31dbcfecfde
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 334f1ad2a5ce236b58a82b1ef2e143eaa3909f12..c0bbb1acd7d83a70c9f2c34f7d19cea0039e0567 100644
|
index 6c565751c36daa0084196dce5d2f82df64a0c77a..0b22fd8ac75146bc7b647cfbefc73ce890ccb033 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -446,6 +446,26 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -446,6 +446,26 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@ -1027,7 +1027,7 @@ index 334f1ad2a5ce236b58a82b1ef2e143eaa3909f12..c0bbb1acd7d83a70c9f2c34f7d19cea0
|
|||||||
boolean flag1 = this.chunkMap.promoteChunkMap();
|
boolean flag1 = this.chunkMap.promoteChunkMap();
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 384f38b3c7dd030f107991137912866ae045f811..29df08d378363d57508dc654a129c60bc38ad21b 100644
|
index 1197322df389f9fdc891760230e18950f7295fc1..6acf0fb29261ba005562127894438797d5853573 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -183,6 +183,14 @@ public class ServerPlayer extends Player {
|
@@ -183,6 +183,14 @@ public class ServerPlayer extends Player {
|
||||||
@ -1113,7 +1113,7 @@ index fb010fb253f490a79e9172d7a3d017ad51dac958..3e91275b318904ffa31183987fcbc7b2
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index 247d4959c67d41d2f4995c2e19f4c652e97694f5..f452cddd312793465dedb29c4e52d1c4dd1b4360 100644
|
index cd31cc4f8d25e95792c4a2690e3a8df17edc406f..576541b061d792a24eaa30df57d00a2945a3ee1f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -283,8 +283,8 @@ public abstract class PlayerList {
|
@@ -283,8 +283,8 @@ public abstract class PlayerList {
|
||||||
@ -1126,7 +1126,7 @@ index 247d4959c67d41d2f4995c2e19f4c652e97694f5..f452cddd312793465dedb29c4e52d1c4
|
|||||||
+ worldserver1.getChunkSource().getChunkAtAsynchronously(chunkX, chunkZ, true, false).thenApply(chunk -> { // Paper - Chunk priority
|
+ worldserver1.getChunkSource().getChunkAtAsynchronously(chunkX, chunkZ, true, false).thenApply(chunk -> { // Paper - Chunk priority
|
||||||
net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pos.toLong());
|
net.minecraft.server.level.ChunkHolder updatingChunk = playerChunkMap.getUpdatingChunkIfPresent(pos.toLong());
|
||||||
if (updatingChunk != null) {
|
if (updatingChunk != null) {
|
||||||
return updatingChunk.getEntityTickingFuture();
|
return updatingChunk.getEntityTickingChunkFuture();
|
||||||
@@ -697,6 +697,7 @@ public abstract class PlayerList {
|
@@ -697,6 +697,7 @@ public abstract class PlayerList {
|
||||||
SocketAddress socketaddress = loginlistener.connection.getRemoteAddress();
|
SocketAddress socketaddress = loginlistener.connection.getRemoteAddress();
|
||||||
|
|
||||||
@ -1144,7 +1144,7 @@ index 247d4959c67d41d2f4995c2e19f4c652e97694f5..f452cddd312793465dedb29c4e52d1c4
|
|||||||
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 2a0f72b98d025f1f140d9118937d41e7b172be60..0fd3d689b80484339f437525130bc34de2e71e54 100644
|
index c0f7b78dbe8f9baf68aa48dd763ab51312e916c6..73c81f0883645dca0ce32efae914d7f40b265c3c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -223,7 +223,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -223,7 +223,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
@ -22,7 +22,7 @@ index faa1b775e45563b93ac1d5b904938b1f5ad8d80c..545948f20efd6c8dd42140b565af94cd
|
|||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||||
index 7607bf75968cc32d616e2b44e89901b3681b1131..d32b96a5f51d745869cfc40c01c54de58e1eb843 100644
|
index 34c642a9439faec095c58c6017a0dfd4b35a2401..01b9c360c6d687c6a774bf3375802be487cb0e0c 100644
|
||||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||||
@@ -37,6 +37,7 @@ import net.minecraft.network.protocol.Packet;
|
@@ -37,6 +37,7 @@ import net.minecraft.network.protocol.Packet;
|
||||||
@ -49,7 +49,7 @@ index 7607bf75968cc32d616e2b44e89901b3681b1131..d32b96a5f51d745869cfc40c01c54de5
|
|||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
if (this.packetListener instanceof ServerLoginPacketListenerImpl) {
|
if (this.packetListener instanceof ServerLoginPacketListenerImpl) {
|
||||||
+ if ( ((ServerLoginPacketListenerImpl) this.packetListener).getLoginState() != ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT // Paper
|
+ if ( ((ServerLoginPacketListenerImpl) this.packetListener).state != ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT // Paper
|
||||||
+ || (joinAttemptsThisTick++ < MAX_PER_TICK)) { // Paper - limit the number of joins which can be processed each tick
|
+ || (joinAttemptsThisTick++ < MAX_PER_TICK)) { // Paper - limit the number of joins which can be processed each tick
|
||||||
((ServerLoginPacketListenerImpl) this.packetListener).tick();
|
((ServerLoginPacketListenerImpl) this.packetListener).tick();
|
||||||
+ } // Paper
|
+ } // Paper
|
||||||
|
@ -41,7 +41,7 @@ index 2252b9f36ea22a655592c6f176d18b70b7440e4e..8504f4dcfca35c8fe8e266af59762edd
|
|||||||
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..3728979e290ab031c9fe9eeb19a0f98d2ce566db
|
index 0000000000000000000000000000000000000000..d4273df8124d9d6d4a122f5ecef6f3d011da5860
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
+++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
||||||
@@ -0,0 +1,913 @@
|
@@ -0,0 +1,913 @@
|
||||||
@ -368,7 +368,7 @@ index 0000000000000000000000000000000000000000..3728979e290ab031c9fe9eeb19a0f98d
|
|||||||
+ if (!wire.canSurvive(null, worldIn, pos)) {
|
+ if (!wire.canSurvive(null, worldIn, pos)) {
|
||||||
+ // Pop off the redstone dust
|
+ // Pop off the redstone dust
|
||||||
+ Block.popResource(worldIn, pos, new ItemStack(Items.REDSTONE)); // TODO
|
+ Block.popResource(worldIn, pos, new ItemStack(Items.REDSTONE)); // TODO
|
||||||
+ worldIn.setAir(pos);
|
+ worldIn.removeBlock(pos, false);
|
||||||
+
|
+
|
||||||
+ // Mark this position as not being redstone wire
|
+ // Mark this position as not being redstone wire
|
||||||
+ upd1.type = UpdateNode.Type.OTHER;
|
+ upd1.type = UpdateNode.Type.OTHER;
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't mark dirty in invalid locations (SPIGOT-6086)
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index 779b230c18316242f4322d55b8b28900ca793dac..d51a639fe855d73293cdf322671a8ea643a29cd9 100644
|
index 2d81fce2f5d9320b4cc9310fd0428b96318c7237..84f179b5df2e7106913bd17e5f9e5fdd484bce10 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -382,6 +382,7 @@ public class ChunkHolder {
|
@@ -379,6 +379,7 @@ public class ChunkHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void blockChanged(BlockPos pos) {
|
public void blockChanged(BlockPos pos) {
|
||||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index b2e6426b9d8bcc860f83c3b79577bbc1cdb278db..c584868110ef03c721087cd7eaf454bded763477 100644
|
index 3bf989fe94d53088ae058c19adde652267a231d0..f4eb377c0a09dcb24d2d7e49aa0bc18c5817f073 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -3924,4 +3924,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -3922,4 +3922,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
|
||||||
void accept(Entity entity, double x, double y, double z);
|
void accept(Entity entity, double x, double y, double z);
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ index b2e6426b9d8bcc860f83c3b79577bbc1cdb278db..c584868110ef03c721087cd7eaf454bd
|
|||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
index 62b5070f9645fec91d016988f0f2262fd61e2e89..cd51115b7c56e7eeab1248f39a690fc91524efd7 100644
|
index 736cbdc118b7a19b724a3afd433927e8e8316d23..a6250143baced61e87900181f8b37cfd89c717ff 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
@@ -443,6 +443,10 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@@ -443,6 +443,10 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Entity#isTicking
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index c584868110ef03c721087cd7eaf454bded763477..13dca15a70d7eb4d4330509727a2e34dec25f74c 100644
|
index f4eb377c0a09dcb24d2d7e49aa0bc18c5817f073..4ba0b06229f98a690162d486befee8fb65e23699 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -52,6 +52,7 @@ import net.minecraft.resources.ResourceKey;
|
@@ -52,6 +52,7 @@ import net.minecraft.resources.ResourceKey;
|
||||||
@ -16,7 +16,7 @@ index c584868110ef03c721087cd7eaf454bded763477..13dca15a70d7eb4d4330509727a2e34d
|
|||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.level.TicketType;
|
import net.minecraft.server.level.TicketType;
|
||||||
@@ -3929,5 +3930,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -3927,5 +3928,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
public static int nextEntityId() {
|
public static int nextEntityId() {
|
||||||
return ENTITY_COUNTER.incrementAndGet();
|
return ENTITY_COUNTER.incrementAndGet();
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@ index c584868110ef03c721087cd7eaf454bded763477..13dca15a70d7eb4d4330509727a2e34d
|
|||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
index 5929caf68b37470298012fd48dd1b62b005fdf89..281d9ff8c7741d44131743271046af07d34ba21d 100644
|
index 3c3614f0f8af3fb2c593dd1154bd64c70713a42e..8246ad7ebecdfc0b7519fe4412fef7b07407e850 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
@@ -1202,5 +1202,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@@ -1202,5 +1202,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix CME on adding a passenger in CreatureSpawnEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 13dca15a70d7eb4d4330509727a2e34dec25f74c..2822105ba88e8fa155147b2529daea70f56d509b 100644
|
index 4ba0b06229f98a690162d486befee8fb65e23699..bf9813eee5865e7363fce3c015a3b8e3e637ce75 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -3433,7 +3433,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -3431,7 +3431,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
private Stream<Entity> getIndirectPassengersStream() {
|
private Stream<Entity> getIndirectPassengersStream() {
|
||||||
|
@ -21,10 +21,10 @@ index 935bb237f8ecd63ca4cec64a7c7a341c9d3358e5..208690ceca2485b54acde5123ba494d7
|
|||||||
private void keepLoadedRange() {
|
private void keepLoadedRange() {
|
||||||
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 2822105ba88e8fa155147b2529daea70f56d509b..9c1b44e45fe9ee1f044e8413002ff4b7c019cfd8 100644
|
index bf9813eee5865e7363fce3c015a3b8e3e637ce75..408d0f51353c745cbdc5c314dd25fa0c8a13441c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1724,6 +1724,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1723,6 +1723,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPushable() {
|
public boolean isPushable() {
|
||||||
@ -61,7 +61,7 @@ index 8fb89326395a7e70982c0d757b506565e98b12a4..a060cca08631fb42041e3a79a9abc422
|
|||||||
} else if (entity.level.isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
|
} else if (entity.level.isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
|
||||||
return false;
|
return false;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 5bba20d869463ec859ae7ac1904da7b42b98309a..6af985b2eba28d3a694afe663e1d76628add940c 100644
|
index a524ea7ff8206036de07d24683adadee8bd41eac..34304fd25a73b3b7e4f078e85b6bee94ab2cc8c8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -3271,7 +3271,7 @@ public abstract class LivingEntity extends Entity {
|
@@ -3271,7 +3271,7 @@ public abstract class LivingEntity extends Entity {
|
||||||
|
@ -41,10 +41,10 @@ index b30c08bfb8c55161543a4ef09f2e462e0a1fe4ae..ec93f5300cc7d423ec0d292f0f8443f9
|
|||||||
|
|
||||||
public Vec3 updateEntityPosition(Vec3 orig) {
|
public Vec3 updateEntityPosition(Vec3 orig) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 9c1b44e45fe9ee1f044e8413002ff4b7c019cfd8..6186a21bd2f6816216c07e18b2eef165ee7bbd32 100644
|
index 408d0f51353c745cbdc5c314dd25fa0c8a13441c..879cadfd1fe96059e621c625adef1673a41ac5dc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -3751,6 +3751,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -3749,6 +3749,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setPosRaw(double x, double y, double z) {
|
public final void setPosRaw(double x, double y, double z) {
|
||||||
|
@ -28,10 +28,10 @@ index 4227e7fc46e22265316b42bbdb166d60e5aed94e..3d16e4a6bf842a209c760fd89f8edf99
|
|||||||
public int wanderingTraderSpawnDayTicks = 24000;
|
public int wanderingTraderSpawnDayTicks = 24000;
|
||||||
public int wanderingTraderSpawnChanceFailureIncrement = 25;
|
public int wanderingTraderSpawnChanceFailureIncrement = 25;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 6186a21bd2f6816216c07e18b2eef165ee7bbd32..145b0205b9777c21f51b24022b2d7a127c26fa0f 100644
|
index 879cadfd1fe96059e621c625adef1673a41ac5dc..c696beff4211266e93026464ba9af5a5d4342e4f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1607,6 +1607,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -1606,6 +1606,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
public void push(Entity entity) {
|
public void push(Entity entity) {
|
||||||
if (!this.isPassengerOfSameVehicle(entity)) {
|
if (!this.isPassengerOfSameVehicle(entity)) {
|
||||||
if (!entity.noPhysics && !this.noPhysics) {
|
if (!entity.noPhysics && !this.noPhysics) {
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add worldborder events
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||||
index dd49122fada9729a44fc040ffa1f57eb6ac5a124..6028e65c7e5afeea87f14edb16415defe89ebffa 100644
|
index c2c54dc4bbfe469f2b8c751012b93d5e728936d6..1e1a9102e067762c9d1bd091388f108ef8170989 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||||
@@ -109,15 +109,19 @@ public class WorldBorder {
|
@@ -108,15 +108,19 @@ public class WorldBorder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCenter(double x, double z) {
|
public void setCenter(double x, double z) {
|
||||||
@ -31,7 +31,7 @@ index dd49122fada9729a44fc040ffa1f57eb6ac5a124..6028e65c7e5afeea87f14edb16415def
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -135,25 +139,43 @@ public class WorldBorder {
|
@@ -134,25 +138,43 @@ public class WorldBorder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSize(double size) {
|
public void setSize(double size) {
|
||||||
@ -79,7 +79,7 @@ index dd49122fada9729a44fc040ffa1f57eb6ac5a124..6028e65c7e5afeea87f14edb16415def
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -458,6 +480,7 @@ public class WorldBorder {
|
@@ -457,6 +479,7 @@ public class WorldBorder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldBorder.BorderExtent update() {
|
public WorldBorder.BorderExtent update() {
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] fix cancelling block falling causing client desync
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 5d89acffe7df54b79733bebba342ea694339ac4b..970c53ff78ed82bb7ec1f981d0fd5cbd72de7bf8 100644
|
index 5d89acffe7df54b79733bebba342ea694339ac4b..edc6126d45b0cf1918c5722c34ea6fea977ed293 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -119,8 +119,18 @@ public class FallingBlockEntity extends Entity {
|
@@ -119,8 +119,18 @@ public class FallingBlockEntity extends Entity {
|
||||||
@ -23,7 +23,7 @@ index 5d89acffe7df54b79733bebba342ea694339ac4b..970c53ff78ed82bb7ec1f981d0fd5cbd
|
|||||||
+ this.discard();
|
+ this.discard();
|
||||||
+ return;
|
+ return;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ this.level.setAir(blockposition, false);
|
+ this.level.removeBlock(blockposition, false);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - fix cancelling block falling causing client desync
|
+ // Paper end - fix cancelling block falling causing client desync
|
||||||
} else if (!this.level.isClientSide) {
|
} else if (!this.level.isClientSide) {
|
||||||
|
@ -44,7 +44,7 @@ index 6b4163f5601a0961055c8451ec7ef2204938cf69..c54a37516ef1d8a76f7161917bf44812
|
|||||||
@Override
|
@Override
|
||||||
public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
|
public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
index 6dbf806b5984ae16e747dce350c7cffcf0b190ad..f17ed24cee2ac9a9ba5d9a02c1cf8c92ee7fe8db 100644
|
index 460a848bd2a417d05a0bbb084371c98b661a427f..67f2d2f45138578646920ccae5b455a842a7b9e8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
@@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
@@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
@ -66,7 +66,7 @@ index 6dbf806b5984ae16e747dce350c7cffcf0b190ad..f17ed24cee2ac9a9ba5d9a02c1cf8c92
|
|||||||
|
|
||||||
@@ -190,6 +191,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
@@ -190,6 +191,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
if (this.spawningEntity != null) {
|
if (this.spawningEntity != null) {
|
||||||
nbt.setUUID("Paper.SpawningEntity", this.spawningEntity);
|
nbt.putUUID("Paper.SpawningEntity", this.spawningEntity);
|
||||||
}
|
}
|
||||||
+ nbt.putBoolean("Paper.ShouldBurnInDay", shouldBurnInDay);
|
+ nbt.putBoolean("Paper.ShouldBurnInDay", shouldBurnInDay);
|
||||||
// Paper end
|
// Paper end
|
||||||
|
@ -13,7 +13,7 @@ contention situations.
|
|||||||
And this is extremely a low contention situation.
|
And this is extremely a low contention situation.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
index 66175691af9417275dee33bbc07c6826e807d571..79a6f43f6aa37362990b403695fcdd13f1a2a3ec 100644
|
index 4a6981f8bacdeca1069e1ddfe44ac9c4217ce624..f2307f81c399867585ffdefc0db835c6f5e2f42a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||||
@@ -37,16 +37,18 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -37,16 +37,18 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
@ -36,7 +36,7 @@ index 66175691af9417275dee33bbc07c6826e807d571..79a6f43f6aa37362990b403695fcdd13
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - Anti-Xray - Add predefined objects
|
// Paper start - Anti-Xray - Add predefined objects
|
||||||
@@ -134,7 +136,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -133,7 +135,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
return this.palette.idFor(objectAdded);
|
return this.palette.idFor(objectAdded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ index 66175691af9417275dee33bbc07c6826e807d571..79a6f43f6aa37362990b403695fcdd13
|
|||||||
Object var6;
|
Object var6;
|
||||||
try {
|
try {
|
||||||
this.acquire();
|
this.acquire();
|
||||||
@@ -158,7 +160,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -157,7 +159,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
return (T)(object == null ? this.defaultValue : object);
|
return (T)(object == null ? this.defaultValue : object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ index 66175691af9417275dee33bbc07c6826e807d571..79a6f43f6aa37362990b403695fcdd13
|
|||||||
try {
|
try {
|
||||||
this.acquire();
|
this.acquire();
|
||||||
this.set(getIndex(i, j, k), object);
|
this.set(getIndex(i, j, k), object);
|
||||||
@@ -182,7 +184,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -181,7 +183,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
return (T)(object == null ? this.defaultValue : object);
|
return (T)(object == null ? this.defaultValue : object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ index 66175691af9417275dee33bbc07c6826e807d571..79a6f43f6aa37362990b403695fcdd13
|
|||||||
try {
|
try {
|
||||||
this.acquire();
|
this.acquire();
|
||||||
int i = buf.readByte();
|
int i = buf.readByte();
|
||||||
@@ -203,7 +205,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -201,7 +203,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
@Deprecated public void write(FriendlyByteBuf buf) {
|
@Deprecated public void write(FriendlyByteBuf buf) {
|
||||||
write(buf, null, 0);
|
write(buf, null, 0);
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ index 66175691af9417275dee33bbc07c6826e807d571..79a6f43f6aa37362990b403695fcdd13
|
|||||||
// Paper end
|
// Paper end
|
||||||
try {
|
try {
|
||||||
this.acquire();
|
this.acquire();
|
||||||
@@ -226,7 +228,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -224,7 +226,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ index 66175691af9417275dee33bbc07c6826e807d571..79a6f43f6aa37362990b403695fcdd13
|
|||||||
try {
|
try {
|
||||||
this.acquire();
|
this.acquire();
|
||||||
// Paper - Anti-Xray - TODO: Should this.predefinedObjects.length just be added here (faster) or should the contents be compared to calculate the size (less RAM)?
|
// Paper - Anti-Xray - TODO: Should this.predefinedObjects.length just be added here (faster) or should the contents be compared to calculate the size (less RAM)?
|
||||||
@@ -261,7 +263,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
@@ -259,7 +261,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ Move the tick logic into the post tick, where portaling was
|
|||||||
designed to happen in the first place.
|
designed to happen in the first place.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 145b0205b9777c21f51b24022b2d7a127c26fa0f..a73059437a65768565a2269e60fbca8ba6ab5253 100644
|
index c696beff4211266e93026464ba9af5a5d4342e4f..af90013d48e2dd827e045e2fc0f7f5be0dbaa33f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -361,6 +361,37 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -361,6 +361,37 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
@ -52,7 +52,7 @@ index 145b0205b9777c21f51b24022b2d7a127c26fa0f..a73059437a65768565a2269e60fbca8b
|
|||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
this.passengers = ImmutableList.of();
|
this.passengers = ImmutableList.of();
|
||||||
@@ -2508,6 +2539,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -2506,6 +2537,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
|
||||||
this.processPortalCooldown();
|
this.processPortalCooldown();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren