mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Apply all
This commit is contained in:
@@ -7,7 +7,7 @@ Original license: GPL v3
|
||||
Original project: https://github.com/Gensokyo-Reimagined/Nitori
|
||||
|
||||
diff --git a/net/minecraft/world/level/storage/LevelStorageSource.java b/net/minecraft/world/level/storage/LevelStorageSource.java
|
||||
index 8104f71c30c1fa46c83acdf0b2e58483df9d89cc..169b4544ab3d0e8515a2d7020a23ae0e2e0c952d 100644
|
||||
index 3b40822ea6ec9783fe3cb8eaba069a8d626d8382..0098ff448d2981723701765b063f103ac88ba1a2 100644
|
||||
--- a/net/minecraft/world/level/storage/LevelStorageSource.java
|
||||
+++ b/net/minecraft/world/level/storage/LevelStorageSource.java
|
||||
@@ -521,15 +521,26 @@ public class LevelStorageSource {
|
||||
@@ -44,10 +44,10 @@ index 8104f71c30c1fa46c83acdf0b2e58483df9d89cc..169b4544ab3d0e8515a2d7020a23ae0e
|
||||
|
||||
public Optional<Path> getIconFile() {
|
||||
diff --git a/net/minecraft/world/level/storage/PlayerDataStorage.java b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
index ab9282c04c1996b037567d07f95e2b150bcfcd38..7a39ea109dee258e7fb83982572ee18731b5446f 100644
|
||||
index fe44d8d17d2622b3d6021c11579af85ef96737bb..45da3bace1262a18c55c13ee72a08c72fc5ba7c0 100644
|
||||
--- a/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
+++ b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
@@ -23,6 +23,7 @@ public class PlayerDataStorage {
|
||||
@@ -24,6 +24,7 @@ public class PlayerDataStorage {
|
||||
private final File playerDir;
|
||||
protected final DataFixer fixerUpper;
|
||||
private static final DateTimeFormatter FORMATTER = FileNameDateFormatter.create();
|
||||
@@ -55,23 +55,25 @@ index ab9282c04c1996b037567d07f95e2b150bcfcd38..7a39ea109dee258e7fb83982572ee187
|
||||
|
||||
public PlayerDataStorage(LevelStorageSource.LevelStorageAccess levelStorageAccess, DataFixer fixerUpper) {
|
||||
this.fixerUpper = fixerUpper;
|
||||
@@ -32,19 +33,82 @@ public class PlayerDataStorage {
|
||||
@@ -33,21 +34,84 @@ public class PlayerDataStorage {
|
||||
|
||||
public void save(Player player) {
|
||||
if (org.spigotmc.SpigotConfig.disablePlayerDataSaving) return; // Spigot
|
||||
+ // Leaf start - Async playerdata saving
|
||||
+ CompoundTag compoundTag;
|
||||
try {
|
||||
- CompoundTag compoundTag = player.saveWithoutId(new CompoundTag());
|
||||
try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(player.problemPath(), LOGGER)) {
|
||||
TagValueOutput tagValueOutput = TagValueOutput.createWithContext(scopedCollector, player.registryAccess());
|
||||
player.saveWithoutId(tagValueOutput);
|
||||
- Path path = this.playerDir.toPath();
|
||||
- Path path1 = Files.createTempFile(path, player.getStringUUID() + "-", ".dat");
|
||||
- CompoundTag compoundTag = tagValueOutput.buildResult();
|
||||
- NbtIo.writeCompressed(compoundTag, path1);
|
||||
- Path path2 = path.resolve(player.getStringUUID() + ".dat");
|
||||
- Path path3 = path.resolve(player.getStringUUID() + ".dat_old");
|
||||
- Util.safeReplaceFile(path2, path1, path3);
|
||||
- } catch (Exception var7) {
|
||||
- LOGGER.warn("Failed to save player data for {}", player.getScoreboardName(), var7); // Paper - Print exception
|
||||
+ compoundTag = player.saveWithoutId(new CompoundTag());
|
||||
- } catch (Exception var11) {
|
||||
- LOGGER.warn("Failed to save player data for {}", player.getScoreboardName(), var11); // Paper - Print exception
|
||||
+ compoundTag = tagValueOutput.buildResult();
|
||||
+ } catch (Exception exception) {
|
||||
+ LOGGER.warn("Failed to encode player data for {}", player.getScoreboardName(), exception);
|
||||
+ return;
|
||||
@@ -147,52 +149,51 @@ index ab9282c04c1996b037567d07f95e2b150bcfcd38..7a39ea109dee258e7fb83982572ee187
|
||||
private void backup(String name, String stringUuid, String suffix) { // CraftBukkit
|
||||
Path path = this.playerDir.toPath();
|
||||
Path path1 = path.resolve(stringUuid + suffix); // CraftBukkit
|
||||
@@ -58,7 +122,13 @@ public class PlayerDataStorage {
|
||||
@@ -61,7 +125,13 @@ public class PlayerDataStorage {
|
||||
}
|
||||
}
|
||||
|
||||
- private Optional<CompoundTag> load(String name, String stringUuid, String suffix) { // CraftBukkit
|
||||
+ // Leaf start - Async playerdata saving
|
||||
+ private Optional<CompoundTag> load(String name, String stringUuid, String suffix) {
|
||||
+ return load(name, stringUuid, suffix, java.util.UUID.fromString(stringUuid));
|
||||
+ return load(name, stringUuid, java.util.UUID.fromString(stringUuid), suffix);
|
||||
+ }
|
||||
+ private Optional<CompoundTag> load(String name, String stringUuid, String suffix, java.util.UUID playerUuid) { // CraftBukkit
|
||||
+ private Optional<CompoundTag> load(String name, String stringUuid, java.util.UUID playerUuid, String suffix) { // CraftBukkit
|
||||
+ lockFor(playerUuid, name);
|
||||
+ // Leaf end - Async playerdata saving
|
||||
File file = new File(this.playerDir, stringUuid + suffix); // CraftBukkit
|
||||
// Spigot start
|
||||
boolean usingWrongFile = false;
|
||||
@@ -89,7 +159,7 @@ public class PlayerDataStorage {
|
||||
@@ -92,7 +162,7 @@ public class PlayerDataStorage {
|
||||
|
||||
public Optional<CompoundTag> load(Player player) {
|
||||
public Optional<ValueInput> load(Player player, ProblemReporter problemReporter) {
|
||||
// CraftBukkit start
|
||||
- return this.load(player.getName().getString(), player.getStringUUID()).map((tag) -> {
|
||||
+ return this.load(player.getName().getString(), player.getStringUUID(), player.getUUID()).map((tag) -> { // Leaf - Async playerdata saving
|
||||
- return this.load(player.getName().getString(), player.getStringUUID(), problemReporter).map((tag) -> {
|
||||
+ return this.load(player.getName().getString(), player.getStringUUID(), player.getUUID(), problemReporter).map((tag) -> { // Leaf - Async playerdata saving
|
||||
if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer) {
|
||||
org.bukkit.craftbukkit.entity.CraftPlayer craftPlayer = serverPlayer.getBukkitEntity();
|
||||
// Only update first played if it is older than the one we have
|
||||
@@ -104,20 +174,25 @@ public class PlayerDataStorage {
|
||||
@@ -108,19 +178,24 @@ public class PlayerDataStorage {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Leaf start - Async playerdata saving
|
||||
public Optional<CompoundTag> load(String name, String uuid) {
|
||||
+ return this.load(name, uuid, java.util.UUID.fromString(uuid));
|
||||
public Optional<CompoundTag> load(String name, String uuid, ProblemReporter problemReporter) {
|
||||
+ return this.load(name, uuid, java.util.UUID.fromString(uuid), problemReporter);
|
||||
+ }
|
||||
+ public Optional<CompoundTag> load(String name, String uuid, java.util.UUID playerUuid) {
|
||||
+ public Optional<CompoundTag> load(String name, String uuid, java.util.UUID playerUuid, ProblemReporter problemReporter) {
|
||||
// CraftBukkit end
|
||||
- Optional<CompoundTag> optional = this.load(name, uuid, ".dat"); // CraftBukkit
|
||||
+ Optional<CompoundTag> optional = this.load(name, uuid, ".dat", playerUuid); // CraftBukkit
|
||||
+ Optional<CompoundTag> optional = this.load(name, uuid, playerUuid, ".dat"); // CraftBukkit
|
||||
if (optional.isEmpty()) {
|
||||
this.backup(name, uuid, ".dat"); // CraftBukkit
|
||||
}
|
||||
|
||||
- return optional.or(() -> this.load(name, uuid, ".dat_old")).map(compoundTag -> { // CraftBukkit
|
||||
+ return optional.or(() -> this.load(name, uuid, ".dat_old", playerUuid)).map(compoundTag -> { // CraftBukkit
|
||||
+ return optional.or(() -> this.load(name, uuid, playerUuid, ".dat_old")).map(compoundTag -> { // CraftBukkit
|
||||
int dataVersion = NbtUtils.getDataVersion(compoundTag, -1);
|
||||
compoundTag = DataFixTypes.PLAYER.updateToCurrentVersion(this.fixerUpper, compoundTag, dataVersion);
|
||||
// player.load(compoundTag); // CraftBukkit - handled above
|
||||
return compoundTag;
|
||||
compoundTag = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.PLAYER, compoundTag, dataVersion, ca.spottedleaf.dataconverter.minecraft.util.Version.getCurrentVersion()); // Paper - rewrite data conversion system
|
||||
return compoundTag; // CraftBukkit - handled above
|
||||
});
|
||||
}
|
||||
+ // Leaf end - Async playerdata saving
|
||||
|
||||
@@ -7,7 +7,7 @@ Use SpottedLeaf's nearby players system to avoid iterating over all online playe
|
||||
and reduce the cost on predicate test
|
||||
|
||||
diff --git a/net/minecraft/world/entity/EntitySelector.java b/net/minecraft/world/entity/EntitySelector.java
|
||||
index 0c1953754220ff72e18f0396134507d93ba7b1b8..51813495cd745c3011534fb75f337305401b1201 100644
|
||||
index 1842cbe25cc0f9be937caf0a78e915bd3d6ea1e5..a6a216c598978f719851856e4ea61e757ce47d7e 100644
|
||||
--- a/net/minecraft/world/entity/EntitySelector.java
|
||||
+++ b/net/minecraft/world/entity/EntitySelector.java
|
||||
@@ -32,7 +32,7 @@ public final class EntitySelector {
|
||||
@@ -20,10 +20,10 @@ index 0c1953754220ff72e18f0396134507d93ba7b1b8..51813495cd745c3011534fb75f337305
|
||||
// Paper end - Affects Spawning API
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 08cf959a0b96ec765f3405a0b0956932ee0a7d26..2fbd167126e6eb5aaf27de77f32e274c8a51df16 100644
|
||||
index 3c1bc0259634be5d988eae93d781c351ec6f3251..5563720a6d92cad974632bdc97bb35c15310483c 100644
|
||||
--- a/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -411,7 +411,7 @@ public class Zombie extends Monster {
|
||||
@@ -410,7 +410,7 @@ public class Zombie extends Monster {
|
||||
if (SpawnPlacements.isSpawnPositionOk(type, level, blockPos)
|
||||
&& SpawnPlacements.checkSpawnRules(type, level, EntitySpawnReason.REINFORCEMENT, blockPos, level.random)) {
|
||||
zombie.setPos(i1, i2, i3);
|
||||
@@ -33,10 +33,10 @@ index 08cf959a0b96ec765f3405a0b0956932ee0a7d26..2fbd167126e6eb5aaf27de77f32e274c
|
||||
&& level.noCollision(zombie)
|
||||
&& (zombie.canSpawnInLiquids() || !level.containsAnyLiquid(zombie.getBoundingBox()))) {
|
||||
diff --git a/net/minecraft/world/level/BaseSpawner.java b/net/minecraft/world/level/BaseSpawner.java
|
||||
index 0babc951d9fed6d32d3dba549cc5ced4dc6b0588..9fa9d84033c28071120e8a1c796ace4f9a45d4c5 100644
|
||||
index 41ba9f234e840fadee3c8a52ba9655b97a8b7381..b23283779c85c0afb230872b2794640fd9719ec2 100644
|
||||
--- a/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -55,7 +55,7 @@ public abstract class BaseSpawner {
|
||||
@@ -62,7 +62,7 @@ public abstract class BaseSpawner {
|
||||
|
||||
public boolean isNearPlayer(Level level, BlockPos pos) {
|
||||
if (level.purpurConfig.spawnerDeactivateByRedstone && level.hasNeighborSignal(pos)) return false; // Purpur - Redstone deactivates spawners
|
||||
@@ -46,7 +46,7 @@ index 0babc951d9fed6d32d3dba549cc5ced4dc6b0588..9fa9d84033c28071120e8a1c796ace4f
|
||||
|
||||
public void clientTick(Level level, BlockPos pos) {
|
||||
diff --git a/net/minecraft/world/level/EntityGetter.java b/net/minecraft/world/level/EntityGetter.java
|
||||
index 7719bc8ff1fbbc67cdf15e1fec28dc9233cea207..670860df81a3abfc1b8b53be505fce0ee32ee2c4 100644
|
||||
index 452b6df03152dbd2311774bf4872983d3df92665..6a7d99c172c2f6fc30a4ffcb3cd7bfad92e27adc 100644
|
||||
--- a/net/minecraft/world/level/EntityGetter.java
|
||||
+++ b/net/minecraft/world/level/EntityGetter.java
|
||||
@@ -112,6 +112,89 @@ public interface EntityGetter extends ca.spottedleaf.moonrise.patches.chunk_syst
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: MIT
|
||||
Original project: https://github.com/thebrightspark/AsyncLocator
|
||||
|
||||
diff --git a/net/minecraft/server/commands/LocateCommand.java b/net/minecraft/server/commands/LocateCommand.java
|
||||
index 2723d5377567241921fef61952e474c1c0ee9bbf..0918b528e0310b12378e185b29a478ed188a2d58 100644
|
||||
index a734b2597c3491db35d9660e169f8e8b6320900b..8a79a339757d6ac49713bf6db0fb675d9893fd1b 100644
|
||||
--- a/net/minecraft/server/commands/LocateCommand.java
|
||||
+++ b/net/minecraft/server/commands/LocateCommand.java
|
||||
@@ -109,6 +109,38 @@ public class LocateCommand {
|
||||
@@ -106,6 +106,38 @@ public class LocateCommand {
|
||||
BlockPos blockPos = BlockPos.containing(source.getPosition());
|
||||
ServerLevel level = source.getLevel();
|
||||
Stopwatch stopwatch = Stopwatch.createStarted(Util.TICKER);
|
||||
@@ -50,10 +50,10 @@ index 2723d5377567241921fef61952e474c1c0ee9bbf..0918b528e0310b12378e185b29a478ed
|
||||
stopwatch.stop();
|
||||
if (pair == null) {
|
||||
diff --git a/net/minecraft/world/entity/animal/Dolphin.java b/net/minecraft/world/entity/animal/Dolphin.java
|
||||
index 87ba416479df56bad5d13c01e96e92e45b7802a3..2508645b62e7f935dee00fe87b3a6446dbd22cf2 100644
|
||||
index 23696a5e2871ea07f34d4b4f6a20e2896ac3f5bd..c4fda92e078c9ba745b2548ecaaffffff97fb0fd 100644
|
||||
--- a/net/minecraft/world/entity/animal/Dolphin.java
|
||||
+++ b/net/minecraft/world/entity/animal/Dolphin.java
|
||||
@@ -486,6 +486,10 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -487,6 +487,10 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
static class DolphinSwimToTreasureGoal extends Goal {
|
||||
private final Dolphin dolphin;
|
||||
private boolean stuck;
|
||||
@@ -64,7 +64,7 @@ index 87ba416479df56bad5d13c01e96e92e45b7802a3..2508645b62e7f935dee00fe87b3a6446
|
||||
|
||||
DolphinSwimToTreasureGoal(Dolphin dolphin) {
|
||||
this.dolphin = dolphin;
|
||||
@@ -505,6 +509,11 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -506,6 +510,11 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
|
||||
@Override
|
||||
public boolean canContinueToUse() {
|
||||
@@ -76,7 +76,7 @@ index 87ba416479df56bad5d13c01e96e92e45b7802a3..2508645b62e7f935dee00fe87b3a6446
|
||||
BlockPos blockPos = this.dolphin.treasurePos;
|
||||
return blockPos != null
|
||||
&& !BlockPos.containing(blockPos.getX(), this.dolphin.getY(), blockPos.getZ()).closerToCenterThan(this.dolphin.position(), 4.0)
|
||||
@@ -519,6 +528,22 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -520,6 +529,22 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
this.stuck = false;
|
||||
this.dolphin.getNavigation().stop();
|
||||
BlockPos blockPos = this.dolphin.blockPosition();
|
||||
@@ -99,7 +99,7 @@ index 87ba416479df56bad5d13c01e96e92e45b7802a3..2508645b62e7f935dee00fe87b3a6446
|
||||
BlockPos blockPos1 = serverLevel.findNearestMapStructure(StructureTags.DOLPHIN_LOCATED, blockPos, 50, false);
|
||||
if (blockPos1 != null) {
|
||||
this.dolphin.treasurePos = blockPos1;
|
||||
@@ -531,6 +556,12 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -532,6 +557,12 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
@@ -112,7 +112,7 @@ index 87ba416479df56bad5d13c01e96e92e45b7802a3..2508645b62e7f935dee00fe87b3a6446
|
||||
BlockPos blockPos = this.dolphin.treasurePos;
|
||||
if (blockPos == null
|
||||
|| BlockPos.containing(blockPos.getX(), this.dolphin.getY(), blockPos.getZ()).closerToCenterThan(this.dolphin.position(), 4.0)
|
||||
@@ -541,6 +572,11 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -542,6 +573,11 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -125,18 +125,18 @@ index 87ba416479df56bad5d13c01e96e92e45b7802a3..2508645b62e7f935dee00fe87b3a6446
|
||||
Level level = this.dolphin.level();
|
||||
if (this.dolphin.closeToNextPos() || this.dolphin.getNavigation().isDone()) {
|
||||
diff --git a/net/minecraft/world/entity/projectile/EyeOfEnder.java b/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
index 59941c605085d93357211939114ecf1b88aef05d..74ffcc5417dd20635a52a3e799436eaf18076a0e 100644
|
||||
index 2bb3c5018be0c669da4c28a34ce2f2e124547691..2c34e956e8a3263bb05ae2810a8578696f739263 100644
|
||||
--- a/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
@@ -29,6 +29,7 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
public double tz;
|
||||
@@ -28,6 +28,7 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
public Vec3 target;
|
||||
public int life;
|
||||
public boolean surviveAfterDeath;
|
||||
+ public boolean asyncLocator$locateTaskOngoing = false; // Leaf - Asynchronous locator
|
||||
|
||||
public EyeOfEnder(EntityType<? extends EyeOfEnder> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -116,6 +117,11 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
@@ -95,6 +96,11 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
@@ -145,14 +145,14 @@ index 59941c605085d93357211939114ecf1b88aef05d..74ffcc5417dd20635a52a3e799436eaf
|
||||
+ return;
|
||||
+ }
|
||||
+ // Leaf end - Asynchronous locator
|
||||
Vec3 deltaMovement = this.getDeltaMovement();
|
||||
double d = this.getX() + deltaMovement.x;
|
||||
double d1 = this.getY() + deltaMovement.y;
|
||||
Vec3 vec3 = this.position().add(this.getDeltaMovement());
|
||||
if (!this.level().isClientSide() && this.target != null) {
|
||||
this.setDeltaMovement(updateDeltaMovement(this.getDeltaMovement(), vec3, this.target));
|
||||
diff --git a/net/minecraft/world/item/EnderEyeItem.java b/net/minecraft/world/item/EnderEyeItem.java
|
||||
index 68f33de233b716055f791fd87fe3be981580375c..bd60cc8f7e37cba981792412a8ce7f71ea8b33f5 100644
|
||||
index 51e0985bde9cf6ac2f4264d21edec3d1623a2d0d..ca2b493e4032208311c857db799632ac3d3ab077 100644
|
||||
--- a/net/minecraft/world/item/EnderEyeItem.java
|
||||
+++ b/net/minecraft/world/item/EnderEyeItem.java
|
||||
@@ -105,14 +105,47 @@ public class EnderEyeItem extends Item {
|
||||
@@ -106,14 +106,46 @@ public class EnderEyeItem extends Item {
|
||||
} else {
|
||||
player.startUsingItem(hand);
|
||||
if (level instanceof ServerLevel serverLevel) {
|
||||
@@ -185,7 +185,7 @@ index 68f33de233b716055f791fd87fe3be981580375c..bd60cc8f7e37cba981792412a8ce7f71
|
||||
+ ).thenOnServerThread(pos -> {
|
||||
+ eyeOfEnder.asyncLocator$locateTaskOngoing = false;
|
||||
+ if (pos != null) {
|
||||
+ eyeOfEnder.signalTo(pos);
|
||||
+ eyeOfEnder.signalTo(Vec3.atLowerCornerOf(pos));
|
||||
+ CriteriaTriggers.USED_ENDER_EYE.trigger((ServerPlayer) player, pos);
|
||||
+ player.awardStat(Stats.ITEM_USED.get(this));
|
||||
+ } else {
|
||||
@@ -195,14 +195,13 @@ index 68f33de233b716055f791fd87fe3be981580375c..bd60cc8f7e37cba981792412a8ce7f71
|
||||
+ });
|
||||
+ }
|
||||
+ // Leaf end - Asynchronous locator
|
||||
+
|
||||
eyeOfEnder.setItem(itemInHand);
|
||||
- eyeOfEnder.signalTo(blockPos);
|
||||
+ if (!isAsyncLocatorEnabled) eyeOfEnder.signalTo(blockPos); // Leaf - Asynchronous locator
|
||||
- eyeOfEnder.signalTo(Vec3.atLowerCornerOf(blockPos));
|
||||
+ if (!isAsyncLocatorEnabled) eyeOfEnder.signalTo(Vec3.atLowerCornerOf(blockPos)); // Leaf - Asynchronous locator
|
||||
level.gameEvent(GameEvent.PROJECTILE_SHOOT, eyeOfEnder.position(), GameEvent.Context.of(player));
|
||||
// CraftBukkit start
|
||||
if (!level.addFreshEntity(eyeOfEnder)) {
|
||||
@@ -126,7 +159,7 @@ public class EnderEyeItem extends Item {
|
||||
@@ -127,7 +159,7 @@ public class EnderEyeItem extends Item {
|
||||
float f = Mth.lerp(level.random.nextFloat(), 0.33F, 0.5F);
|
||||
level.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENDER_EYE_LAUNCH, SoundSource.NEUTRAL, 1.0F, f);
|
||||
itemInHand.consume(1, player);
|
||||
|
||||
@@ -8,10 +8,10 @@ avoids multiple casting in Entity#distanceTo, using Math#sqrt directly instead o
|
||||
these methods more able to be inlined by the JIT compiler.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index c6bb3d9e1e9c2b38845e70c308fad41c813c600e..21dbc78baae89093ef9bc3a0620ab9e557e22910 100644
|
||||
index 083d078f569aebbed1ab586ec99709e7c38e13b6..504aaa8fe43092442c3426c96d41dacb03371578 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -2190,31 +2190,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2260,31 +2260,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return new Vec3(this.xOld, this.yOld, this.zOld);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ index c6bb3d9e1e9c2b38845e70c308fad41c813c600e..21dbc78baae89093ef9bc3a0620ab9e5
|
||||
public void playerTouch(Player player) {
|
||||
}
|
||||
|
||||
@@ -5269,4 +5244,34 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5510,4 +5485,34 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return false;
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
@@ -9,10 +9,10 @@ Original project: https://github.com/starlis/empirecraft
|
||||
Also see Leaf's EMC-Don-t-use-snapshots-for-acquiring-blockstate
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/entity/BlockEntity.java b/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
index d7a08a4ecac2bb4f5626fb53e27f8d50b6936f1c..129af0e69a3ec9525756b6825b795e4441de66c9 100644
|
||||
index a5ade8268a74738170caf519e7e45e13862bc39d..92e57b14d54a3830bc99fde6e1c231a09dcdc215 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -363,7 +363,7 @@ public abstract class BlockEntity {
|
||||
@@ -386,7 +386,7 @@ public abstract class BlockEntity {
|
||||
|
||||
// CraftBukkit start - add method
|
||||
public org.bukkit.inventory.InventoryHolder getOwner() {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Cache tile entity position
|
||||
Dreeam TODO: Check if there is a way to cache isRemoved without problem
|
||||
|
||||
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 800fc055024c176d1830e1d2686f5d96131c8712..5325989f46bd288c5a6f1362ec17d3354d55abfd 100644
|
||||
index 27aa58ab47e7a7b0edddd1c483dc9165696ebf11..65442f9ab1528fd1b736963bc51f21fd6a0781a0 100644
|
||||
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -940,10 +940,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -947,10 +947,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
private final T blockEntity;
|
||||
private final BlockEntityTicker<T> ticker;
|
||||
private boolean loggedInvalidBlockState;
|
||||
@@ -22,7 +22,7 @@ index 800fc055024c176d1830e1d2686f5d96131c8712..5325989f46bd288c5a6f1362ec17d335
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -984,7 +986,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -991,7 +993,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
@Override
|
||||
public BlockPos getPos() {
|
||||
@@ -31,7 +31,7 @@ index 800fc055024c176d1830e1d2686f5d96131c8712..5325989f46bd288c5a6f1362ec17d335
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1011,13 +1013,16 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1018,13 +1020,16 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
static class RebindableTickingBlockEntityWrapper implements TickingBlockEntity {
|
||||
private TickingBlockEntity ticker;
|
||||
@@ -48,7 +48,7 @@ index 800fc055024c176d1830e1d2686f5d96131c8712..5325989f46bd288c5a6f1362ec17d335
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1032,7 +1037,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1039,7 +1044,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
@Override
|
||||
public BlockPos getPos() {
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: AGPL-3.0
|
||||
Original project: https://github.com/snackbag/TT20
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 7f6dac89c98132645799b7976b972bf43f475fe8..4bf840705bec251aa7e5595fa16bf8e1a9a7d2e9 100644
|
||||
index 385762df2014af0a643fb955d39871b818dde4ef..b66bec748d87151eafe8a055c3b659477c042092 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1539,6 +1539,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1541,6 +1541,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
this.server.spark.tickStart(); // Paper - spark
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||
|
||||
@@ -12,10 +12,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 68241d1d488bc2848e3c0d167270c1788e573c37..b3e9ad0669bb4b91d5d991f106b225e914a4e68f 100644
|
||||
index 19881624b91f44c9332ad4ba147a66837864da06..4a06812757ab46a975f182d8ada03e19802e7e5f 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2796,6 +2796,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2828,6 +2828,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
|
||||
protected void updateSwingTime() {
|
||||
@@ -23,9 +23,9 @@ index 68241d1d488bc2848e3c0d167270c1788e573c37..b3e9ad0669bb4b91d5d991f106b225e9
|
||||
int currentSwingDuration = this.getCurrentSwingDuration();
|
||||
if (this.swinging) {
|
||||
this.swingTime++;
|
||||
@@ -3704,6 +3705,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3760,6 +3761,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
protected void updateFallFlying() {
|
||||
this.checkSlowFallDistance();
|
||||
this.checkFallDistanceAccumulation();
|
||||
if (!this.level().isClientSide) {
|
||||
+ if (!this.isFallFlying() && this.fallFlyTicks == 0) return; // Leaf - Lithium - entity.fast_elytra_check
|
||||
if (!this.canGlide()) {
|
||||
|
||||
@@ -97,10 +97,10 @@ index fd3d0f6cb53bc8b6186f0d86575f21007b2c20ed..cddeeab73e7b981701a42c5aad6b4777
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index bbccf0c8aef3792bb7b7cb0070e48bca4c274a2c..ccd6f16e244745ee0702504dbea710485037a3e3 100644
|
||||
index c5949a0e852ca6de84e8dd12e3d4ed8527b60e25..0f311e603c8df175576a33d5d20369cbcda2be55 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -504,7 +504,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -507,7 +507,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@Override
|
||||
public final void moonrise$markChunkForPlayerTicking(final LevelChunk chunk) {
|
||||
final ChunkPos pos = chunk.getPos();
|
||||
@@ -109,7 +109,7 @@ index bbccf0c8aef3792bb7b7cb0070e48bca4c274a2c..ccd6f16e244745ee0702504dbea71048
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2571,7 +2571,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -2610,7 +2610,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
public boolean areEntitiesActuallyLoadedAndTicking(ChunkPos chunkPos) {
|
||||
// Paper start - rewrite chunk system
|
||||
@@ -118,7 +118,7 @@ index bbccf0c8aef3792bb7b7cb0070e48bca4c274a2c..ccd6f16e244745ee0702504dbea71048
|
||||
return chunkHolder != null && chunkHolder.isEntityTickingReady();
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
@@ -2586,7 +2586,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -2625,7 +2625,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
public boolean canSpawnEntitiesInChunk(ChunkPos chunkPos) {
|
||||
// Paper start - rewrite chunk system
|
||||
|
||||
@@ -12,7 +12,7 @@ We replaced the `blockEntityTickers` list with a custom list based on fastutil's
|
||||
This is WAY FASTER than using `removeAll` with a list of entries to be removed, because we don't need to calculate the identity of each block entity to be removed, and we can jump directly to where the search should begin, giving a performance boost for small removals (because we don't need to loop thru the entire list to find what element should be removed) and a performance boost for big removals (no need to calculate the identity of each block entity).
|
||||
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index f145453f70a219c1be33b241309ae2ab22a8004b..22da84734462d09a55bc599db4374e1e4f4d6bd2 100644
|
||||
index 8ebfb2f5cf439190ea9bd4ad81d737fbcd4514c2..f9fa85f110c1ea167bc7464a8593942c645ece13 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -104,7 +104,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -24,7 +24,7 @@ index f145453f70a219c1be33b241309ae2ab22a8004b..22da84734462d09a55bc599db4374e1e
|
||||
protected final NeighborUpdater neighborUpdater;
|
||||
private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList();
|
||||
private boolean tickingBlockEntities;
|
||||
@@ -1506,13 +1506,11 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1507,13 +1507,11 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
boolean runsNormally = this.tickRateManager().runsNormally();
|
||||
|
||||
int tickedEntities = 0; // Paper - rewrite chunk system
|
||||
@@ -39,7 +39,7 @@ index f145453f70a219c1be33b241309ae2ab22a8004b..22da84734462d09a55bc599db4374e1e
|
||||
} else if (runsNormally && this.shouldTickBlocksAt(tickingBlockEntity.getPos())) {
|
||||
tickingBlockEntity.tick();
|
||||
// Paper start - rewrite chunk system
|
||||
@@ -1522,7 +1520,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1523,7 +1521,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] SparklyPaper: Skip dirty stats copy when requesting player
|
||||
|
||||
|
||||
diff --git a/net/minecraft/stats/ServerStatsCounter.java b/net/minecraft/stats/ServerStatsCounter.java
|
||||
index dfaead7716ac718bcdbf4c3021aed1b57676af50..d04de9dc0a9a47e6c17f1000844bdee49e41035f 100644
|
||||
index 195ff539c9cb4b2a0640555fc4b59df39e06c90d..8a927cb4327f5fdfe06b595095d840e789141733 100644
|
||||
--- a/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -100,11 +100,15 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
@@ -98,11 +98,15 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
this.dirty.add(stat);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ index dfaead7716ac718bcdbf4c3021aed1b57676af50..d04de9dc0a9a47e6c17f1000844bdee4
|
||||
|
||||
public void parseLocal(DataFixer fixerUpper, String json) {
|
||||
try {
|
||||
@@ -146,10 +150,12 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
@@ -141,10 +145,12 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
public void sendStats(ServerPlayer player) {
|
||||
Object2IntMap<Stat<?>> map = new Object2IntOpenHashMap<>();
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Cache supporting block check
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 21dbc78baae89093ef9bc3a0620ab9e557e22910..69521086fca0c9fbc230817062b65c4269c575fd 100644
|
||||
index 504aaa8fe43092442c3426c96d41dacb03371578..2e5d4b8fc6a0ec6692eac63bce13b3f32d3f3e76 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1082,12 +1082,36 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1104,12 +1104,36 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.mainSupportingBlockPos.isPresent() && this.mainSupportingBlockPos.get().equals(pos);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ index 21dbc78baae89093ef9bc3a0620ab9e557e22910..69521086fca0c9fbc230817062b65c42
|
||||
this.mainSupportingBlockPos = optional;
|
||||
} else if (movement != null) {
|
||||
AABB aabb1 = aabb.move(-movement.x, 0.0, -movement.z);
|
||||
@@ -1104,6 +1128,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1126,6 +1150,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ index 72cca4897f9697573fd6987a5f0d2df52761b8c3..04eea77cf84aaeb781608e48f2aa32f3
|
||||
|
||||
private static void throwHalfStack(Villager villager, Set<Item> stack, LivingEntity entity) {
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 4de268c2b563dca353748e12a0f5dc0729e6fc21..5cc4b2a0d10b25c57c582772ac6757442780afb0 100644
|
||||
index 50d030205b2316e6ad5939ed62cc8b512338da00..806f05a24ac37a4f012a931699a99632424a428f 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -972,7 +972,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -974,7 +974,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
|
||||
private int countFoodPointsInInventory() {
|
||||
SimpleContainer inventory = this.getInventory();
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Only player pushable
|
||||
Useful for extreme cases like massive entities collide together in a small area
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index b3e9ad0669bb4b91d5d991f106b225e914a4e68f..d19d253ce100aee5e2a12eeb4ea50065760ed702 100644
|
||||
index 4a06812757ab46a975f182d8ada03e19802e7e5f..e04a84d7fd2185013695e66647ec6faab35423af 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3630,7 +3630,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3682,7 +3682,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
this.checkAutoSpinAttack(boundingBox, this.getBoundingBox());
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ index b3e9ad0669bb4b91d5d991f106b225e914a4e68f..d19d253ce100aee5e2a12eeb4ea50065
|
||||
// Paper start - Add EntityMoveEvent
|
||||
// Purpur start - Ridables
|
||||
if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) {
|
||||
@@ -3773,7 +3773,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3829,7 +3829,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
return;
|
||||
}
|
||||
// Paper end - don't run getEntities if we're not going to use its result
|
||||
@@ -32,7 +32,7 @@ index b3e9ad0669bb4b91d5d991f106b225e914a4e68f..d19d253ce100aee5e2a12eeb4ea50065
|
||||
if (!pushableEntities.isEmpty()) {
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
// Paper - don't run getEntities if we're not going to use its result; moved up
|
||||
@@ -3807,6 +3812,44 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3863,6 +3868,44 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ index b3e9ad0669bb4b91d5d991f106b225e914a4e68f..d19d253ce100aee5e2a12eeb4ea50065
|
||||
AABB aabb = boundingBoxBeforeSpin.minmax(boundingBoxAfterSpin);
|
||||
List<Entity> entities = this.level().getEntities(this, aabb);
|
||||
diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index 0417175c7beabbca53cd080d158001eabe3941f0..2bfc578b7080b93e99daa45905e1890d3f7c5cbc 100644
|
||||
index 83fdd22eeb141079e05018ebf5cef70e7eb78726..4432d4cc842dc4c2a27002f7a2754f419c6bf5b8 100644
|
||||
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -247,7 +247,7 @@ public class ArmorStand extends LivingEntity {
|
||||
@@ -205,7 +205,7 @@ public class ArmorStand extends LivingEntity {
|
||||
|
||||
@Override
|
||||
protected void pushEntities() {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove iterators from Inventory
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
|
||||
index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..a36d5f486e4b936e9107aa0dce263ad8afc30373 100644
|
||||
index a6bb436dc80daf6901dc027a6011ead4b3ed27e2..b835f8e8caf44e6782b22a76910b26e6f29cb985 100644
|
||||
--- a/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -439,13 +439,15 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -456,13 +456,15 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..a36d5f486e4b936e9107aa0dce263ad8
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -504,17 +506,20 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -515,17 +517,20 @@ public class Inventory implements Container, Nameable {
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
@@ -48,7 +48,7 @@ index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..a36d5f486e4b936e9107aa0dce263ad8
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -561,31 +566,58 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -572,31 +577,58 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack stack) {
|
||||
@@ -110,7 +110,7 @@ index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..a36d5f486e4b936e9107aa0dce263ad8
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -605,9 +637,12 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -616,9 +648,12 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public void fillStackedContents(StackedItemContents contents) {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Cache eligible players for despawn checks
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index ccd6f16e244745ee0702504dbea710485037a3e3..2ecb73fc7b6754ade93bf16b48c623e6b3a955a9 100644
|
||||
index 0f311e603c8df175576a33d5d20369cbcda2be55..3a31f9132a7271ea476cc85c5a10ea7f327256bf 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -725,6 +725,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -729,6 +729,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
return this.structureManager;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ index ccd6f16e244745ee0702504dbea710485037a3e3..2ecb73fc7b6754ade93bf16b48c623e6
|
||||
public void tick(BooleanSupplier hasTimeLeft) {
|
||||
this.handlingTick = true;
|
||||
TickRateManager tickRateManager = this.tickRateManager();
|
||||
@@ -792,6 +794,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -796,6 +798,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
|
||||
io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR
|
||||
@@ -38,10 +38,10 @@ index ccd6f16e244745ee0702504dbea710485037a3e3..2ecb73fc7b6754ade93bf16b48c623e6
|
||||
.forEach(
|
||||
entity -> {
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 18125ed336c3425f123232b405a8af9ee3a2ba7d..d507544efafe74ecaffd6a063eff152d349ec76a 100644
|
||||
index 72cf6f83b3158c3ccf6f8b51652e6fe6401ae0e6..d6f4c267a819a7ef37a16ad0ea5ad56c12682c33 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1518,6 +1518,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1549,6 +1549,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.containerMenu.broadcastChanges();
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ index 18125ed336c3425f123232b405a8af9ee3a2ba7d..d507544efafe74ecaffd6a063eff152d
|
||||
private Either<Player.BedSleepingProblem, Unit> getBedResult(BlockPos at, Direction direction) {
|
||||
if (this.isSleeping() || !this.isAlive()) {
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index c15b6e32bd00650366dc4ecba2abeb6bfb98d638..81bd431e641be474f7a43a78df083756de1798de 100644
|
||||
index 867353500482247bbec79f407246902c79a3d14a..4a1a336914eff8a178dcd992bd1bfea25a8be76b 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -705,7 +705,24 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
@@ -722,7 +722,24 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
if (this.level().getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
|
||||
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Bulk writes to writeLongArray during chunk loading
|
||||
|
||||
|
||||
diff --git a/net/minecraft/network/FriendlyByteBuf.java b/net/minecraft/network/FriendlyByteBuf.java
|
||||
index 76576f2fd8b267d96186ab337bf4e41520e3cd18..8cfe865c0e1ef097846113342660fe26ecc20783 100644
|
||||
index 8817aee7eb61e130aacc4f0df980036b92500ad1..a2b2f6f9ea9e3f0802512c62c0e44875816fb748 100644
|
||||
--- a/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -360,6 +360,50 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -377,6 +377,50 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Spawner Configurations
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/BaseSpawner.java b/net/minecraft/world/level/BaseSpawner.java
|
||||
index 9fa9d84033c28071120e8a1c796ace4f9a45d4c5..dc1d0c8a5b26142eeb8b9c167cef8d3ddcc1ad55 100644
|
||||
index b23283779c85c0afb230872b2794640fd9719ec2..bf4289420b1f433c07c0c5244d58a0e39d7839c0 100644
|
||||
--- a/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -55,6 +55,12 @@ public abstract class BaseSpawner {
|
||||
@@ -62,6 +62,12 @@ public abstract class BaseSpawner {
|
||||
|
||||
public boolean isNearPlayer(Level level, BlockPos pos) {
|
||||
if (level.purpurConfig.spawnerDeactivateByRedstone && level.hasNeighborSignal(pos)) return false; // Purpur - Redstone deactivates spawners
|
||||
@@ -21,7 +21,7 @@ index 9fa9d84033c28071120e8a1c796ace4f9a45d4c5..dc1d0c8a5b26142eeb8b9c167cef8d3d
|
||||
return level.hasNearbyAlivePlayerThatAffectsSpawningForSpawner(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, this.requiredPlayerRange); // Paper - Affects Spawning API // Leaf - Optimize nearby alive players for spawning
|
||||
}
|
||||
|
||||
@@ -77,6 +83,20 @@ public abstract class BaseSpawner {
|
||||
@@ -84,6 +90,20 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ index 9fa9d84033c28071120e8a1c796ace4f9a45d4c5..dc1d0c8a5b26142eeb8b9c167cef8d3d
|
||||
public void serverTick(ServerLevel serverLevel, BlockPos pos) {
|
||||
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
|
||||
// Paper start - Configurable mob spawner tick rate
|
||||
@@ -84,6 +104,15 @@ public abstract class BaseSpawner {
|
||||
@@ -91,6 +111,15 @@ public abstract class BaseSpawner {
|
||||
tickDelay = serverLevel.paperConfig().tickRates.mobSpawner;
|
||||
if (tickDelay == -1) { return; } // If disabled
|
||||
// Paper end - Configurable mob spawner tick rate
|
||||
@@ -58,112 +58,114 @@ index 9fa9d84033c28071120e8a1c796ace4f9a45d4c5..dc1d0c8a5b26142eeb8b9c167cef8d3d
|
||||
if (this.isNearPlayer(serverLevel, pos)) {
|
||||
if (this.spawnDelay < -tickDelay) { // Paper - Configurable mob spawner tick rate
|
||||
this.delay(serverLevel, pos);
|
||||
@@ -112,18 +141,48 @@ public abstract class BaseSpawner {
|
||||
pos.getZ() + (random.nextDouble() - random.nextDouble()) * this.spawnRange + 0.5
|
||||
)
|
||||
);
|
||||
- if (serverLevel.noCollision(optional.get().getSpawnAABB(vec3.x, vec3.y, vec3.z))) {
|
||||
+ // Leaf start - Spawner Configurations
|
||||
+ // Skip collision check if block checks are disabled
|
||||
+ boolean skipBlockChecks = org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ !org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.spawnerBlockChecks;
|
||||
+ if (skipBlockChecks || serverLevel.noCollision(optional.get().getSpawnAABB(vec3.x, vec3.y, vec3.z))) {
|
||||
+ // 'skipBlockChecks' is true if SpawnerSettings.spawnerBlockChecks is false.
|
||||
+ // It means we skip physical block checks like collision and custom rule isValidPosition.
|
||||
@@ -120,20 +149,50 @@ public abstract class BaseSpawner {
|
||||
pos.getZ() + (random.nextDouble() - random.nextDouble()) * this.spawnRange + 0.5
|
||||
)
|
||||
);
|
||||
- if (serverLevel.noCollision(optional.get().getSpawnAABB(vec3.x, vec3.y, vec3.z))) {
|
||||
+ // Leaf start - Spawner Configurations
|
||||
+ // Skip collision check if block checks are disabled
|
||||
+ boolean skipBlockChecks = org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ !org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.spawnerBlockChecks;
|
||||
+ if (skipBlockChecks || serverLevel.noCollision(optional.get().getSpawnAABB(vec3.x, vec3.y, vec3.z))) {
|
||||
+ // 'skipBlockChecks' is true if SpawnerSettings.spawnerBlockChecks is false.
|
||||
+ // It means we skip physical block checks like collision and custom rule isValidPosition.
|
||||
+
|
||||
BlockPos blockPos = BlockPos.containing(vec3);
|
||||
BlockPos blockPos = BlockPos.containing(vec3);
|
||||
+
|
||||
+ // Add light level check if enabled
|
||||
+ if (org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.lightLevelCheck) {
|
||||
+ int lightLevel = serverLevel.getMaxLocalRawBrightness(blockPos);
|
||||
+ if (lightLevel > maxAllowedLight(optional.get())) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Add water check if enabled
|
||||
+ if (org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.waterPreventSpawnCheck &&
|
||||
+ serverLevel.getBlockState(blockPos).getFluidState().is(net.minecraft.tags.FluidTags.WATER)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // Determine if mob-specific spawn rules (like block types, biome requirements) should be skipped
|
||||
+ boolean skipMobSpecificRules = org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.ignoreSpawnRules;
|
||||
+ // Leaf end - Spawner Configurations
|
||||
if (nextSpawnData.getCustomSpawnRules().isPresent()) {
|
||||
if (!optional.get().getCategory().isFriendly() && serverLevel.getDifficulty() == Difficulty.PEACEFUL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SpawnData.CustomSpawnRules customSpawnRules = nextSpawnData.getCustomSpawnRules().get();
|
||||
- if (!customSpawnRules.isValidPosition(blockPos, serverLevel)) {
|
||||
+ // customSpawnRules.isValidPosition is controlled by spawnerBlockChecks (via !skipBlockChecks)
|
||||
+ if (!skipBlockChecks && !customSpawnRules.isValidPosition(blockPos, serverLevel)) { // Leaf - Spawner Configurations
|
||||
continue;
|
||||
}
|
||||
- } else if (!SpawnPlacements.checkSpawnRules(optional.get(), serverLevel, EntitySpawnReason.SPAWNER, blockPos, serverLevel.getRandom())) {
|
||||
+ } else if (!skipMobSpecificRules && !SpawnPlacements.checkSpawnRules(optional.get(), serverLevel, EntitySpawnReason.SPAWNER, blockPos, serverLevel.getRandom())) {
|
||||
+ // If not skipping mob-specific rules AND standard spawn rules fail, continue.
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -151,6 +210,7 @@ public abstract class BaseSpawner {
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled || org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.spawnerMaxNearbyCheck) { // Leaf - Spawner Configurations - Skip max nearby entity check if disabled
|
||||
int size = serverLevel.getEntities(
|
||||
EntityTypeTest.forExactClass(entity.getClass()),
|
||||
new AABB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1).inflate(this.spawnRange),
|
||||
@@ -161,12 +221,29 @@ public abstract class BaseSpawner {
|
||||
this.delay(serverLevel, pos);
|
||||
return;
|
||||
}
|
||||
+ } // Leaf - Spawner Configurations
|
||||
|
||||
entity.preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; preserve entity motion from tag
|
||||
entity.snapTo(entity.getX(), entity.getY(), entity.getZ(), random.nextFloat() * 360.0F, 0.0F);
|
||||
if (entity instanceof Mob mob) {
|
||||
- if (nextSpawnData.getCustomSpawnRules().isEmpty() && !mob.checkSpawnRules(serverLevel, EntitySpawnReason.SPAWNER)
|
||||
- || !mob.checkSpawnObstruction(serverLevel)) {
|
||||
+ // Leaf start - Spawner Configurations
|
||||
+ // mob.checkSpawnRules is controlled by ignoreSpawnRules (via !skipMobSpecificRules)
|
||||
+ // mob.checkSpawnObstruction is controlled by spawnerBlockChecks (via !skipBlockChecks)
|
||||
+
|
||||
+ boolean mobSpecificRulesFailed = false;
|
||||
+ if (nextSpawnData.getCustomSpawnRules().isEmpty() && !skipMobSpecificRules) {
|
||||
+ if (!mob.checkSpawnRules(serverLevel, EntitySpawnReason.SPAWNER)) {
|
||||
+ mobSpecificRulesFailed = true;
|
||||
+ // Add light level check if enabled
|
||||
+ if (org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.lightLevelCheck) {
|
||||
+ int lightLevel = serverLevel.getMaxLocalRawBrightness(blockPos);
|
||||
+ if (lightLevel > maxAllowedLight(optional.get())) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ boolean obstructionFailed = false;
|
||||
+ if (!skipBlockChecks && !mob.checkSpawnObstruction(serverLevel)) { // If not skipping physical checks and obstruction fails
|
||||
+ obstructionFailed = true;
|
||||
+ // Add water check if enabled
|
||||
+ if (org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.waterPreventSpawnCheck &&
|
||||
+ serverLevel.getBlockState(blockPos).getFluidState().is(net.minecraft.tags.FluidTags.WATER)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (mobSpecificRulesFailed || obstructionFailed) {
|
||||
+ // Leaf end - Spawner Configurations
|
||||
+ // Determine if mob-specific spawn rules (like block types, biome requirements) should be skipped
|
||||
+ boolean skipMobSpecificRules = org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled &&
|
||||
+ org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.ignoreSpawnRules;
|
||||
+ // Leaf end - Spawner Configurations
|
||||
if (nextSpawnData.getCustomSpawnRules().isPresent()) {
|
||||
if (!optional.get().getCategory().isFriendly() && serverLevel.getDifficulty() == Difficulty.PEACEFUL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SpawnData.CustomSpawnRules customSpawnRules = nextSpawnData.getCustomSpawnRules().get();
|
||||
- if (!customSpawnRules.isValidPosition(blockPos, serverLevel)) {
|
||||
+ // customSpawnRules.isValidPosition is controlled by spawnerBlockChecks (via !skipBlockChecks)
|
||||
+ if (!skipBlockChecks && !customSpawnRules.isValidPosition(blockPos, serverLevel)) { // Leaf - Spawner Configurations
|
||||
continue;
|
||||
}
|
||||
- } else if (!SpawnPlacements.checkSpawnRules(
|
||||
+ } else if (!skipMobSpecificRules && !SpawnPlacements.checkSpawnRules( // Leaf - Spawner Configurations
|
||||
optional.get(), serverLevel, EntitySpawnReason.SPAWNER, blockPos, serverLevel.getRandom()
|
||||
)) {
|
||||
+ // If not skipping mob-specific rules AND standard spawn rules fail, continue.
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -231,10 +308,16 @@ public abstract class BaseSpawner {
|
||||
tag.read("SpawnData", SpawnData.CODEC).ifPresent(spawnData -> this.setNextSpawnData(level, pos, spawnData));
|
||||
this.spawnPotentials = tag.read("SpawnPotentials", SpawnData.LIST_CODEC)
|
||||
.orElseGet(() -> WeightedList.of(this.nextSpawnData != null ? this.nextSpawnData : new SpawnData()));
|
||||
@@ -161,6 +220,7 @@ public abstract class BaseSpawner {
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled || org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.spawnerMaxNearbyCheck) { // Leaf - Spawner Configurations - Skip max nearby entity check if disabled
|
||||
int size = serverLevel.getEntities(
|
||||
EntityTypeTest.forExactClass(entity.getClass()),
|
||||
new AABB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1).inflate(this.spawnRange),
|
||||
@@ -171,12 +231,29 @@ public abstract class BaseSpawner {
|
||||
this.delay(serverLevel, pos);
|
||||
return;
|
||||
}
|
||||
+ } // Leaf - Spawner Configurations
|
||||
|
||||
entity.preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; preserve entity motion from tag
|
||||
entity.snapTo(entity.getX(), entity.getY(), entity.getZ(), random.nextFloat() * 360.0F, 0.0F);
|
||||
if (entity instanceof Mob mob) {
|
||||
- if (nextSpawnData.getCustomSpawnRules().isEmpty() && !mob.checkSpawnRules(serverLevel, EntitySpawnReason.SPAWNER)
|
||||
- || !mob.checkSpawnObstruction(serverLevel)) {
|
||||
+ // Leaf start - Spawner Configurations
|
||||
+ // mob.checkSpawnRules is controlled by ignoreSpawnRules (via !skipMobSpecificRules)
|
||||
+ // mob.checkSpawnObstruction is controlled by spawnerBlockChecks (via !skipBlockChecks)
|
||||
+
|
||||
+ boolean mobSpecificRulesFailed = false;
|
||||
+ if (nextSpawnData.getCustomSpawnRules().isEmpty() && !skipMobSpecificRules) {
|
||||
+ if (!mob.checkSpawnRules(serverLevel, EntitySpawnReason.SPAWNER)) {
|
||||
+ mobSpecificRulesFailed = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ boolean obstructionFailed = false;
|
||||
+ if (!skipBlockChecks && !mob.checkSpawnObstruction(serverLevel)) { // If not skipping physical checks and obstruction fails
|
||||
+ obstructionFailed = true;
|
||||
+ }
|
||||
+
|
||||
+ if (mobSpecificRulesFailed || obstructionFailed) {
|
||||
+ // Leaf end - Spawner Configurations
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -244,10 +321,16 @@ public abstract class BaseSpawner {
|
||||
input.read("SpawnData", SpawnData.CODEC).ifPresent(spawnData -> this.setNextSpawnData(level, pos, spawnData));
|
||||
this.spawnPotentials = input.read("SpawnPotentials", SpawnData.LIST_CODEC)
|
||||
.orElseGet(() -> WeightedList.of(this.nextSpawnData != null ? this.nextSpawnData : new SpawnData()));
|
||||
+ // Leaf start - Spawner Configurations
|
||||
+ if (org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.enabled) {
|
||||
+ this.minSpawnDelay = org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.minSpawnDelay;
|
||||
+ this.maxSpawnDelay = org.dreeam.leaf.config.modules.gameplay.SpawnerSettings.maxSpawnDelay;
|
||||
+ } else {
|
||||
// Paper start - use int if set
|
||||
this.minSpawnDelay = tag.getIntOr("Paper.MinSpawnDelay", tag.getIntOr("MinSpawnDelay", 200));
|
||||
this.maxSpawnDelay = tag.getIntOr("Paper.MaxSpawnDelay", tag.getIntOr("MaxSpawnDelay", 800));
|
||||
this.minSpawnDelay = input.getIntOr("Paper.MinSpawnDelay", input.getIntOr("MinSpawnDelay", 200));
|
||||
this.maxSpawnDelay = input.getIntOr("Paper.MaxSpawnDelay", input.getIntOr("MaxSpawnDelay", 800));
|
||||
// Paper end - use int if set
|
||||
+ } // Leaf end - Spawner Configurations
|
||||
this.spawnCount = tag.getIntOr("SpawnCount", 4);
|
||||
this.maxNearbyEntities = tag.getIntOr("MaxNearbyEntities", 6);
|
||||
this.requiredPlayerRange = tag.getIntOr("RequiredPlayerRange", 16);
|
||||
this.spawnCount = input.getIntOr("SpawnCount", 4);
|
||||
this.maxNearbyEntities = input.getIntOr("MaxNearbyEntities", 6);
|
||||
this.requiredPlayerRange = input.getIntOr("RequiredPlayerRange", 16);
|
||||
|
||||
@@ -80,18 +80,18 @@ index 582e012222123e5001c34153f2ee1ab1d08935fd..c0bce2293d07ca58cc5bc9e036ab8dca
|
||||
List<org.bukkit.block.BlockState> states = new java.util.ArrayList<>(level.capturedBlockStates.values());
|
||||
level.capturedBlockStates.clear();
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 4bf840705bec251aa7e5595fa16bf8e1a9a7d2e9..543bdb926426bfd5be01d0c23e8c9e274b94485c 100644
|
||||
index b66bec748d87151eafe8a055c3b659477c042092..212fe44eee637695555af510ea7c6800a52e6842 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -290,6 +290,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -291,6 +291,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public boolean lagging = false; // Purpur - Lagging threshold
|
||||
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
|
||||
public final Set<net.minecraft.world.entity.Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
+ public java.util.concurrent.Semaphore serverLevelTickingSemaphore = null; // SparklyPaper - parallel world ticking
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||
@@ -321,24 +322,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system
|
||||
@@ -323,24 +324,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private long lastMidTickExecute;
|
||||
private long lastMidTickExecuteFailure;
|
||||
|
||||
@@ -141,7 +141,7 @@ index 4bf840705bec251aa7e5595fa16bf8e1a9a7d2e9..543bdb926426bfd5be01d0c23e8c9e27
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -915,6 +928,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -917,6 +930,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
serverLevel.save(null, flush, serverLevel.noSave && !forced, close); // Paper - add close param
|
||||
@@ -154,7 +154,7 @@ index 4bf840705bec251aa7e5595fa16bf8e1a9a7d2e9..543bdb926426bfd5be01d0c23e8c9e27
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -1660,6 +1679,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1662,6 +1681,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ index 4bf840705bec251aa7e5595fa16bf8e1a9a7d2e9..543bdb926426bfd5be01d0c23e8c9e27
|
||||
protected void tickChildren(BooleanSupplier hasTimeLeft) {
|
||||
this.getPlayerList().getPlayers().forEach(serverPlayer1 -> serverPlayer1.connection.suspendFlushing());
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
@@ -1726,28 +1757,50 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1728,28 +1759,50 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||
@@ -242,7 +242,7 @@ index 4bf840705bec251aa7e5595fa16bf8e1a9a7d2e9..543bdb926426bfd5be01d0c23e8c9e27
|
||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
|
||||
this.tickConnection();
|
||||
@@ -1827,6 +1880,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1829,6 +1882,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
Map<ResourceKey<Level>, ServerLevel> oldLevels = this.levels;
|
||||
Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels);
|
||||
newLevels.remove(level.dimension());
|
||||
@@ -252,7 +252,7 @@ index 4bf840705bec251aa7e5595fa16bf8e1a9a7d2e9..543bdb926426bfd5be01d0c23e8c9e27
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
||||
index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff3a994f91 100644
|
||||
index 4bf87ebb49880b8e09203a48fce6371398281561..27bbe0c43dd9b7f8bf932a6b4825ce2cb1996d48 100644
|
||||
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -53,8 +53,11 @@ public class PlayerAdvancements {
|
||||
@@ -277,7 +277,7 @@ index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff
|
||||
this.isFirstPacket = true;
|
||||
this.lastSelectedTab = null;
|
||||
this.tree = manager.tree();
|
||||
@@ -151,7 +155,7 @@ public class PlayerAdvancements {
|
||||
@@ -150,7 +154,7 @@ public class PlayerAdvancements {
|
||||
if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.ignoredAdvancements) LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", path, this.playerSavePath); // Gale - Purpur - do not log ignored advancements
|
||||
} else {
|
||||
this.startProgress(advancementHolder, progress);
|
||||
@@ -286,7 +286,7 @@ index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff
|
||||
this.markForVisibilityUpdate(advancementHolder);
|
||||
}
|
||||
});
|
||||
@@ -183,10 +187,12 @@ public class PlayerAdvancements {
|
||||
@@ -182,10 +186,12 @@ public class PlayerAdvancements {
|
||||
return false;
|
||||
}
|
||||
// Paper end - Add PlayerAdvancementCriterionGrantEvent
|
||||
@@ -303,7 +303,7 @@ index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff
|
||||
// Paper start - Add Adventure message to PlayerAdvancementDoneEvent
|
||||
final net.kyori.adventure.text.Component message = advancement.value().display().flatMap(info -> {
|
||||
return java.util.Optional.ofNullable(
|
||||
@@ -220,12 +226,14 @@ public class PlayerAdvancements {
|
||||
@@ -219,12 +225,14 @@ public class PlayerAdvancements {
|
||||
AdvancementProgress orStartProgress = this.getOrStartProgress(advancement);
|
||||
boolean isDone = orStartProgress.isDone();
|
||||
if (orStartProgress.revokeProgress(criterionKey)) {
|
||||
@@ -321,7 +321,7 @@ index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff
|
||||
this.markForVisibilityUpdate(advancement);
|
||||
}
|
||||
|
||||
@@ -271,7 +279,10 @@ public class PlayerAdvancements {
|
||||
@@ -270,7 +278,10 @@ public class PlayerAdvancements {
|
||||
}
|
||||
|
||||
public void flushDirty(ServerPlayer player, boolean showAdvancements) {
|
||||
@@ -333,7 +333,7 @@ index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff
|
||||
Map<ResourceLocation, AdvancementProgress> map = new HashMap<>();
|
||||
Set<AdvancementHolder> set = new java.util.TreeSet<>(java.util.Comparator.comparing(adv -> adv.id().toString())); // Paper - Changed from HashSet to TreeSet ordered alphabetically.
|
||||
Set<ResourceLocation> set1 = new HashSet<>();
|
||||
@@ -279,16 +290,24 @@ public class PlayerAdvancements {
|
||||
@@ -278,16 +289,24 @@ public class PlayerAdvancements {
|
||||
for (AdvancementNode advancementNode : this.rootsToUpdate) {
|
||||
this.updateTreeVisibility(advancementNode, set, set1);
|
||||
}
|
||||
@@ -362,7 +362,7 @@ index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff
|
||||
if (!map.isEmpty() || !set.isEmpty() || !set1.isEmpty()) {
|
||||
player.connection.send(new ClientboundUpdateAdvancementsPacket(this.isFirstPacket, set, set1, map, showAdvancements));
|
||||
}
|
||||
@@ -331,10 +350,13 @@ public class PlayerAdvancements {
|
||||
@@ -330,10 +349,13 @@ public class PlayerAdvancements {
|
||||
AdvancementHolder advancementHolder = node.holder();
|
||||
if (visible) {
|
||||
if (this.visible.add(advancementHolder)) {
|
||||
@@ -379,7 +379,7 @@ index 10ac7393d20a0857be2bfdd856dda448699b3eff..53d081aceaa602cdc77018b434edc6ff
|
||||
} else if (this.visible.remove(advancementHolder)) {
|
||||
idOutput.add(advancementHolder.id());
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 54910c2e1d6e6bb556e536fda060bd09402e04e8..72e871b8c7fee9b5cbd567e03baee80ee4b9c82e 100644
|
||||
index 5af545d4ad93bcd2a9dce7035d750bb19da0f3b2..50630dabe4220b8ac810a0395d70360879fdeabc 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -198,6 +198,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -396,7 +396,7 @@ index 54910c2e1d6e6bb556e536fda060bd09402e04e8..72e871b8c7fee9b5cbd567e03baee80e
|
||||
|
||||
// Gale start - Pufferfish - SIMD support
|
||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 6d5a15122079f2d1568ceb7086db21ad454f58e6..9dd6205e1cdd2124ab9d91f0a1e344eb6aa1fb2e 100644
|
||||
index eaaa66c4d86d4ebda0acf8f1dbe8ecb55aa28285..12cf6dc9bac109a4feeeeede5f3762b20ea582bb 100644
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -175,7 +175,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -409,19 +409,19 @@ index 6d5a15122079f2d1568ceb7086db21ad454f58e6..9dd6205e1cdd2124ab9d91f0a1e344eb
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e053787d0 100644
|
||||
index 3a31f9132a7271ea476cc85c5a10ea7f327256bf..61ccb98e02f30b143226b110d5b5f7316606844d 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -178,7 +178,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -180,7 +180,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
private final MinecraftServer server;
|
||||
public final net.minecraft.world.level.storage.PrimaryLevelData serverLevelData; // CraftBukkit - type
|
||||
private int lastSpawnChunkRadius;
|
||||
- final EntityTickList entityTickList = new EntityTickList();
|
||||
+ final EntityTickList entityTickList = new EntityTickList(this); // SparklyPaper - parallel world ticking
|
||||
private final ServerWaypointManager waypointManager;
|
||||
// Paper - rewrite chunk system
|
||||
private final GameEventDispatcher gameEventDispatcher;
|
||||
public boolean noSave;
|
||||
@@ -204,6 +204,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -207,6 +207,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
private double preciseTime; // Purpur - Configurable daylight cycle
|
||||
private boolean forceTime; // Purpur - Configurable daylight cycle
|
||||
private final RandomSequences randomSequences;
|
||||
@@ -431,7 +431,7 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
|
||||
// CraftBukkit start
|
||||
public final LevelStorageSource.LevelStorageAccess levelStorageAccess;
|
||||
@@ -693,8 +696,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -697,8 +700,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
|
||||
this.realPlayers = Lists.newArrayList(); // Leaves - skip
|
||||
@@ -458,7 +458,7 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean hasChunk(int chunkX, int chunkZ) {
|
||||
@@ -727,8 +748,112 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -731,8 +752,112 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
public Player[] eligibleDespawnCheckingPlayerCache = new Player[0]; // Leaf - Cache eligible players for despawn checks
|
||||
|
||||
@@ -571,7 +571,7 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
TickRateManager tickRateManager = this.tickRateManager();
|
||||
boolean runsNormally = tickRateManager.runsNormally();
|
||||
if (runsNormally) {
|
||||
@@ -736,6 +861,14 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -740,6 +865,14 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
this.advanceWeatherCycle();
|
||||
}
|
||||
|
||||
@@ -586,7 +586,7 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(_int) && this.sleepStatus.areEnoughDeepSleeping(_int, this.players)) { // Purpur - Config for skipping night
|
||||
// Paper start - create time skip event - move up calculations
|
||||
@@ -1309,9 +1442,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1317,9 +1450,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
fluidState.tick(this, pos, blockState);
|
||||
}
|
||||
// Paper start - rewrite chunk system
|
||||
@@ -601,7 +601,7 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
}
|
||||
@@ -1322,9 +1458,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1330,9 +1466,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
blockState.tick(this, pos, this.random);
|
||||
}
|
||||
// Paper start - rewrite chunk system
|
||||
@@ -616,7 +616,7 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
}
|
||||
@@ -1575,6 +1714,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1597,6 +1736,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
|
||||
private void addPlayer(ServerPlayer player) {
|
||||
@@ -625,7 +625,7 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
Entity entity = this.getEntity(player.getUUID());
|
||||
if (entity != null) {
|
||||
LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID());
|
||||
@@ -1587,7 +1728,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1609,7 +1750,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
// CraftBukkit start
|
||||
private boolean addEntity(Entity entity, @Nullable org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
|
||||
@@ -640,18 +640,18 @@ index 2ecb73fc7b6754ade93bf16b48c623e6b3a955a9..85bfc91ff163a2a564b7b610e27ff90e
|
||||
// Paper start - extra debug info
|
||||
if (entity.valid) {
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index d507544efafe74ecaffd6a063eff152d349ec76a..bc955da0dff79262dace84d255f27b3271a91ca5 100644
|
||||
index d6f4c267a819a7ef37a16ad0ea5ad56c12682c33..f1d9fdda9a1d6c0374585fc60ad9354af36efa13 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -456,6 +456,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -467,6 +467,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
return this.viewDistanceHolder;
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
+ public boolean hasTickedAtLeastOnceInNewWorld = false; // SparklyPaper - parallel world ticking (fixes bug in DreamResourceReset where the inventory is opened AFTER the player has changed worlds, if you click with the quick tp torch in a chest, because the inventory is opened AFTER the player has teleported)
|
||||
|
||||
public ServerPlayer(MinecraftServer server, ServerLevel level, GameProfile gameProfile, ClientInformation clientInformation) {
|
||||
super(level, level.getSharedSpawnPos(), level.getSharedSpawnAngle(), gameProfile);
|
||||
@@ -749,6 +750,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
super(level, gameProfile);
|
||||
@@ -754,6 +755,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -659,7 +659,7 @@ index d507544efafe74ecaffd6a063eff152d349ec76a..bc955da0dff79262dace84d255f27b32
|
||||
// CraftBukkit start
|
||||
if (this.joining) {
|
||||
this.joining = false;
|
||||
@@ -1398,6 +1400,8 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1430,6 +1432,8 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
teleportTransition.postTeleportTransition().onTransition(this);
|
||||
return this;
|
||||
} else {
|
||||
@@ -668,7 +668,7 @@ index d507544efafe74ecaffd6a063eff152d349ec76a..bc955da0dff79262dace84d255f27b32
|
||||
// CraftBukkit start
|
||||
/*
|
||||
this.isChangingDimension = true;
|
||||
@@ -1747,6 +1751,12 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1783,6 +1787,12 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
return OptionalInt.empty();
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
@@ -681,7 +681,7 @@ index d507544efafe74ecaffd6a063eff152d349ec76a..bc955da0dff79262dace84d255f27b32
|
||||
this.containerMenu = abstractContainerMenu; // Moved up
|
||||
if (!this.isImmobile())
|
||||
this.connection
|
||||
@@ -1811,6 +1821,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1847,6 +1857,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
}
|
||||
@Override
|
||||
public void closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) {
|
||||
@@ -694,10 +694,10 @@ index d507544efafe74ecaffd6a063eff152d349ec76a..bc955da0dff79262dace84d255f27b32
|
||||
// Paper end - Inventory close reason
|
||||
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 411ccee65f5658347839ca7d0fffeedc1f2814ce..f581fe86fea41bb5ff8f93e3422548ae7693a868 100644
|
||||
index 31cc3575ae6579acf02490476d0e090557e28d95..42822499ad559bce6734a16056d6e04cef318569 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -252,6 +252,8 @@ public abstract class PlayerList {
|
||||
@@ -251,6 +251,8 @@ public abstract class PlayerList {
|
||||
// Leaves end - replay mod api
|
||||
|
||||
public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie cookie) {
|
||||
@@ -706,7 +706,7 @@ index 411ccee65f5658347839ca7d0fffeedc1f2814ce..f581fe86fea41bb5ff8f93e3422548ae
|
||||
player.isRealPlayer = true; // Paper
|
||||
player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed
|
||||
GameProfile gameProfile = player.getGameProfile();
|
||||
@@ -892,6 +894,15 @@ public abstract class PlayerList {
|
||||
@@ -888,6 +890,15 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public ServerPlayer respawn(ServerPlayer player, boolean keepInventory, Entity.RemovalReason reason, @Nullable org.bukkit.event.player.PlayerRespawnEvent.RespawnReason eventReason, @Nullable org.bukkit.Location location) {
|
||||
@@ -722,7 +722,7 @@ index 411ccee65f5658347839ca7d0fffeedc1f2814ce..f581fe86fea41bb5ff8f93e3422548ae
|
||||
player.stopRiding(); // CraftBukkit
|
||||
this.players.remove(player);
|
||||
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
|
||||
@@ -903,6 +914,7 @@ public abstract class PlayerList {
|
||||
@@ -899,6 +910,7 @@ public abstract class PlayerList {
|
||||
ServerPlayer serverPlayer = player;
|
||||
Level fromWorld = player.level();
|
||||
player.wonGame = false;
|
||||
@@ -731,10 +731,10 @@ index 411ccee65f5658347839ca7d0fffeedc1f2814ce..f581fe86fea41bb5ff8f93e3422548ae
|
||||
serverPlayer.connection = player.connection;
|
||||
serverPlayer.restoreFrom(player, keepInventory);
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 69521086fca0c9fbc230817062b65c4269c575fd..82096e6b187e63ad3e848b9757ba2152e8c642b4 100644
|
||||
index 2e5d4b8fc6a0ec6692eac63bce13b3f32d3f3e76..602b0ce96cdc8ebd8d875f1dadfc2fdfe6aa0bad 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -3321,15 +3321,40 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3510,15 +3510,40 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
if (this.portalProcess != null) {
|
||||
if (this.portalProcess.processPortalTeleportation(serverLevel, this, this.canUsePortal(false))) {
|
||||
this.setPortalCooldown();
|
||||
@@ -782,10 +782,10 @@ index 69521086fca0c9fbc230817062b65c4269c575fd..82096e6b187e63ad3e848b9757ba2152
|
||||
} else if (this.portalProcess.hasExpired()) {
|
||||
this.portalProcess = null;
|
||||
}
|
||||
@@ -3894,6 +3919,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4095,6 +4120,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
private Entity teleportCrossDimension(ServerLevel level, TeleportTransition teleportTransition) {
|
||||
private Entity teleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition teleportTransition) {
|
||||
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled) // Leaf - SparklyPaper - parallel world ticking mod (make configurable)
|
||||
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(level, "Cannot teleport entity to another world off-main, from world " + this.level.getWorld().getName() + " to world " + level.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
|
||||
List<Entity> passengers = this.getPassengers();
|
||||
@@ -905,10 +905,10 @@ index 3614551856c594f3c0cfee984fcf03fad672b007..f4577f908ca9f279b72d89e5b0822d34
|
||||
});
|
||||
entity.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 5cc4b2a0d10b25c57c582772ac6757442780afb0..92895a38c5ef7962db83e085a99c0b3766052541 100644
|
||||
index 806f05a24ac37a4f012a931699a99632424a428f..8257c0d5bd7105c34e310b1a4da99b3cc5f02ac2 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -795,13 +795,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -797,13 +797,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
this.brain.getMemory(moduleType).ifPresent(pos -> {
|
||||
ServerLevel level = server.getLevel(pos.dimension());
|
||||
if (level != null) {
|
||||
@@ -938,10 +938,10 @@ index 5cc4b2a0d10b25c57c582772ac6757442780afb0..92895a38c5ef7962db83e085a99c0b37
|
||||
});
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||
index 6575e8ef16f6011f7a799ba31531a2ebefee0c4d..a3ee65c9b7544b791f11c0c475ec9e0390be95a7 100644
|
||||
index 2258736e6f9f52efe5bd353b8949a7a0b9a4fdb8..aa71eca6cd69cfa79b84cb181c25c4be8e4511b2 100644
|
||||
--- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||
@@ -122,8 +122,10 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||
@@ -119,8 +119,10 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||
Vec3 vec3 = this.oldPosition();
|
||||
if (owner instanceof ServerPlayer serverPlayer) {
|
||||
if (serverPlayer.connection.isAcceptingMessages()) {
|
||||
@@ -953,19 +953,18 @@ index 6575e8ef16f6011f7a799ba31531a2ebefee0c4d..a3ee65c9b7544b791f11c0c475ec9e03
|
||||
if (serverPlayer1 == null) {
|
||||
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT);
|
||||
return;
|
||||
@@ -152,10 +154,17 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||
@@ -149,10 +151,16 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||
if (serverPlayer1 != null) {
|
||||
serverPlayer1.resetFallDistance();
|
||||
serverPlayer1.resetCurrentImpulseContext();
|
||||
- serverPlayer1.hurtServer(serverPlayer.serverLevel(), this.damageSources().enderPearl().eventEntityDamager(this), this.level().purpurConfig.enderPearlDamage); // CraftBukkit // Paper - fix DamageSource API // Purpur - Configurable Ender Pearl damage
|
||||
+ serverPlayer1.hurtServer(taskServerPlayer.serverLevel(), this.damageSources().enderPearl().eventEntityDamager(this), this.level().purpurConfig.enderPearlDamage); // CraftBukkit // Paper - fix DamageSource API // Purpur - Configurable Ender Pearl damage
|
||||
- serverPlayer1.hurtServer(serverPlayer.level(), this.damageSources().enderPearl().eventEntityDamager(this), this.level().purpurConfig.enderPearlDamage); // CraftBukkit // Paper - fix DamageSource API // Purpur - Configurable Ender Pearl damage
|
||||
+ serverPlayer1.hurtServer(taskServerPlayer.level(), this.damageSources().enderPearl().eventEntityDamager(this), this.level().purpurConfig.enderPearlDamage); // CraftBukkit // Paper - fix DamageSource API // Purpur - Configurable Ender Pearl damage
|
||||
}
|
||||
|
||||
this.playSound(serverLevel, vec3);
|
||||
+ };
|
||||
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled)
|
||||
+ serverPlayer.getBukkitEntity().taskScheduler.schedule(teleportPlayerCrossDimensionTask, entity -> {
|
||||
+ }, 0);
|
||||
+ serverPlayer.getBukkitEntity().taskScheduler.schedule(teleportPlayerCrossDimensionTask, entity -> {}, 0);
|
||||
+ else
|
||||
+ teleportPlayerCrossDimensionTask.accept(serverPlayer);
|
||||
+ // Leaf end - SparklyPaper - parallel world ticking mod (handling for pearl teleportation cross-dimension)
|
||||
@@ -992,10 +991,10 @@ index c4721eb0efe34f5e313bc890b4e960144eca4fe1..9dd3187fd968ab95e9d55b4c8cc74e78
|
||||
this.containerId = containerId;
|
||||
}
|
||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||
index 07f1b27116baf2a06e6cd4eeaa8639e166fb362d..1a5f65a32882aa43828305113f35a9cdb0bdb870 100644
|
||||
index 793c0a380b84d246db748be7e8807f1c0fa92d65..7cf8894b1fd6283567dca0b7d0b945b2fbae1b8c 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -406,8 +406,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -398,8 +398,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
if (interactionResult.consumesAction() && serverLevel.captureTreeGeneration && !serverLevel.capturedBlockStates.isEmpty()) {
|
||||
serverLevel.captureTreeGeneration = false;
|
||||
org.bukkit.Location location = org.bukkit.craftbukkit.util.CraftLocation.toBukkit(clickedPos, serverLevel.getWorld());
|
||||
@@ -1007,18 +1006,18 @@ index 07f1b27116baf2a06e6cd4eeaa8639e166fb362d..1a5f65a32882aa43828305113f35a9cd
|
||||
serverLevel.capturedBlockStates.clear();
|
||||
org.bukkit.event.world.StructureGrowEvent structureEvent = null;
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index 22da84734462d09a55bc599db4374e1e4f4d6bd2..c8219508cf94da71143b8672661592c66b341782 100644
|
||||
index f9fa85f110c1ea167bc7464a8593942c645ece13..a1c2d2e5de4b992e62ff6d849a1e72a453a6e56e 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -164,6 +164,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
}
|
||||
@@ -165,6 +165,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
// Gale end - Gale configuration
|
||||
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
|
||||
+ public io.papermc.paper.redstone.RedstoneWireTurbo turbo = new io.papermc.paper.redstone.RedstoneWireTurbo((net.minecraft.world.level.block.RedStoneWireBlock) net.minecraft.world.level.block.Blocks.REDSTONE_WIRE); // SparklyPaper - parallel world ticking (moved to world)
|
||||
|
||||
public static @Nullable BlockPos lastPhysicsProblem; // Spigot
|
||||
private int tileTickPosition;
|
||||
@@ -1136,6 +1137,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
public final Map<ServerExplosion.CacheKey, Float> explosionDensityCache = new java.util.HashMap<>(); // Paper - Optimize explosions
|
||||
@@ -1137,6 +1138,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
|
||||
@Override
|
||||
public boolean setBlock(BlockPos pos, BlockState state, int flags, int recursionLeft) {
|
||||
@@ -1027,7 +1026,7 @@ index 22da84734462d09a55bc599db4374e1e4f4d6bd2..c8219508cf94da71143b8672661592c6
|
||||
// CraftBukkit start - tree generation
|
||||
if (this.captureTreeGeneration) {
|
||||
// Paper start - Protect Bedrock and End Portal/Frames from being destroyed
|
||||
@@ -1514,9 +1517,12 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1515,9 +1518,12 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
} else if (runsNormally && this.shouldTickBlocksAt(tickingBlockEntity.getPos())) {
|
||||
tickingBlockEntity.tick();
|
||||
// Paper start - rewrite chunk system
|
||||
@@ -1042,7 +1041,7 @@ index 22da84734462d09a55bc599db4374e1e4f4d6bd2..c8219508cf94da71143b8672661592c6
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
}
|
||||
@@ -1537,7 +1543,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1538,7 +1544,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
|
||||
// Paper end - Prevent block entity and entity crashes
|
||||
}
|
||||
@@ -1052,16 +1051,16 @@ index 22da84734462d09a55bc599db4374e1e4f4d6bd2..c8219508cf94da71143b8672661592c6
|
||||
}
|
||||
|
||||
// Paper start - Option to prevent armor stands from doing entity lookups
|
||||
@@ -1680,6 +1687,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
|
||||
@@ -1675,6 +1682,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@Nullable
|
||||
public BlockEntity getBlockEntity(BlockPos pos, boolean validate) {
|
||||
@Override
|
||||
public BlockEntity getBlockEntity(BlockPos pos) {
|
||||
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled) // Leaf start - SparklyPaper - parallel world ticking mod (make configurable)
|
||||
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThreadOrAsyncThread((ServerLevel) this, "Cannot read world asynchronously"); // SparklyPaper - parallel world ticking
|
||||
// Paper start - Perf: Optimize capturedTileEntities lookup
|
||||
net.minecraft.world.level.block.entity.BlockEntity blockEntity;
|
||||
if (!this.capturedTileEntities.isEmpty() && (blockEntity = this.capturedTileEntities.get(pos)) != null) {
|
||||
@@ -1697,6 +1706,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1691,6 +1700,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
}
|
||||
|
||||
public void setBlockEntity(BlockEntity blockEntity) {
|
||||
@@ -1070,7 +1069,7 @@ index 22da84734462d09a55bc599db4374e1e4f4d6bd2..c8219508cf94da71143b8672661592c6
|
||||
BlockPos blockPos = blockEntity.getBlockPos();
|
||||
if (!this.isOutsideBuildHeight(blockPos)) {
|
||||
// CraftBukkit start
|
||||
@@ -1781,6 +1792,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1775,6 +1786,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
|
||||
@Override
|
||||
public List<Entity> getEntities(@Nullable Entity entity, AABB boundingBox, Predicate<? super Entity> predicate) {
|
||||
@@ -1079,7 +1078,7 @@ index 22da84734462d09a55bc599db4374e1e4f4d6bd2..c8219508cf94da71143b8672661592c6
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
|
||||
// Paper start - rewrite chunk system
|
||||
@@ -2099,8 +2112,15 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -2097,8 +2110,15 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
public abstract RecipeAccess recipeAccess();
|
||||
|
||||
public BlockPos getBlockRandomPos(int x, int y, int z, int yMask) {
|
||||
@@ -1292,10 +1291,10 @@ index a22cb810622e0ae97bc2a0d6390d026d9482b783..3e7478e959da3a0191de6c76b80cbb9b
|
||||
}
|
||||
if (event == null || !event.isCancelled()) {
|
||||
diff --git a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
index c63370fd458fb4f7190b79b1a8174fcc92d88f9c..5d3d3db955927647f5498eac0d67d3198b27f8cd 100644
|
||||
index 5a094257a31f0500278a706a418e1697f8810ffb..d18b29346a44004bba4bac8ffb9d2db05fc65fd6 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
@@ -79,6 +79,12 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
@@ -76,6 +76,12 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
}
|
||||
|
||||
public static boolean canUnlock(Player player, LockCode code, Component displayName, @Nullable BlockEntity blockEntity) {
|
||||
@@ -1309,7 +1308,7 @@ index c63370fd458fb4f7190b79b1a8174fcc92d88f9c..5d3d3db955927647f5498eac0d67d319
|
||||
final org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(blockEntity.getLevel(), blockEntity.getBlockPos());
|
||||
net.kyori.adventure.text.Component lockedMessage = net.kyori.adventure.text.Component.translatable("container.isLocked", io.papermc.paper.adventure.PaperAdventure.asAdventure(displayName));
|
||||
diff --git a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
||||
index 440d70811d96f97d3463c6aff131cbc5bd588254..a3178392325ca186f1c68143df7d1f499f6e762c 100644
|
||||
index 83c811eb5e493fa6630f16c206787f227fde089b..30f73951d7fe69be0f094a70d4e28f08f715fbc0 100644
|
||||
--- a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
||||
@@ -43,9 +43,9 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi
|
||||
@@ -1410,10 +1409,10 @@ index d23f255de9208f42125fa358a9e8194c984fe4d3..c3acc0a875c0bf697b6b101051d80b34
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 5325989f46bd288c5a6f1362ec17d3354d55abfd..8d8d909c4b9496ae6f44ba34203ee40433d37f8c 100644
|
||||
index 65442f9ab1528fd1b736963bc51f21fd6a0781a0..7538f9c84e8463502f4fa1b4a84a4ac84a11e87d 100644
|
||||
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -399,6 +399,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -401,6 +401,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockState setBlockState(BlockPos pos, BlockState state, int flags) {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] SparklyPaper: Track each world MSPT
|
||||
Original project: https://github.com/SparklyPower/SparklyPaper
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 543bdb926426bfd5be01d0c23e8c9e274b94485c..9933a60db91d68f76df33ccddea0852fd59b8983 100644
|
||||
index 212fe44eee637695555af510ea7c6800a52e6842..eb3f6e638147c46e0cdb04d9c4bd08b11cff7347 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1682,7 +1682,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1684,7 +1684,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Leaf start - SparklyPaper - parallel world ticking mod (move level ticking logic out for branch convergence)
|
||||
private void tickLevel(ServerLevel serverLevel, BooleanSupplier hasTimeLeft) {
|
||||
try {
|
||||
@@ -27,10 +27,10 @@ index 543bdb926426bfd5be01d0c23e8c9e274b94485c..9933a60db91d68f76df33ccddea0852f
|
||||
CrashReport crashReport = CrashReport.forThrowable(levelTickingException, "Exception ticking world");
|
||||
serverLevel.fillReportDetails(crashReport);
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 85bfc91ff163a2a564b7b610e27ff90e053787d0..f4b9d0bcf305d99d39e530c3369faaec60bbc5a8 100644
|
||||
index 61ccb98e02f30b143226b110d5b5f7316606844d..4e1ff6c3ae2dea86c51c286876371d491d9f66de 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -567,6 +567,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -570,6 +570,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
// Paper end - chunk tick iteration
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ Leaf: ~48ms (-36%)
|
||||
This should help drastically on the farms that use actively changing fluids.
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index f4b9d0bcf305d99d39e530c3369faaec60bbc5a8..a311f81b7f34f2c988ebcd792ca87dfd7b175f96 100644
|
||||
index 4e1ff6c3ae2dea86c51c286876371d491d9f66de..173ea626bed0707840c1f844b38c154d85adde3f 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1441,6 +1441,10 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1449,6 +1449,10 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
this.emptyTime = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,10 +163,10 @@ index 345d4b80bd4383e0fb66d744d87bc8ef4100fd32..a2da4fce50f31d56036d04041c4f80ed
|
||||
|
||||
private static boolean isRightDistanceToPlayerAndSpawnPoint(ServerLevel level, ChunkAccess chunk, BlockPos.MutableBlockPos pos, double distance) {
|
||||
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
index 6683df8d0f5a61ab094393f761a3d3a22d6e0455..4fd9313ce2c87383685d80e2533b93d5b85a9f41 100644
|
||||
index 686c031ec73acc80683aaa39a78fe9221f0215a6..d7dbe7d24a6697be6b5db729f940b16b74838d11 100644
|
||||
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
@@ -91,6 +91,7 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
@@ -92,6 +92,7 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
private boolean slimeChunk;
|
||||
private boolean hasComputedSlimeChunk;
|
||||
// Leaf end - Matter - Secure Seed
|
||||
@@ -175,10 +175,10 @@ index 6683df8d0f5a61ab094393f761a3d3a22d6e0455..4fd9313ce2c87383685d80e2533b93d5
|
||||
// Paper start - rewrite chunk system
|
||||
private volatile ca.spottedleaf.moonrise.patches.starlight.light.SWMRNibbleArray[] blockNibbles;
|
||||
diff --git a/net/minecraft/world/level/chunk/storage/SerializableChunkData.java b/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
|
||||
index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a9fb028ea 100644
|
||||
index e04d3479383cd480cf35ed7ac3c82e7f6fb69e28..ab1fc7ca0639f9e71933f623258bb8d123988262 100644
|
||||
--- a/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
|
||||
@@ -92,6 +92,7 @@ public record SerializableChunkData(
|
||||
@@ -94,6 +94,7 @@ public record SerializableChunkData(
|
||||
List<CompoundTag> blockEntities,
|
||||
CompoundTag structureData
|
||||
, @Nullable net.minecraft.nbt.Tag persistentDataContainer // CraftBukkit - persistentDataContainer
|
||||
@@ -186,7 +186,7 @@ index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a
|
||||
) {
|
||||
public static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codecRW(
|
||||
Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState(), null // Paper - Anti-Xray
|
||||
@@ -188,6 +189,19 @@ public record SerializableChunkData(
|
||||
@@ -190,6 +191,19 @@ public record SerializableChunkData(
|
||||
lists[i] = list2;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a
|
||||
List<CompoundTag> list3 = tag.getList("entities").stream().flatMap(ListTag::compoundStream).toList();
|
||||
List<CompoundTag> list4 = tag.getList("block_entities").stream().flatMap(ListTag::compoundStream).toList();
|
||||
CompoundTag compoundOrEmpty = tag.getCompoundOrEmpty("structures");
|
||||
@@ -268,6 +282,7 @@ public record SerializableChunkData(
|
||||
@@ -270,6 +284,7 @@ public record SerializableChunkData(
|
||||
list4,
|
||||
compoundOrEmpty
|
||||
, tag.get("ChunkBukkitValues") // CraftBukkit - ChunkBukkitValues
|
||||
@@ -214,7 +214,7 @@ index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -424,6 +439,15 @@ public record SerializableChunkData(
|
||||
@@ -426,6 +441,15 @@ public record SerializableChunkData(
|
||||
chunkAccess.addPackedPostProcess(this.postProcessingSections[i], i);
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a
|
||||
if (chunkType == ChunkType.LEVELCHUNK) {
|
||||
return this.loadStarlightLightData(level, new ImposterProtoChunk((LevelChunk)chunkAccess, false)); // Paper - starlight
|
||||
} else {
|
||||
@@ -554,6 +578,7 @@ public record SerializableChunkData(
|
||||
@@ -556,6 +580,7 @@ public record SerializableChunkData(
|
||||
persistentDataContainer = chunk.persistentDataContainer.toTagCompound();
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -238,7 +238,7 @@ index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a
|
||||
return new SerializableChunkData(
|
||||
level.registryAccess().lookupOrThrow(Registries.BIOME),
|
||||
pos,
|
||||
@@ -574,6 +599,7 @@ public record SerializableChunkData(
|
||||
@@ -576,6 +601,7 @@ public record SerializableChunkData(
|
||||
list1,
|
||||
compoundTag
|
||||
, persistentDataContainer // CraftBukkit - persistentDataContainer
|
||||
@@ -246,7 +246,7 @@ index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -658,6 +684,21 @@ public record SerializableChunkData(
|
||||
@@ -660,6 +686,21 @@ public record SerializableChunkData(
|
||||
compoundTag.put("ChunkBukkitValues", this.persistentDataContainer);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -268,7 +268,7 @@ index 749096358fccbd5d1d13801092255c51096eb001..ccec1b847ba1a3667206cbeac4ed541a
|
||||
// Paper start - starlight
|
||||
if (this.lightCorrect && !this.chunkStatus.isBefore(net.minecraft.world.level.chunk.status.ChunkStatus.LIGHT)) {
|
||||
// clobber vanilla value to force vanilla to relight
|
||||
@@ -865,4 +906,50 @@ public record SerializableChunkData(
|
||||
@@ -875,4 +916,50 @@ public record SerializableChunkData(
|
||||
}
|
||||
// Paper end - starlight - convert from record
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ Leaf (After): ~628ms (-96%)
|
||||
This should help for massive hopper chains or hopper matrix.
|
||||
|
||||
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 8d8d909c4b9496ae6f44ba34203ee40433d37f8c..e82e55ec400c5e338502ed7ce433372a88d4acff 100644
|
||||
index 7538f9c84e8463502f4fa1b4a84a4ac84a11e87d..514a918fff9bf60293fbfa6def4a2f9fead30825 100644
|
||||
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -1016,15 +1016,29 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1023,15 +1023,29 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
static class RebindableTickingBlockEntityWrapper implements TickingBlockEntity {
|
||||
private TickingBlockEntity ticker;
|
||||
private BlockPos cachedPos; // Leaf - Cache tile entity position
|
||||
@@ -43,7 +43,7 @@ index 8d8d909c4b9496ae6f44ba34203ee40433d37f8c..e82e55ec400c5e338502ed7ce433372a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1034,6 +1048,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1041,6 +1055,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() {
|
||||
|
||||
@@ -8,7 +8,7 @@ Integrated with Imanity Software's Raytrace AntiXray for better performance
|
||||
Original project: https://github.com/Imanity-Software/raytrace-antixray-spigot-sdk
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 3a596650feb96123c5684bb5065e20c5b005c0b9..f7a05fd098ef7b303254cd410414d50d68225395 100644
|
||||
index c4a4f08272b34f72dea4feaaeb66d153b2aab8c8..be5da5a81246b4f4abe19f7c0cf68990d6bdf5bd 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -296,6 +296,12 @@ public class ServerPlayerGameMode {
|
||||
@@ -25,10 +25,10 @@ index 3a596650feb96123c5684bb5065e20c5b005c0b9..f7a05fd098ef7b303254cd410414d50d
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index 6278fe737a555f47625098828a03952cf9b859a7..4158bbe0740fe2971a9e857cb4cad08ee465576a 100644
|
||||
index f0bc659193184a87256616f501edce0094fadcfc..22afb73cd31c15ed7c68c403f044910d93889d99 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -1177,6 +1177,12 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1178,6 +1178,12 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
snapshot.setFlags(flags); // Paper - always set the flag of the most recent call to mitigate issues with multiple update at the same pos with different flags
|
||||
}
|
||||
BlockState blockState = chunkAt.setBlockState(pos, state, flags);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimize addOrUpdateTransientModifier
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
index 9f09d78a7dac12c7f1b06029d32ad93fae0c2aec..2af5cd6f2b9541cb28075fda014350235a4f72c7 100644
|
||||
index 7f8eb388308806008805970d4d8ed329440380ee..7f1b670eab23c02fb0f27cfa5ca0d0113794c8eb 100644
|
||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
@@ -109,8 +109,13 @@ public class AttributeInstance {
|
||||
@@ -105,8 +105,13 @@ public class AttributeInstance {
|
||||
}
|
||||
|
||||
public void addOrUpdateTransientModifier(AttributeModifier modifier) {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Micro optimizations for random tick
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index a311f81b7f34f2c988ebcd792ca87dfd7b175f96..4948557d2faef1dff664cd18df7af4564a0431ff 100644
|
||||
index 173ea626bed0707840c1f844b38c154d85adde3f..ce39571c292c0dd58075e159c343898a374f008a 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1044,7 +1044,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1048,7 +1048,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
// Paper start - optimise random ticking
|
||||
private void optimiseRandomTick(final LevelChunk chunk, final int tickSpeed) {
|
||||
final LevelChunkSection[] sections = chunk.getSections();
|
||||
@@ -17,7 +17,7 @@ index a311f81b7f34f2c988ebcd792ca87dfd7b175f96..4948557d2faef1dff664cd18df7af456
|
||||
final net.minecraft.world.level.levelgen.BitRandomSource simpleRandom = this.simpleRandom; // Leaf - Faster random generator - upcasting
|
||||
final boolean doubleTickFluids = !ca.spottedleaf.moonrise.common.PlatformHooks.get().configFixMC224294();
|
||||
|
||||
@@ -1053,41 +1053,41 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1057,41 +1057,41 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
final int offsetZ = cpos.z << 4;
|
||||
|
||||
for (int sectionIndex = 0, sectionsLen = sections.length; sectionIndex < sectionsLen; sectionIndex++) {
|
||||
|
||||
@@ -26,7 +26,7 @@ Locally this patch drops the entity tracker tick by a full 1.5x.
|
||||
Co-authored-by: Quang Tran <3d7777456@gmail.com>
|
||||
|
||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||
index 00a82873d226f113278632a53c0faca420dd67d4..f3e9de8716f5e1a72ec465ee897c8f0413f7b1c3 100644
|
||||
index 1014ab2aeb5e496124c99c938538e88d75561cd5..2fda4bf1aeecba183ba6301f83f582ae34f5a3da 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -147,6 +147,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -45,15 +45,15 @@ index 00a82873d226f113278632a53c0faca420dd67d4..f3e9de8716f5e1a72ec465ee897c8f04
|
||||
this.address = this.channel.remoteAddress();
|
||||
this.preparing = false; // Spigot
|
||||
if (this.delayedDisconnect != null) {
|
||||
@@ -476,6 +478,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -472,6 +474,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
if (this.channel.eventLoop().inEventLoop()) {
|
||||
this.doSendPacket(packet, sendListener, flush);
|
||||
this.doSendPacket(packet, channelFutureListener, flag);
|
||||
} else {
|
||||
+ // Paper start - optimise packets that are not flushed
|
||||
+ if (!flush && org.dreeam.leaf.config.modules.network.OptimizeNonFlushPacketSending.enabled) {
|
||||
+ this.eventLoop.lazyExecute(() -> this.doSendPacket(packet, sendListener, flush));
|
||||
+ if (!flag && org.dreeam.leaf.config.modules.network.OptimizeNonFlushPacketSending.enabled) {
|
||||
+ this.eventLoop.lazyExecute(() -> this.doSendPacket(packet, channelFutureListener, flag));
|
||||
+ } else
|
||||
+ // Paper end - optimise packets that are not flushed
|
||||
this.channel.eventLoop().execute(() -> this.doSendPacket(packet, sendListener, flush));
|
||||
+ // Paper end - optimise packets that are not flushed
|
||||
this.channel.eventLoop().execute(() -> this.doSendPacket(packet, channelFutureListener, flag));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 82096e6b187e63ad3e848b9757ba2152e8c642b4..e0db9281f023a09d69479f28a7c8f681641f642f 100644
|
||||
index 602b0ce96cdc8ebd8d875f1dadfc2fdfe6aa0bad..13d0b21211e7d81fa57739854d3cc10ac03eff12 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4610,10 +4610,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4813,10 +4813,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
// Paper start - optimise collisions
|
||||
public boolean updateFluidHeightAndDoFluidPushing(final TagKey<Fluid> fluid, final double flowScale) {
|
||||
@@ -26,7 +26,7 @@ index 82096e6b187e63ad3e848b9757ba2152e8c642b4..e0db9281f023a09d69479f28a7c8f681
|
||||
final AABB boundingBox = this.getBoundingBox().deflate(1.0E-3);
|
||||
|
||||
final Level world = this.level;
|
||||
@@ -4649,7 +4646,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4852,7 +4849,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) {
|
||||
for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Async target finding
|
||||
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
index 7b686d834e4eb36be5758b0e0a846a70d1e2294b..956d48fb7146b9eb2a5b5b4e23a83f60d0e40b4c 100644
|
||||
index fee4a7452178c274eb835d758b718d8e874d79d0..9a2539e1fe2cee30066634ef47a991fa5837a5e4 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
@@ -40,8 +40,10 @@ public final class ChunkEntitySlices {
|
||||
@@ -49,8 +49,10 @@ public final class ChunkEntitySlices {
|
||||
|
||||
private final EntityCollectionBySection allEntities;
|
||||
private final EntityCollectionBySection hardCollidingEntities;
|
||||
@@ -21,7 +21,7 @@ index 7b686d834e4eb36be5758b0e0a846a70d1e2294b..956d48fb7146b9eb2a5b5b4e23a83f60
|
||||
private final EntityList entities = new EntityList();
|
||||
|
||||
public FullChunkStatus status;
|
||||
@@ -67,9 +69,15 @@ public final class ChunkEntitySlices {
|
||||
@@ -76,9 +78,15 @@ public final class ChunkEntitySlices {
|
||||
|
||||
this.allEntities = new EntityCollectionBySection(this);
|
||||
this.hardCollidingEntities = new EntityCollectionBySection(this);
|
||||
@@ -40,7 +40,7 @@ index 7b686d834e4eb36be5758b0e0a846a70d1e2294b..956d48fb7146b9eb2a5b5b4e23a83f60
|
||||
this.status = status;
|
||||
this.chunkData = chunkData;
|
||||
}
|
||||
@@ -248,14 +256,26 @@ public final class ChunkEntitySlices {
|
||||
@@ -270,14 +278,26 @@ public final class ChunkEntitySlices {
|
||||
this.hardCollidingEntities.addEntity(entity, sectionIndex);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ index 7b686d834e4eb36be5758b0e0a846a70d1e2294b..956d48fb7146b9eb2a5b5b4e23a83f60
|
||||
|
||||
EntityCollectionBySection byType = this.entitiesByType.get(entity.getType());
|
||||
if (byType != null) {
|
||||
@@ -282,14 +302,27 @@ public final class ChunkEntitySlices {
|
||||
@@ -304,14 +324,27 @@ public final class ChunkEntitySlices {
|
||||
this.hardCollidingEntities.removeEntity(entity, sectionIndex);
|
||||
}
|
||||
|
||||
@@ -106,19 +106,19 @@ index 7b686d834e4eb36be5758b0e0a846a70d1e2294b..956d48fb7146b9eb2a5b5b4e23a83f60
|
||||
final EntityCollectionBySection byType = this.entitiesByType.get(entity.getType());
|
||||
byType.removeEntity(entity, sectionIndex);
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 9933a60db91d68f76df33ccddea0852fd59b8983..14c4dfb497ab050adfffebb8d75e6fe89c38effc 100644
|
||||
index eb3f6e638147c46e0cdb04d9c4bd08b11cff7347..2d327688bf48cf2477f60dd2573fa5136a077427 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -291,6 +291,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -292,6 +292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
|
||||
public final Set<net.minecraft.world.entity.Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
public java.util.concurrent.Semaphore serverLevelTickingSemaphore = null; // SparklyPaper - parallel world ticking
|
||||
+ @Nullable public org.dreeam.leaf.async.ai.AsyncGoalThread asyncGoalThread; // Leaf - Async target finding
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||
ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 72e871b8c7fee9b5cbd567e03baee80ee4b9c82e..574765713c194a6cf3eb7c125e78ed77c82aba2e 100644
|
||||
index 50630dabe4220b8ac810a0395d70360879fdeabc..2e03020a67c7f59a3c554ab720fba831ed13ec82 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -204,6 +204,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -134,10 +134,10 @@ index 72e871b8c7fee9b5cbd567e03baee80ee4b9c82e..574765713c194a6cf3eb7c125e78ed77
|
||||
|
||||
// Gale start - Pufferfish - SIMD support
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862571744f3 100644
|
||||
index ce39571c292c0dd58075e159c343898a374f008a..117a8ef98c369bf0919e44fe823d6af0758816b5 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -173,7 +173,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -175,7 +175,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final int EMPTY_TIME_NO_TICK = 300;
|
||||
private static final int MAX_SCHEDULED_TICKS_PER_TICK = 65536;
|
||||
@@ -155,7 +155,7 @@ index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862
|
||||
public final ServerChunkCache chunkSource;
|
||||
private final MinecraftServer server;
|
||||
public final net.minecraft.world.level.storage.PrimaryLevelData serverLevelData; // CraftBukkit - type
|
||||
@@ -216,6 +225,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -219,6 +228,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
|
||||
public boolean hasRidableMoveEvent = false; // Purpur - Ridables
|
||||
final List<ServerPlayer> realPlayers; // Leaves - skip
|
||||
@@ -163,7 +163,7 @@ index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862
|
||||
|
||||
@Override
|
||||
public @Nullable LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
@@ -334,6 +344,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -337,6 +347,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer)this.server).moonrise$executeMidTickTasks();
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862
|
||||
@Override
|
||||
public final ChunkAccess moonrise$syncLoadNonFull(final int chunkX, final int chunkZ, final net.minecraft.world.level.chunk.status.ChunkStatus status) {
|
||||
return this.moonrise$getChunkTaskScheduler().syncLoadNonFull(chunkX, chunkZ, status);
|
||||
@@ -703,6 +719,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -707,6 +723,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
|
||||
this.realPlayers = Lists.newArrayList(); // Leaves - skip
|
||||
this.tickExecutor = java.util.concurrent.Executors.newSingleThreadExecutor(new org.dreeam.leaf.async.world.SparklyPaperServerLevelTickExecutorThreadFactory(getWorld().getName())); // SparklyPaper - parallel world ticking
|
||||
@@ -190,7 +190,7 @@ index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862
|
||||
}
|
||||
|
||||
// Leaf start - SparklyPaper - parallel world ticking - Shutdown handling for async reads
|
||||
@@ -976,12 +999,14 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -980,12 +1003,14 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
this.moonrise$midTickTasks(); // Paper - rewrite chunk system
|
||||
// Gale end - Airplane - remove lambda from ticking guard - copied from guardEntityTick
|
||||
@@ -205,7 +205,7 @@ index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862
|
||||
}
|
||||
// Paper - rewrite chunk system
|
||||
}
|
||||
@@ -1460,6 +1485,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1468,6 +1493,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
// Leaf end - SparklyPaper - parallel world ticking (only run mid-tick at the end of each tick / fixes concurrency bugs related to executeMidTickTasks)
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
@@ -213,7 +213,7 @@ index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862
|
||||
}
|
||||
|
||||
private void tickBlock(BlockPos pos, Block block) {
|
||||
@@ -1476,6 +1502,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1484,6 +1510,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
// Leaf end - SparklyPaper - parallel world ticking (only run mid-tick at the end of each tick / fixes concurrency bugs related to executeMidTickTasks)
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
@@ -222,11 +222,11 @@ index 4948557d2faef1dff664cd18df7af4564a0431ff..c0044f4013520fd617ec365012b10862
|
||||
|
||||
// Paper start - log detailed entity tick information
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index 81bd431e641be474f7a43a78df083756de1798de..7092599cfbce0c632775f70fc599172b51d9e2cd 100644
|
||||
index 4a1a336914eff8a178dcd992bd1bfea25a8be76b..dbfd7301c7b2644ac26a5ee3f804236ee48f5aed 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -135,6 +135,12 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
private float restrictRadius = -1.0F;
|
||||
@@ -138,6 +138,12 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
private int homeRadius = -1;
|
||||
public boolean aware = true; // CraftBukkit
|
||||
public int ticksSinceLastInteraction; // Purpur - Entity lifespan
|
||||
+ // Leaf start - Async target finding
|
||||
@@ -238,7 +238,7 @@ index 81bd431e641be474f7a43a78df083756de1798de..7092599cfbce0c632775f70fc599172b
|
||||
|
||||
protected Mob(EntityType<? extends Mob> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -213,12 +219,22 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
@@ -216,12 +222,22 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
}
|
||||
// Paper end - Skip AI during inactive ticks for non-aware mobs
|
||||
boolean isThrottled = org.dreeam.leaf.config.modules.opt.ThrottleInactiveGoalSelectorTick.enabled && _pufferfish_inactiveTickDisableCounter++ % 20 != 0; // Pufferfish - throttle inactive goal selector ticking
|
||||
@@ -261,7 +261,7 @@ index 81bd431e641be474f7a43a78df083756de1798de..7092599cfbce0c632775f70fc599172b
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -765,17 +781,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
@@ -782,17 +798,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
// Paper end - Allow nerfed mobs to jump and float
|
||||
this.sensing.tick();
|
||||
int i = this.tickCount + this.getId();
|
||||
@@ -654,10 +654,10 @@ index 3093f03d4f298bf39fec8bad2b6c22518774aea8..0a41797fd7beddce0b93d42bac6e0270
|
||||
} else {
|
||||
this.parent = animal;
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
index e82e32407cec6109b9c3b0106295217f4a3f4aa2..3c24382a3cced8dcea103ccc87cb506310de8461 100644
|
||||
index 55f1c138039b80894f655d180192f5cb95e32778..2046bc2b69e0e41f31b794d0bda7df4b9f8b0cc0 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
@@ -26,13 +26,23 @@ public class GoalSelector {
|
||||
@@ -25,12 +25,22 @@ public class GoalSelector {
|
||||
private final ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from GoalSelector
|
||||
private int curRate; // Paper - EAR 2
|
||||
|
||||
@@ -674,14 +674,13 @@ index e82e32407cec6109b9c3b0106295217f4a3f4aa2..3c24382a3cced8dcea103ccc87cb5063
|
||||
+ availableGoalsDirty = true; // Leaf - Async target finding
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void removeAllGoals(Predicate<Goal> filter) {
|
||||
this.availableGoals.removeIf(wrappedGoal -> filter.test(wrappedGoal.getGoal()));
|
||||
+ availableGoalsDirty = true; // Leaf - Async target finding
|
||||
}
|
||||
|
||||
// Paper start - EAR 2
|
||||
@@ -63,18 +73,19 @@ public class GoalSelector {
|
||||
@@ -61,18 +71,19 @@ public class GoalSelector {
|
||||
}
|
||||
|
||||
this.availableGoals.removeIf(wrappedGoal1 -> wrappedGoal1.getGoal() == goal);
|
||||
@@ -703,7 +702,7 @@ index e82e32407cec6109b9c3b0106295217f4a3f4aa2..3c24382a3cced8dcea103ccc87cb5063
|
||||
flagIterator ^= ca.spottedleaf.concurrentutil.util.IntegerUtil.getTrailingBit(flagIterator);
|
||||
// Paper end - Perf: optimize goal types
|
||||
if (!flag.getOrDefault(flag1, NO_GOAL).canBeReplacedBy(goal)) {
|
||||
@@ -85,7 +96,131 @@ public class GoalSelector {
|
||||
@@ -83,7 +94,131 @@ public class GoalSelector {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -835,7 +834,7 @@ index e82e32407cec6109b9c3b0106295217f4a3f4aa2..3c24382a3cced8dcea103ccc87cb5063
|
||||
for (WrappedGoal wrappedGoal : this.availableGoals) {
|
||||
if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams
|
||||
wrappedGoal.stop();
|
||||
@@ -116,6 +251,18 @@ public class GoalSelector {
|
||||
@@ -114,6 +249,18 @@ public class GoalSelector {
|
||||
}
|
||||
|
||||
public void tickRunningGoals(boolean tickAllRunning) {
|
||||
@@ -1065,7 +1064,7 @@ index 6463c3c9b08d6058f2843c225b08a40fc30a960b..98c2b4a298ada4b02afa55f991791d86
|
||||
@Override
|
||||
public boolean canContinueToUse() {
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
index 3f080b15543bf8c5fa0774b62d7f12e13b82511a..9b8453ce2bc2cafca7c670d79b40434e7c93afca 100644
|
||||
index f15da598cb1d7872fafb8b173e5134b9667c9a9f..810bddf42d83159ed62ec4876e25fd0ac35683b7 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
@@ -41,8 +41,60 @@ public abstract class MoveToBlockGoal extends Goal {
|
||||
@@ -1349,10 +1348,10 @@ index 16ec032d84f128fc44a836843fafef303f52b699..767dff2aa4c1d71cc3c2210436660548
|
||||
+ // Leaf end - Async search block
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/TemptGoal.java b/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
index f88f618d34fb343b31de3af1a875d6633703df71..754c379b42cf65c1d2278b474cdfbe50e9e62b34 100644
|
||||
index a805c9426630c2c46db9d0dd536f1d16769395d3..8842e87b652635db72bac07a9c4883f79c48e700 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
@@ -36,12 +36,51 @@ public class TemptGoal extends Goal {
|
||||
@@ -49,12 +49,51 @@ public class TemptGoal extends Goal {
|
||||
this.targetingConditions = TEMPT_TARGETING.copy().selector((entity, level) -> this.shouldFollow(entity));
|
||||
}
|
||||
|
||||
@@ -1781,10 +1780,10 @@ index 002d3c0d8b1107a275020d5c582c37e9a5c536ee..6fa0b8defbd1d06b3bf5d9b32ffd08f3
|
||||
// Gale start - Petal - reduce line of sight cache lookups - merge sets
|
||||
int cached = this.seen.get(id);
|
||||
diff --git a/net/minecraft/world/entity/animal/Fox.java b/net/minecraft/world/entity/animal/Fox.java
|
||||
index ff20a6e9745c7724dfae41d5868912c8cc19eb8e..9eb9b978e2cc8570d8b884603172f2718e770d93 100644
|
||||
index 8964bb5098c0dc36741af3656af6bc0b5b463abe..ac35459445061f50302f70044e81a5967e03df5f 100644
|
||||
--- a/net/minecraft/world/entity/animal/Fox.java
|
||||
+++ b/net/minecraft/world/entity/animal/Fox.java
|
||||
@@ -870,6 +870,11 @@ public class Fox extends Animal {
|
||||
@@ -867,6 +867,11 @@ public class Fox extends Animal {
|
||||
return false;
|
||||
} else {
|
||||
ServerLevel serverLevel = getServerLevel(Fox.this.level());
|
||||
@@ -1796,7 +1795,7 @@ index ff20a6e9745c7724dfae41d5868912c8cc19eb8e..9eb9b978e2cc8570d8b884603172f271
|
||||
|
||||
for (EntityReference<LivingEntity> entityReference : Fox.this.getTrustedEntities().toList()) {
|
||||
LivingEntity livingEntity = entityReference.getEntity(serverLevel, LivingEntity.class);
|
||||
@@ -877,7 +882,7 @@ public class Fox extends Animal {
|
||||
@@ -874,7 +879,7 @@ public class Fox extends Animal {
|
||||
this.trustedLastHurt = livingEntity;
|
||||
this.trustedLastHurtBy = livingEntity.getLastHurtByMob();
|
||||
int lastHurtByMobTimestamp = livingEntity.getLastHurtByMobTimestamp();
|
||||
@@ -1805,7 +1804,7 @@ index ff20a6e9745c7724dfae41d5868912c8cc19eb8e..9eb9b978e2cc8570d8b884603172f271
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1056,7 +1061,7 @@ public class Fox extends Animal {
|
||||
@@ -1053,7 +1058,7 @@ public class Fox extends Animal {
|
||||
@Override
|
||||
protected boolean isValidTarget(LevelReader level, BlockPos pos) {
|
||||
BlockState blockState = level.getBlockState(pos);
|
||||
@@ -1814,7 +1813,7 @@ index ff20a6e9745c7724dfae41d5868912c8cc19eb8e..9eb9b978e2cc8570d8b884603172f271
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1120,6 +1125,13 @@ public class Fox extends Animal {
|
||||
@@ -1117,6 +1122,13 @@ public class Fox extends Animal {
|
||||
Fox.this.setSitting(false);
|
||||
super.start();
|
||||
}
|
||||
@@ -1829,10 +1828,10 @@ index ff20a6e9745c7724dfae41d5868912c8cc19eb8e..9eb9b978e2cc8570d8b884603172f271
|
||||
|
||||
class FoxFloatGoal extends FloatGoal {
|
||||
diff --git a/net/minecraft/world/entity/animal/Panda.java b/net/minecraft/world/entity/animal/Panda.java
|
||||
index 99d99d59ec0eb13dc40bc88bd70ad884bb9e2859..d0be031cedcc895b8cca8666f826628ac8ce6ab3 100644
|
||||
index 02bfa88568e635770675ea9173f2cf3ca21457fa..c7dc46c1584345463100264dc88bddb7d883575e 100644
|
||||
--- a/net/minecraft/world/entity/animal/Panda.java
|
||||
+++ b/net/minecraft/world/entity/animal/Panda.java
|
||||
@@ -988,9 +988,18 @@ public class Panda extends Animal {
|
||||
@@ -989,9 +989,18 @@ public class Panda extends Animal {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
@@ -1852,10 +1851,10 @@ index 99d99d59ec0eb13dc40bc88bd70ad884bb9e2859..d0be031cedcc895b8cca8666f826628a
|
||||
ServerLevel serverLevel = getServerLevel(this.mob);
|
||||
if (this.lookAtType == Player.class) {
|
||||
diff --git a/net/minecraft/world/entity/animal/Rabbit.java b/net/minecraft/world/entity/animal/Rabbit.java
|
||||
index fd8026cf1d884e95e8260ad52d4e0bbad20b0fdf..7ea36f2de5ecad35651d5333235e079a28bd0101 100644
|
||||
index 1af1b33702296f9aa74c33436ea2904c5e5ae43d..ad9a1baa24a7a4ac22bb741f743e5b32514e318a 100644
|
||||
--- a/net/minecraft/world/entity/animal/Rabbit.java
|
||||
+++ b/net/minecraft/world/entity/animal/Rabbit.java
|
||||
@@ -669,7 +669,13 @@ public class Rabbit extends Animal {
|
||||
@@ -670,7 +670,13 @@ public class Rabbit extends Animal {
|
||||
this.wantsToRaid = this.rabbit.wantsMoreFood();
|
||||
}
|
||||
|
||||
@@ -1870,7 +1869,7 @@ index fd8026cf1d884e95e8260ad52d4e0bbad20b0fdf..7ea36f2de5ecad35651d5333235e079a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -712,7 +718,7 @@ public class Rabbit extends Animal {
|
||||
@@ -713,7 +719,7 @@ public class Rabbit extends Animal {
|
||||
@Override
|
||||
protected boolean isValidTarget(LevelReader level, BlockPos pos) {
|
||||
BlockState blockState = level.getBlockState(pos);
|
||||
@@ -1879,7 +1878,7 @@ index fd8026cf1d884e95e8260ad52d4e0bbad20b0fdf..7ea36f2de5ecad35651d5333235e079a
|
||||
blockState = level.getBlockState(pos.above());
|
||||
if (blockState.getBlock() instanceof CarrotBlock && ((CarrotBlock)blockState.getBlock()).isMaxAge(blockState)) {
|
||||
this.canRaid = true;
|
||||
@@ -722,6 +728,13 @@ public class Rabbit extends Animal {
|
||||
@@ -723,6 +729,13 @@ public class Rabbit extends Animal {
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1894,10 +1893,10 @@ index fd8026cf1d884e95e8260ad52d4e0bbad20b0fdf..7ea36f2de5ecad35651d5333235e079a
|
||||
|
||||
public static enum Variant implements StringRepresentable {
|
||||
diff --git a/net/minecraft/world/entity/animal/Turtle.java b/net/minecraft/world/entity/animal/Turtle.java
|
||||
index c84f63f064a7769761f75cdedaceacde858b9b4e..9b7d059bf68ff24dddedb16ec62a9b67e3ceace9 100644
|
||||
index 9bdc1f10e3b40672449ad166f130ecabdacc75d3..49e54711a5a57541cb603fa0bf9f5acd739453a6 100644
|
||||
--- a/net/minecraft/world/entity/animal/Turtle.java
|
||||
+++ b/net/minecraft/world/entity/animal/Turtle.java
|
||||
@@ -482,8 +482,15 @@ public class Turtle extends Animal {
|
||||
@@ -483,8 +483,15 @@ public class Turtle extends Animal {
|
||||
|
||||
@Override
|
||||
protected boolean isValidTarget(LevelReader level, BlockPos pos) {
|
||||
@@ -1914,7 +1913,7 @@ index c84f63f064a7769761f75cdedaceacde858b9b4e..9b7d059bf68ff24dddedb16ec62a9b67
|
||||
}
|
||||
|
||||
static class TurtleLayEggGoal extends MoveToBlockGoal {
|
||||
@@ -537,8 +544,15 @@ public class Turtle extends Animal {
|
||||
@@ -538,8 +545,15 @@ public class Turtle extends Animal {
|
||||
|
||||
@Override
|
||||
protected boolean isValidTarget(LevelReader level, BlockPos pos) {
|
||||
@@ -1932,10 +1931,10 @@ index c84f63f064a7769761f75cdedaceacde858b9b4e..9b7d059bf68ff24dddedb16ec62a9b67
|
||||
|
||||
static class TurtleMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables
|
||||
diff --git a/net/minecraft/world/entity/animal/wolf/Wolf.java b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
index 936ee9e80239ad965be75ceeb38d5248243e9c4e..cdb6781b319559ea23bad3b371a91d49cfc8adcc 100644
|
||||
index 7e7cb9db1c84bdb173b444bec90663a93fb3b549..e64713d454b6b00827c609b36371d841adc30df0 100644
|
||||
--- a/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
@@ -723,7 +723,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -710,7 +710,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
|
||||
@Override
|
||||
public boolean isFood(ItemStack stack) {
|
||||
@@ -1945,10 +1944,10 @@ index 936ee9e80239ad965be75ceeb38d5248243e9c4e..cdb6781b319559ea23bad3b371a91d49
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
|
||||
index 2e04078664cd723e3e0c80565e4b6e6416b13901..ed790a407b4be9e2f7fcb8cf36b8d03c32864a59 100644
|
||||
index 7ff380212ce5e56e0e58e5f52f8c75bda5061ef0..11b10d802b7a63cc294c66c70c9a99b48b601632 100644
|
||||
--- a/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -397,7 +397,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -392,7 +392,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@Override
|
||||
protected boolean isValidTarget(LevelReader level, BlockPos pos) {
|
||||
BlockPos blockPos = pos.above();
|
||||
@@ -1957,7 +1956,7 @@ index 2e04078664cd723e3e0c80565e4b6e6416b13901..ed790a407b4be9e2f7fcb8cf36b8d03c
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -411,6 +411,13 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -405,6 +405,13 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
public void stop() {
|
||||
super.stop();
|
||||
}
|
||||
@@ -1972,10 +1971,10 @@ index 2e04078664cd723e3e0c80565e4b6e6416b13901..ed790a407b4be9e2f7fcb8cf36b8d03c
|
||||
|
||||
static class DrownedGoToWaterGoal extends Goal {
|
||||
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index 16886178079a096329d06f40d502012b6fa473e0..36d5621d4d92c86a6edbd088ce5e5a246cdbe5cb 100644
|
||||
index 58887b2cc931892f96793edd7a7d1db22cb8686c..769f3a350ebe0133a2b45e13fe9cf9456d5d9748 100644
|
||||
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -592,10 +592,34 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
@@ -588,10 +588,34 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
@@ -2032,10 +2031,10 @@ index e1717b5c854aa81fdd7b7e715d7c3498d9f86072..3627e7479b4deea28e268245410ec4cd
|
||||
|
||||
static class StriderPathNavigation extends GroundPathNavigation {
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index 4158bbe0740fe2971a9e857cb4cad08ee465576a..e380cc68d0d88d983a1b7b1d9ef4ec8ef307761a 100644
|
||||
index 22afb73cd31c15ed7c68c403f044910d93889d99..f407daf04f2e498dfc058a7bc8b062f80cdccdc7 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -1531,6 +1531,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1532,6 +1532,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
}
|
||||
// Leaf end - SparklyPaper - parallel world ticking (only run mid-tick at the end of each tick / fixes concurrency bugs related to executeMidTickTasks) - do not bother with condition work / make configurable
|
||||
// Paper end - rewrite chunk system
|
||||
@@ -2043,7 +2042,7 @@ index 4158bbe0740fe2971a9e857cb4cad08ee465576a..e380cc68d0d88d983a1b7b1d9ef4ec8e
|
||||
}
|
||||
}
|
||||
this.blockEntityTickers.removeMarkedEntries(); // SparklyPaper - optimize block entity removals
|
||||
@@ -1799,9 +1800,11 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1793,9 +1794,11 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
|
||||
@Override
|
||||
public List<Entity> getEntities(@Nullable Entity entity, AABB boundingBox, Predicate<? super Entity> predicate) {
|
||||
|
||||
@@ -212,10 +212,10 @@ index 1cc33a038060aaf5258ee4f1deb19b4a1be59a29..a14247b043715de50b253ab1f10a9244
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/chunk/storage/SerializableChunkData.java b/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
|
||||
index ccec1b847ba1a3667206cbeac4ed541a9fb028ea..5c2d29e749fdd317f231489401601c82191552bf 100644
|
||||
index ab1fc7ca0639f9e71933f623258bb8d123988262..781f9470dc0115a464ce4711aecafb0f11a016b7 100644
|
||||
--- a/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
|
||||
@@ -493,14 +493,16 @@ public record SerializableChunkData(
|
||||
@@ -495,14 +495,16 @@ public record SerializableChunkData(
|
||||
throw new IllegalArgumentException("Chunk can't be serialized: " + chunk);
|
||||
} else {
|
||||
ChunkPos pos = chunk.getPos();
|
||||
@@ -235,7 +235,7 @@ index ccec1b847ba1a3667206cbeac4ed541a9fb028ea..5c2d29e749fdd317f231489401601c82
|
||||
|
||||
final LevelChunkSection[] chunkSections = chunk.getSections();
|
||||
final ca.spottedleaf.moonrise.patches.starlight.light.SWMRNibbleArray[] blockNibbles = ((ca.spottedleaf.moonrise.patches.starlight.chunk.StarlightChunk)chunk).starlight$getBlockNibbles();
|
||||
@@ -518,10 +520,20 @@ public record SerializableChunkData(
|
||||
@@ -520,10 +522,20 @@ public record SerializableChunkData(
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ index ccec1b847ba1a3667206cbeac4ed541a9fb028ea..5c2d29e749fdd317f231489401601c82
|
||||
);
|
||||
|
||||
if (blockNibble != null) {
|
||||
@@ -532,12 +544,16 @@ public record SerializableChunkData(
|
||||
@@ -534,12 +546,16 @@ public record SerializableChunkData(
|
||||
((ca.spottedleaf.moonrise.patches.starlight.storage.StarlightSectionData)(Object)sectionData).starlight$setSkyLightState(skyNibble.state);
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ index ccec1b847ba1a3667206cbeac4ed541a9fb028ea..5c2d29e749fdd317f231489401601c82
|
||||
for (BlockPos blockPos : chunk.getBlockEntitiesPos()) {
|
||||
CompoundTag blockEntityNbtForSaving = chunk.getBlockEntityNbtForSaving(blockPos, level.registryAccess());
|
||||
if (blockEntityNbtForSaving != null) {
|
||||
@@ -545,15 +561,27 @@ public record SerializableChunkData(
|
||||
@@ -547,15 +563,27 @@ public record SerializableChunkData(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ index ccec1b847ba1a3667206cbeac4ed541a9fb028ea..5c2d29e749fdd317f231489401601c82
|
||||
}
|
||||
|
||||
Map<Heightmap.Types, long[]> map = new EnumMap<>(Heightmap.Types.class);
|
||||
@@ -561,14 +589,26 @@ public record SerializableChunkData(
|
||||
@@ -563,14 +591,26 @@ public record SerializableChunkData(
|
||||
for (Entry<Heightmap.Types, Heightmap> entry : chunk.getHeightmaps()) {
|
||||
if (chunk.getPersistedStatus().heightmapsAfter().contains(entry.getKey())) {
|
||||
long[] rawData = entry.getValue().getRawData();
|
||||
|
||||
@@ -15,7 +15,7 @@ The delay is currently set to 2 seconds, however, we may want to adjust this bef
|
||||
fixes Paper#9581
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
|
||||
index 3a78e7512772fd3f7cf8f221e3a72474def14bea..ba52af914e9e231caa0ac50562e9a6925908c615 100644
|
||||
index 5b778b8366d99a8b03b4367d44ffabade2b58ebe..ef416d38f3ca57826c46e7401804630e46771146 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
|
||||
@@ -48,6 +48,7 @@ public final class RegionizedPlayerChunkLoader {
|
||||
@@ -27,13 +27,13 @@ index 3a78e7512772fd3f7cf8f221e3a72474def14bea..ba52af914e9e231caa0ac50562e9a692
|
||||
public static final int GENERATED_TICKET_LEVEL = ChunkHolderManager.FULL_LOADED_TICKET_LEVEL;
|
||||
public static final int LOADED_TICKET_LEVEL = ChunkTaskScheduler.getTicketLevel(ChunkStatus.EMPTY);
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index a1249d66c3693374b0f57c83302d05a7cbc2a306..2ea112ed64d5dc7c5eb365e7a518cf0e8dd4927f 100644
|
||||
index 42822499ad559bce6734a16056d6e04cef318569..cea9507d183920c3a7f5e96f7dafebe4c9e33a19 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -434,6 +434,13 @@ public abstract class PlayerList {
|
||||
// this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below
|
||||
// Paper start - Fire PlayerJoinEvent when Player is actually ready; correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks
|
||||
player.supressTrackerForLogin = true;
|
||||
@@ -435,6 +435,13 @@ public abstract class PlayerList {
|
||||
// this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below
|
||||
// Paper start - Fire PlayerJoinEvent when Player is actually ready; correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks
|
||||
player.supressTrackerForLogin = true;
|
||||
+ // Paper start - Add ticket on player join to avoid chunk load-unload-load cycle
|
||||
+ serverLevel.moonrise$getChunkTaskScheduler().chunkHolderManager.addTicketAtLevel(
|
||||
+ ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PLAYER_JOIN,
|
||||
@@ -41,6 +41,6 @@ index a1249d66c3693374b0f57c83302d05a7cbc2a306..2ea112ed64d5dc7c5eb365e7a518cf0e
|
||||
+ ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.TICK_TICKET_LEVEL,
|
||||
+ net.minecraft.util.Unit.INSTANCE);
|
||||
+ // Paper end - Add ticket on player join to avoid chunk load-unload-load cycle
|
||||
serverLevel.addNewPlayer(player);
|
||||
this.server.getCustomBossEvents().onPlayerConnect(player); // see commented out section below serverLevel.addPlayerJoin(player);
|
||||
// Paper end - Fire PlayerJoinEvent when Player is actually ready
|
||||
serverLevel.addNewPlayer(player);
|
||||
this.server.getCustomBossEvents().onPlayerConnect(player); // see commented out section below serverLevel.addPlayerJoin(player);
|
||||
// Paper end - Fire PlayerJoinEvent when Player is actually ready
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samsuik <kfian294ma4@gmail.com>
|
||||
Date: Fri, 8 Nov 2024 19:35:49 +0000
|
||||
Subject: [PATCH] Sakura: Optimise check inside blocks and traverse blocks
|
||||
|
||||
Dreeam TODO: refactor checkinsideblcoks
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index e0db9281f023a09d69479f28a7c8f681641f642f..cc6b6b442d72b4a974cedd8ceef710304e52ab18 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1701,6 +1701,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
private void checkInsideBlocks(List<Entity.Movement> movements, InsideBlockEffectApplier.StepBasedCollector stepBasedCollector) {
|
||||
if (this.isAffectedByBlocks()) {
|
||||
LongSet set = this.visitedBlocks;
|
||||
+ final net.minecraft.world.level.chunk.ChunkAccess[] chunkCache = new net.minecraft.world.level.chunk.ChunkAccess[4]; // Sakura - optimise check inside blocks
|
||||
|
||||
for (Entity.Movement movement : movements) {
|
||||
Vec3 vec3 = movement.from();
|
||||
@@ -1712,7 +1713,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
aabb,
|
||||
(pos, step) -> {
|
||||
if (this.isAlive()) {
|
||||
- BlockState blockState = this.level().getBlockState(pos);
|
||||
+ // Sakura start - optimise check inside blocks
|
||||
+ final int chunkX = pos.getX() >> 4;
|
||||
+ final int chunkZ = pos.getZ() >> 4;
|
||||
+ final int chunkKey = ((chunkX << 2) | chunkZ) & 3;
|
||||
+ net.minecraft.world.level.chunk.ChunkAccess chunk = chunkCache[chunkKey];
|
||||
+ if (chunk == null || chunk.locX != chunkX || chunk.locZ != chunkZ) {
|
||||
+ chunk = this.level().getChunkIfLoadedImmediately(chunkX, chunkZ);
|
||||
+ if (chunk == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ chunkCache[chunkKey] = chunk;
|
||||
+ }
|
||||
+ final BlockState blockState = chunk.getBlockState(pos);
|
||||
+ // Sakura end - optimise check inside blocks
|
||||
if (!blockState.isAir()) {
|
||||
if (set.add(pos.asLong())) {
|
||||
VoxelShape entityInsideCollisionShape = blockState.getEntityInsideCollisionShape(this.level(), pos, this);
|
||||
diff --git a/net/minecraft/world/level/BlockGetter.java b/net/minecraft/world/level/BlockGetter.java
|
||||
index dd7e32b8b176c0f4c13e50aeed33c2c9ccba4b53..ee514d457b5c2df912daeebb5fb8b824b5496b0e 100644
|
||||
--- a/net/minecraft/world/level/BlockGetter.java
|
||||
+++ b/net/minecraft/world/level/BlockGetter.java
|
||||
@@ -215,18 +215,30 @@ public interface BlockGetter extends LevelHeightAccessor {
|
||||
static void forEachBlockIntersectedBetween(Vec3 from, Vec3 to, AABB boundingBox, BlockGetter.BlockStepVisitor stepVisitor) {
|
||||
Vec3 vec3 = to.subtract(from);
|
||||
if (!(vec3.lengthSqr() < Mth.square(0.99999F))) {
|
||||
+ // Sakura start - optimise check inside blocks
|
||||
+ final boolean xZero = vec3.x() == 0.0;
|
||||
+ final boolean yZero = vec3.y() == 0.0;
|
||||
+ final boolean zZero = vec3.z() == 0.0;
|
||||
+ if (xZero && yZero || yZero && zZero || xZero && zZero) {
|
||||
+ int blockIndex = 0;
|
||||
+ for (BlockPos blockPos : org.dreeam.leaf.util.map.BlockPosIterator.traverseArea(vec3, boundingBox)) {
|
||||
+ stepVisitor.visit(blockPos, blockIndex++);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Sakura end - optimise check inside blocks
|
||||
LongSet set = new LongOpenHashSet();
|
||||
Vec3 minPosition = boundingBox.getMinPosition();
|
||||
Vec3 vec31 = minPosition.subtract(vec3);
|
||||
int i = addCollisionsAlongTravel(set, vec31, minPosition, boundingBox, stepVisitor);
|
||||
|
||||
- for (BlockPos blockPos1 : BlockPos.betweenClosed(boundingBox)) {
|
||||
+ for (BlockPos blockPos1 : org.dreeam.leaf.util.map.BlockPosIterator.iterable(boundingBox)) { // Sakura - optimise check inside blocks
|
||||
if (!set.contains(blockPos1.asLong())) {
|
||||
stepVisitor.visit(blockPos1, i + 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
- for (BlockPos blockPos : BlockPos.betweenClosed(boundingBox)) {
|
||||
+ for (BlockPos blockPos : org.dreeam.leaf.util.map.BlockPosIterator.iterable(boundingBox)) { // Sakura - optimise check inside blocks
|
||||
stepVisitor.visit(blockPos, 0);
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Sakura: copy EntityList implementation to BasicEntityList
|
||||
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
index 956d48fb7146b9eb2a5b5b4e23a83f60d0e40b4c..5847cbe6229f217d0361eda0950668bd0e9573f4 100644
|
||||
index 9a2539e1fe2cee30066634ef47a991fa5837a5e4..5ebc1b2cf186b512da5b62fedba16b612f2fa6ed 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
@@ -415,6 +415,13 @@ public final class ChunkEntitySlices {
|
||||
@@ -437,6 +437,13 @@ public final class ChunkEntitySlices {
|
||||
|
||||
private E[] storage;
|
||||
private int size;
|
||||
@@ -22,7 +22,7 @@ index 956d48fb7146b9eb2a5b5b4e23a83f60d0e40b4c..5847cbe6229f217d0361eda0950668bd
|
||||
|
||||
public BasicEntityList() {
|
||||
this(0);
|
||||
@@ -435,6 +442,7 @@ public final class ChunkEntitySlices {
|
||||
@@ -457,6 +464,7 @@ public final class ChunkEntitySlices {
|
||||
private void resize() {
|
||||
if (this.storage == me.titaniumtown.ArrayConstants.emptyEntityArray) { // Gale - JettPack - reduce array allocations
|
||||
this.storage = (E[])new Entity[DEFAULT_CAPACITY];
|
||||
@@ -30,7 +30,7 @@ index 956d48fb7146b9eb2a5b5b4e23a83f60d0e40b4c..5847cbe6229f217d0361eda0950668bd
|
||||
} else {
|
||||
this.storage = Arrays.copyOf(this.storage, this.storage.length * 2);
|
||||
}
|
||||
@@ -448,6 +456,7 @@ public final class ChunkEntitySlices {
|
||||
@@ -470,6 +478,7 @@ public final class ChunkEntitySlices {
|
||||
} else {
|
||||
this.storage[idx] = entity;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ index 956d48fb7146b9eb2a5b5b4e23a83f60d0e40b4c..5847cbe6229f217d0361eda0950668bd
|
||||
}
|
||||
|
||||
public int indexOf(final E entity) {
|
||||
@@ -463,24 +472,32 @@ public final class ChunkEntitySlices {
|
||||
@@ -485,24 +494,32 @@ public final class ChunkEntitySlices {
|
||||
}
|
||||
|
||||
public boolean remove(final E entity) {
|
||||
@@ -22,10 +22,10 @@ index 56fd1ed7ccaf96e7eedea60fbdbf7f934939d563..d2f522ea6d0a209496848af073c9af1c
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 14c4dfb497ab050adfffebb8d75e6fe89c38effc..54f5336b5bb56cb9dfda2b75fff07bae0b27cfd3 100644
|
||||
index 2d327688bf48cf2477f60dd2573fa5136a077427..e7cf3a1d5a8954ce7e1dd181deb5d0ba562a8eb1 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1820,6 +1820,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1822,6 +1822,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(tickCount); // Leaves - protocol
|
||||
@@ -34,10 +34,10 @@ index 14c4dfb497ab050adfffebb8d75e6fe89c38effc..54f5336b5bb56cb9dfda2b75fff07bae
|
||||
for (int i = 0; i < this.tickables.size(); i++) {
|
||||
this.tickables.get(i).run();
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index bc955da0dff79262dace84d255f27b3271a91ca5..7abc297d91d6e1b21b855424b345dba4f4df37b6 100644
|
||||
index f1d9fdda9a1d6c0374585fc60ad9354af36efa13..aef01105b827cc5959cc0d6611baf85bee311e5b 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -805,6 +805,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -810,6 +810,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
}
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
@@ -46,12 +46,12 @@ index bc955da0dff79262dace84d255f27b3271a91ca5..7abc297d91d6e1b21b855424b345dba4
|
||||
|
||||
private void updatePlayerAttributes() {
|
||||
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 18f0d486c478087f404d8bb6cd840079e2c8d239..1a6f1c5f4cf13ee50bc8445845cbb973c3f4a07d 100644
|
||||
index 742ce07b527449f047bf162aadecdc2c4da9b3ba..87121e0366c6c1ca58bbc7cf09b94ae913ae0f13 100644
|
||||
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -174,6 +174,8 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -176,6 +176,8 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
|
||||
+ org.dreeam.leaf.protocol.Protocols.handle(this.player, discardedPayload); // Leaf - Protocol core
|
||||
+
|
||||
@@ -59,10 +59,10 @@ index 18f0d486c478087f404d8bb6cd840079e2c8d239..1a6f1c5f4cf13ee50bc8445845cbb973
|
||||
final byte[] data = discardedPayload.data();
|
||||
try {
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 08d956368ced372d5a5e03b74a7fff4c9dc43283..978f9c5c54278d3d2bbb51461ab4ae6fcdd14d26 100644
|
||||
index cea9507d183920c3a7f5e96f7dafebe4c9e33a19..1edb1904113aae08b8ab85e19d51429d0f02cd49 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -687,6 +687,7 @@ public abstract class PlayerList {
|
||||
@@ -690,6 +690,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
||||
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Reduce PlayerChunk Updates
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index c91348eea1350728d8f6de7b8c3613cb44b5cdec..b260211fcf0dbe0d300a7c9769e6cd327e4555ab 100644
|
||||
index d60840837c1b609f6dffd866a582ad7ce787b916..6ebccc6fe6a4a005f44cc51cbe21301f18bcef38 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1421,6 +1421,8 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1455,6 +1455,8 @@ public class ServerGamePacketListenerImpl
|
||||
this.resetPosition();
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ index c91348eea1350728d8f6de7b8c3613cb44b5cdec..b260211fcf0dbe0d300a7c9769e6cd32
|
||||
if (this.player.hasClientLoaded()) {
|
||||
float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); final float toYaw = f; // Paper - OBFHELPER
|
||||
float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); final float toPitch = f1; // Paper - OBFHELPER
|
||||
@@ -1699,7 +1701,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1732,7 +1734,7 @@ public class ServerGamePacketListenerImpl
|
||||
&& !isFallFlying
|
||||
&& !isAutoSpinAttack
|
||||
&& this.noBlocksAround(this.player);
|
||||
- this.player.serverLevel().getChunkSource().move(this.player);
|
||||
+ if (!org.dreeam.leaf.config.modules.opt.ReduceChunkSourceUpdates.enabled || this.player.serverLevel() != serverLevel || this.player.chunkPosition() == playerStartChunkPosition) this.player.serverLevel().getChunkSource().move(this.player); // Leaf - Reduce PlayerChunk Updates
|
||||
- this.player.level().getChunkSource().move(this.player);
|
||||
+ if (!org.dreeam.leaf.config.modules.opt.ReduceChunkSourceUpdates.enabled || this.player.level() != serverLevel || this.player.chunkPosition() == playerStartChunkPosition) this.player.level().getChunkSource().move(this.player); // Leaf - Reduce PlayerChunk Updates
|
||||
Vec3 vec3 = new Vec3(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
|
||||
this.player.setOnGroundWithMovement(packet.isOnGround(), packet.horizontalCollision(), vec3);
|
||||
this.player.doCheckFallDamage(vec3.x, vec3.y, vec3.z, packet.isOnGround());
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Async switch connection state
|
||||
|
||||
|
||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||
index f3e9de8716f5e1a72ec465ee897c8f0413f7b1c3..3dce0665e7438d2994a86450e31fb2a10431df9b 100644
|
||||
index 2fda4bf1aeecba183ba6301f83f582ae34f5a3da..df012a4c67d474125fafa01b1677d9220fc817ae 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -342,6 +342,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -69,7 +69,7 @@ index f3e9de8716f5e1a72ec465ee897c8f0413f7b1c3..3dce0665e7438d2994a86450e31fb2a1
|
||||
if (this.packetListener != null) {
|
||||
throw new IllegalStateException("Listener already set");
|
||||
diff --git a/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java b/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
index 2e9eb04c7c4342393c05339906c267bca9ff29b1..53b9daa909c2b89046d5af515e17afe09ea7015a 100644
|
||||
index b57f4e2528d73c3ba949cb7e5dce73871049968c..6b6a51af0198db0e157ee4cf5bd6b7751b69d3e5 100644
|
||||
--- a/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
@@ -140,11 +140,34 @@ public class ServerConfigurationPacketListenerImpl extends ServerCommonPacketLis
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimize BlockEntities tickersInLevel
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index e82e55ec400c5e338502ed7ce433372a88d4acff..31f19dfe16e270b55f3b44754c97ed8d9fa422cf 100644
|
||||
index 514a918fff9bf60293fbfa6def4a2f9fead30825..a3674ddb883eecb255279375a5e2eece7e016c0f 100644
|
||||
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -73,7 +73,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -75,7 +75,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
return "<null>";
|
||||
}
|
||||
};
|
||||
@@ -18,7 +18,7 @@ Setting the gamerule "doTileDrop" to false was to simulate a server that has chu
|
||||
Note: This might increase the item output of a cacti farm, though in theory it should act the same as vanilla.
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/CactusBlock.java b/net/minecraft/world/level/block/CactusBlock.java
|
||||
index 0f8cfa5423cd1813c655237aa544dad2dc56ba4d..246193cc914f88cba2eb5959bd3fd8e56e7ebc61 100644
|
||||
index 2e79ce7e02aaa4abcef1507bba71e0305b6c696f..292260b769956f25c280e4a767382823ba500b58 100644
|
||||
--- a/net/minecraft/world/level/block/CactusBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CactusBlock.java
|
||||
@@ -52,25 +52,46 @@ public class CactusBlock extends Block implements BonemealableBlock { // Purpur
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Flush location while knockback
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index 4217131b5f7aa985d5af452554849847a36ce9ce..d1b7fffc20ccd00bcc82f830a1f53a85fd86658a 100644
|
||||
index 78dc237d5de38cff9f013d36da9bbb16104dec96..2dcc4446f898124dfc9134f9fae892167256d724 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1352,6 +1352,13 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1363,6 +1363,13 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
if (!cancelled) {
|
||||
@@ -22,7 +22,7 @@ index 4217131b5f7aa985d5af452554849847a36ce9ce..d1b7fffc20ccd00bcc82f830a1f53a85
|
||||
((ServerPlayer)target).connection.send(new ClientboundSetEntityMotionPacket(target));
|
||||
target.hurtMarked = false;
|
||||
target.setDeltaMovement(deltaMovement);
|
||||
@@ -1420,6 +1427,12 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1431,6 +1438,12 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Only tick items at hand
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 7abc297d91d6e1b21b855424b345dba4f4df37b6..0c81dca5905c2d4c166661dc3473b0c1e9aa5265 100644
|
||||
index aef01105b827cc5959cc0d6611baf85bee311e5b..0de1a0def8901e1003ee41186fd3660ca8b19434 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -834,12 +834,19 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -848,12 +848,19 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
super.tick();
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ index 7abc297d91d6e1b21b855424b345dba4f4df37b6..0c81dca5905c2d4c166661dc3473b0c1
|
||||
if (this.getHealth() != this.lastSentHealth
|
||||
|| this.lastSentFood != this.foodData.getFoodLevel()
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index d1b7fffc20ccd00bcc82f830a1f53a85fd86658a..688a63644a66c0cd3f08deb3786d756c310c079c 100644
|
||||
index 2dcc4446f898124dfc9134f9fae892167256d724..34fefafa3d3ed9a336dd57c51d6549b470c22b3a 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -639,7 +639,14 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -648,7 +648,14 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
this.tickRegeneration();
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise player movement checks
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index cc6b6b442d72b4a974cedd8ceef710304e52ab18..65a75480831d882e8318f702a519fb172dbc888a 100644
|
||||
index 13d0b21211e7d81fa57739854d3cc10ac03eff12..9ee4db861f66d1351e9a60cd4f41209002095b10 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1194,7 +1194,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1216,7 +1216,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable death item drop knockback settings
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 0c81dca5905c2d4c166661dc3473b0c1e9aa5265..373059fcccdab0a918aa1d1a4a613fb62fef8a18 100644
|
||||
index 0de1a0def8901e1003ee41186fd3660ca8b19434..b87c11ffbe450284c2ddc8760f287d64778a19d3 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1053,7 +1053,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1067,7 +1067,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
if (!keepInventory) {
|
||||
for (ItemStack item : this.getInventory().getContents()) {
|
||||
if (!item.isEmpty() && !EnchantmentHelper.has(item, net.minecraft.world.item.enchantment.EnchantmentEffectComponents.PREVENT_EQUIPMENT_DROP)) {
|
||||
@@ -18,10 +18,10 @@ index 0c81dca5905c2d4c166661dc3473b0c1e9aa5265..373059fcccdab0a918aa1d1a4a613fb6
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index d19d253ce100aee5e2a12eeb4ea50065760ed702..ae4d93515a28fb97e7abdfc06ce9ae31ec986fa8 100644
|
||||
index e04a84d7fd2185013695e66647ec6faab35423af..f95792b8642dc86a4d88e1d756de65d6cae2fa98 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -4083,9 +4083,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -4139,9 +4139,9 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
|
||||
if (randomizeMotion) {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Optimize getScaledTrackingDistance
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 574765713c194a6cf3eb7c125e78ed77c82aba2e..980d18434a79d1ff5e16b71aeaf34b486e665f9d 100644
|
||||
index 2e03020a67c7f59a3c554ab720fba831ed13ec82..d0429f38e3074560cb698b91b0d76967d1c2da20 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -786,7 +786,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimize isEyeInFluid
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 65a75480831d882e8318f702a519fb172dbc888a..e1a722c3ec74c0967d089ad469d7b3305bf66195 100644
|
||||
index 9ee4db861f66d1351e9a60cd4f41209002095b10..7573c566aace4b7661c5aed6d96653472bab81bb 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -269,6 +269,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -289,6 +289,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
protected Object2DoubleMap<TagKey<Fluid>> fluidHeight = new Object2DoubleArrayMap<>(2);
|
||||
protected boolean wasEyeInWater;
|
||||
private final Set<TagKey<Fluid>> fluidOnEyes = new HashSet<>();
|
||||
@@ -18,7 +18,7 @@ index 65a75480831d882e8318f702a519fb172dbc888a..e1a722c3ec74c0967d089ad469d7b330
|
||||
public int invulnerableTime;
|
||||
protected boolean firstTick = true;
|
||||
protected final SynchedEntityData entityData;
|
||||
@@ -2015,7 +2018,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2071,7 +2074,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
private void updateFluidOnEyes() {
|
||||
this.wasEyeInWater = this.isEyeInFluid(FluidTags.WATER);
|
||||
@@ -28,7 +28,7 @@ index 65a75480831d882e8318f702a519fb172dbc888a..e1a722c3ec74c0967d089ad469d7b330
|
||||
double eyeY = this.getEyeY();
|
||||
if (!(
|
||||
this.getVehicle() instanceof AbstractBoat abstractBoat
|
||||
@@ -2027,7 +2031,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2083,7 +2087,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
FluidState fluidState = this.level().getFluidState(blockPos);
|
||||
double d = blockPos.getY() + fluidState.getHeight(this.level(), blockPos);
|
||||
if (d > eyeY) {
|
||||
@@ -48,7 +48,7 @@ index 65a75480831d882e8318f702a519fb172dbc888a..e1a722c3ec74c0967d089ad469d7b330
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2107,9 +2122,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2163,9 +2178,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Cache block path type
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 980d18434a79d1ff5e16b71aeaf34b486e665f9d..97b84b658b27c338696641557d55eb9b7665199a 100644
|
||||
index d0429f38e3074560cb698b91b0d76967d1c2da20..6e3e5668213ccec7ed23b6fb8e082e1ca6f4d665 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -366,6 +366,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -17,10 +17,10 @@ index 980d18434a79d1ff5e16b71aeaf34b486e665f9d..97b84b658b27c338696641557d55eb9b
|
||||
if (org.purpurmc.purpur.PurpurConfig.beeCountPayload) org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur - Give bee counts in beehives to Purpur clients
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/Blocks.java b/net/minecraft/world/level/block/Blocks.java
|
||||
index 303bd27d44e4acfee49334235a6704724e3fd616..d001d0859c9508eb06f05010ab1cb8069f9b87cf 100644
|
||||
index 57aad048034005543a72556e990b53db8deebfee..6e6ee6f25f7cab0a6235d9e583ed5c01bca30edd 100644
|
||||
--- a/net/minecraft/world/level/block/Blocks.java
|
||||
+++ b/net/minecraft/world/level/block/Blocks.java
|
||||
@@ -7078,4 +7078,14 @@ public class Blocks {
|
||||
@@ -7066,4 +7066,14 @@ public class Blocks {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ powered rail logic from a single rail instead of each block iterating separately
|
||||
expensive but also completely unnecessary and with a lot of massive overhead
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/PoweredRailBlock.java b/net/minecraft/world/level/block/PoweredRailBlock.java
|
||||
index a2202d2b4352be07b2445064339c61ba6a2521c7..abf0ffa3540963f591f428876c0c671517594c89 100644
|
||||
index ebc0df13fc204472742a611b25f1ffd34478b042..1e2f6ef1db365747621d9814ffe3d63fe3e143d8 100644
|
||||
--- a/net/minecraft/world/level/block/PoweredRailBlock.java
|
||||
+++ b/net/minecraft/world/level/block/PoweredRailBlock.java
|
||||
@@ -122,6 +122,12 @@ public class PoweredRailBlock extends BaseRailBlock {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] optimize structure map
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
index 4fd9313ce2c87383685d80e2533b93d5b85a9f41..c9655ab6faf33fca2971629cd819f66da7024240 100644
|
||||
index d7dbe7d24a6697be6b5db729f940b16b74838d11..a294e64df092e29aec79429031afce4c97ec28d0 100644
|
||||
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
@@ -76,8 +76,8 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
@@ -77,8 +77,8 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
protected BlendingData blendingData;
|
||||
public final Map<Heightmap.Types, Heightmap> heightmaps = Maps.newEnumMap(Heightmap.Types.class);
|
||||
// Paper - rewrite chunk system
|
||||
@@ -19,7 +19,7 @@ index 4fd9313ce2c87383685d80e2533b93d5b85a9f41..c9655ab6faf33fca2971629cd819f66d
|
||||
protected final Map<BlockPos, CompoundTag> pendingBlockEntities = Maps.newHashMap();
|
||||
public final Map<BlockPos, BlockEntity> blockEntities = new Object2ObjectOpenHashMap<>();
|
||||
protected final LevelHeightAccessor levelHeightAccessor;
|
||||
@@ -303,7 +303,7 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
@@ -304,7 +304,7 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
}
|
||||
|
||||
public Map<Structure, StructureStart> getAllStarts() {
|
||||
@@ -28,7 +28,7 @@ index 4fd9313ce2c87383685d80e2533b93d5b85a9f41..c9655ab6faf33fca2971629cd819f66d
|
||||
}
|
||||
|
||||
public void setAllStarts(Map<Structure, StructureStart> structureStarts) {
|
||||
@@ -319,13 +319,13 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
@@ -320,13 +320,13 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||
|
||||
@Override
|
||||
public void addReferenceForStructure(Structure structure, long reference) {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add BlockExplosionHitEvent
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
||||
index 619d00f79276665777f3a58dec7a5f353bd7d660..33cd3a7755ada2fb632cfc97a80c8a9000ab0bd9 100644
|
||||
index 6c02b986e328ead2040666d619fdb5d397d9b686..a4460f98830eba9cbd695b52f98d07fe0631a4a5 100644
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -612,9 +612,13 @@ public class ServerExplosion implements Explosion {
|
||||
@@ -17,7 +17,7 @@ index dbf31389f0e9796c80afbffddf6a20cbaf184e6e..f1b456bf96e4764fd202f5575bbfa586
|
||||
public static final StringRepresentable.EnumCodec<EquipmentSlot> CODEC = StringRepresentable.fromEnum(() -> VALUES_ARRAY);
|
||||
// Gale end - JettPack - reduce array allocations
|
||||
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
||||
index 33cd3a7755ada2fb632cfc97a80c8a9000ab0bd9..c67a9aa4431134ea25baf83a3ca9a646c8d8140d 100644
|
||||
index a4460f98830eba9cbd695b52f98d07fe0631a4a5..9b2f0af96085f52ab8e31bdc1de1ae7435c2128d 100644
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -529,7 +529,7 @@ public class ServerExplosion implements Explosion {
|
||||
@@ -6,26 +6,26 @@ Subject: [PATCH] Use UUID for cure reputation
|
||||
Related MC issue: https://bugs.mojang.com/browse/MC/issues/MC-247647
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index 70e68d56f2d781930d877f40818d9aeb377dc8af..2afe1c0a7670b52cf4ae13949b4f8c67449b6490 100644
|
||||
index 1c75ba6c5595f0f554df2844663e8e6904055b23..8b9588e4e3599b3c957896dfd8b24fd0b77e3196 100644
|
||||
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -284,9 +284,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
villager.refreshBrain(level);
|
||||
@@ -283,9 +283,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
mob.refreshBrain(level);
|
||||
if (this.conversionStarter != null) {
|
||||
Player playerByUuid = level.getGlobalPlayerByUUID(this.conversionStarter); // Paper - check global player list where appropriate
|
||||
+ villager.onReputationEventFromUUID(ReputationEventType.ZOMBIE_VILLAGER_CURED, this.conversionStarter); // Leaf - Use UUID for cure reputation
|
||||
+ mob.onReputationEventFromUUID(ReputationEventType.ZOMBIE_VILLAGER_CURED, this.conversionStarter); // Leaf - Use UUID for cure reputation
|
||||
if (playerByUuid instanceof ServerPlayer) {
|
||||
CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer)playerByUuid, this, villager);
|
||||
- level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager);
|
||||
+ //level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager); // Leaf - Use UUID for cure reputation - move up
|
||||
CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer)playerByUuid, this, mob);
|
||||
- level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, mob);
|
||||
+ //level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, mob); // Leaf - Use UUID for cure reputation - move up
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 92895a38c5ef7962db83e085a99c0b3766052541..bac09fcb62226c05f419abd63acb9191de9ec7f0 100644
|
||||
index 8257c0d5bd7105c34e310b1a4da99b3cc5f02ac2..5a105cd026583ce33f0f1df24df683bb871b9fe1 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -1093,6 +1093,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -1095,6 +1095,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix crash during parsing unknown command message
|
||||
Use direct impl for unknown commands message parse to prevent crash
|
||||
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index 1e84f726f23877ed4be1aa901d7df0b11aa95552..30c3b7306611c52753af355e55464c0fa19511e0 100644
|
||||
index b30c69be528458792798724a1c6f7205785537bd..a6cd207eb10c7fd166fafb52d310c15e4019a981 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -669,7 +669,7 @@ public class Commands {
|
||||
@@ -687,7 +687,7 @@ public class Commands {
|
||||
net.kyori.adventure.text.Component detailComponent = null;
|
||||
|
||||
if (rawMessage.contains("<message>")) {
|
||||
@@ -18,7 +18,7 @@ index 1e84f726f23877ed4be1aa901d7df0b11aa95552..30c3b7306611c52753af355e55464c0f
|
||||
}
|
||||
|
||||
final String input = commandSyntaxException.getInput();
|
||||
@@ -712,7 +712,7 @@ public class Commands {
|
||||
@@ -730,7 +730,7 @@ public class Commands {
|
||||
private static net.kyori.adventure.text.Component getVanillaUnknownCommandMessage(
|
||||
net.kyori.adventure.text.TextComponent.Builder builder, CommandSyntaxException var7, String label
|
||||
) {
|
||||
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@ Some random optimizations
|
||||
- Secret patches (WIP)
|
||||
|
||||
diff --git a/net/minecraft/Util.java b/net/minecraft/Util.java
|
||||
index 2491ca5bcabcf8ae99ef990eed4e1fd94f799991..0a5e4eadde52e368842d958b166e0070cf1d9345 100644
|
||||
index 1f4208388a923f9a1667dc13d937955ac233d88e..6e3bd3944b56010c3eabcdcd11424518bbb980fa 100644
|
||||
--- a/net/minecraft/Util.java
|
||||
+++ b/net/minecraft/Util.java
|
||||
@@ -96,7 +96,7 @@ public class Util {
|
||||
@@ -33,10 +33,10 @@ index 2491ca5bcabcf8ae99ef990eed4e1fd94f799991..0a5e4eadde52e368842d958b166e0070
|
||||
|
||||
public static void shutdownExecutors() {
|
||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||
index 3dce0665e7438d2994a86450e31fb2a10431df9b..f9634a821fbfaf31a66e0e25973794149b1a5239 100644
|
||||
index df012a4c67d474125fafa01b1677d9220fc817ae..7992df93f4eebb9ca41b9bca2784aec718d4efb8 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -654,13 +654,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -644,13 +644,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
if (!(this.packetListener instanceof net.minecraft.server.network.ServerLoginPacketListenerImpl loginPacketListener)
|
||||
|| loginPacketListener.state != net.minecraft.server.network.ServerLoginPacketListenerImpl.State.VERIFYING
|
||||
|| Connection.joinAttemptsThisTick++ < MAX_PER_TICK) {
|
||||
@@ -100,10 +100,10 @@ index 4535858701b2bb232b9d2feb2af6551526232ddc..e65c62dbe4c1560ae153e4c4344e9194
|
||||
- // Paper end - detailed watchdog information
|
||||
}
|
||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 9dd6205e1cdd2124ab9d91f0a1e344eb6aa1fb2e..d8ae228fa4dfb265b628e83936f297f88c74aa57 100644
|
||||
index 12cf6dc9bac109a4feeeeede5f3762b20ea582bb..b450ac5e19d42765c739311de1566b7b0c11c88b 100644
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -622,8 +622,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -623,8 +623,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
try {
|
||||
this.chunkMap.collectSpawningChunks(list);
|
||||
// Paper start - chunk tick iteration optimisation
|
||||
@@ -117,10 +117,10 @@ index 9dd6205e1cdd2124ab9d91f0a1e344eb6aa1fb2e..d8ae228fa4dfb265b628e83936f297f8
|
||||
|
||||
for (LevelChunk levelChunk : list) {
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index c0044f4013520fd617ec365012b10862571744f3..14d23006d3ec15bb3ec6f976bff6c0975662c69d 100644
|
||||
index 117a8ef98c369bf0919e44fe823d6af0758816b5..47357e1d54563e30b4281c410a1ab70ccd672ad0 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1518,13 +1518,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1526,13 +1526,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
// Paper end - log detailed entity tick information
|
||||
|
||||
public void tickNonPassenger(Entity entity) {
|
||||
@@ -134,7 +134,7 @@ index c0044f4013520fd617ec365012b10862571744f3..14d23006d3ec15bb3ec6f976bff6c097
|
||||
entity.setOldPosAndRot();
|
||||
entity.tickCount++;
|
||||
entity.totalEntityAge++; // Paper - age-like counter for all entities
|
||||
@@ -1537,13 +1531,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1545,13 +1539,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
for (Entity entity1 : entity.getPassengers()) {
|
||||
this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2
|
||||
}
|
||||
@@ -149,10 +149,10 @@ index c0044f4013520fd617ec365012b10862571744f3..14d23006d3ec15bb3ec6f976bff6c097
|
||||
|
||||
private void tickPassenger(Entity ridingEntity, Entity passengerEntity, final boolean isActive) { // Paper - EAR 2
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index e1a722c3ec74c0967d089ad469d7b3305bf66195..5fda5eadd37ec52ca6470d4aeb18a20c192811be 100644
|
||||
index 7573c566aace4b7661c5aed6d96653472bab81bb..84808bf3311067409aad99817d3f1df2c098d83c 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1144,16 +1144,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1166,16 +1166,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.onGround;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ index e1a722c3ec74c0967d089ad469d7b3305bf66195..5fda5eadd37ec52ca6470d4aeb18a20c
|
||||
public void move(MoverType type, Vec3 movement) {
|
||||
// Gale start - VMP - skip entity move if movement is zero
|
||||
if (!this.boundingBoxChanged && movement.equals(Vec3.ZERO)) {
|
||||
@@ -1161,16 +1151,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1183,16 +1173,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Gale end - VMP - skip entity move if movement is zero
|
||||
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
||||
@@ -186,7 +186,7 @@ index e1a722c3ec74c0967d089ad469d7b3305bf66195..5fda5eadd37ec52ca6470d4aeb18a20c
|
||||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
} else {
|
||||
@@ -1304,13 +1285,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1316,13 +1297,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// Gale end - skip negligible planar movement multiplication
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ index e1a722c3ec74c0967d089ad469d7b3305bf66195..5fda5eadd37ec52ca6470d4aeb18a20c
|
||||
}
|
||||
|
||||
private void applyMovementEmissionAndPlaySound(Entity.MovementEmission movementEmission, Vec3 movement, BlockPos pos, BlockState state) {
|
||||
@@ -4862,9 +4836,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5051,9 +5025,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public void setDeltaMovement(Vec3 deltaMovement) {
|
||||
@@ -210,7 +210,7 @@ index e1a722c3ec74c0967d089ad469d7b3305bf66195..5fda5eadd37ec52ca6470d4aeb18a20c
|
||||
}
|
||||
|
||||
public void addDeltaMovement(Vec3 addend) {
|
||||
@@ -4972,9 +4944,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5161,9 +5133,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Paper end - Fix MC-4
|
||||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||
Reference in New Issue
Block a user