diff --git a/1todos/server/minecraft-patches/features/0023-Modify-merge-ItemEntity-logic.patch b/1todos/server/minecraft-patches/features/0023-Modify-merge-ItemEntity-logic.patch deleted file mode 100644 index c69c668..0000000 --- a/1todos/server/minecraft-patches/features/0023-Modify-merge-ItemEntity-logic.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Helvetica Volubi -Date: Fri, 3 Oct 2025 19:43:36 +0800 -Subject: [PATCH] Modify merge ItemEntity logic - -Add followTickSequenceMerge to modify merge items, due to Paper's modification of the merge radius, when the merge radius is large and stacks containing many items get stuck in an unexpected position, individual items may never reach their destination. This configuration option is added to fix this behavior. - -diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java -index f3f067c62dc024a747d059608ae7a2e8740dbff2..1b8a963726ee2b2244d429f1e7e3a08034bfbd70 100644 ---- a/net/minecraft/world/entity/item/ItemEntity.java -+++ b/net/minecraft/world/entity/item/ItemEntity.java -@@ -283,7 +283,7 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish - ItemStack item = this.getItem(); - ItemStack item1 = itemEntity.getItem(); - if (Objects.equals(this.target, itemEntity.target) && areMergable(item, item1)) { -- if (item1.getCount() < item.getCount()) { -+ if (fun.bm.lophine.config.modules.misc.ItemEntityConfig.followTickSequenceMerge || item1.getCount() < item.getCount()) { // Lophine - add follow Tick Sequence Merge, see Paper#13073 - merge(this, item, itemEntity, item1); - } else { - merge(itemEntity, item1, this, item); diff --git a/lophine-server/minecraft-patches/features/0009-Modify-merge-ItemEntity-logic.patch b/lophine-server/minecraft-patches/features/0009-Modify-merge-ItemEntity-logic.patch new file mode 100644 index 0000000..df52957 --- /dev/null +++ b/lophine-server/minecraft-patches/features/0009-Modify-merge-ItemEntity-logic.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Helvetica Volubi +Date: Fri, 3 Oct 2025 19:43:36 +0800 +Subject: [PATCH] Modify merge ItemEntity logic + +Add followTickSequenceMerge to modify merge items, due to Paper's modification of the merge radius, +when the merge radius is large and stacks containing many items get stuck in an unexpected position, +individual items may never reach their destination. +This configuration option is added to fix this behavior. + +diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java +index aed1641b4e09384d40da1ac6e66c1641ca34b063..44b06b1585e7630fa17d8dfb01f737b14efebcbc 100644 +--- a/net/minecraft/world/entity/item/ItemEntity.java ++++ b/net/minecraft/world/entity/item/ItemEntity.java +@@ -287,7 +287,7 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish + ItemStack thisItemStack = this.getItem(); + ItemStack otherItemStack = other.getItem(); + if (Objects.equals(this.target, other.target) && areMergable(thisItemStack, otherItemStack)) { +- if (otherItemStack.getCount() < thisItemStack.getCount()) { ++ if (fun.bm.lophine.config.modules.misc.ItemEntityConfig.followTickSequenceMerge || otherItemStack.getCount() < thisItemStack.getCount()) { // Lophine - add follow Tick Sequence Merge, see Paper#13073 + merge(this, thisItemStack, other, otherItemStack); + } else { + merge(other, otherItemStack, this, thisItemStack); diff --git a/1todos/server/minecraft-patches/features/0003-Add-config-to-enable-raytracing-tracker.patch b/lophine-server/minecraft-patches/features/0010-Add-config-to-enable-raytracing-tracker.patch similarity index 72% rename from 1todos/server/minecraft-patches/features/0003-Add-config-to-enable-raytracing-tracker.patch rename to lophine-server/minecraft-patches/features/0010-Add-config-to-enable-raytracing-tracker.patch index 632132d..ef49ace 100644 --- a/1todos/server/minecraft-patches/features/0003-Add-config-to-enable-raytracing-tracker.patch +++ b/lophine-server/minecraft-patches/features/0010-Add-config-to-enable-raytracing-tracker.patch @@ -5,32 +5,32 @@ Subject: [PATCH] Add config to enable raytracing tracker diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java -index bca2c5410aa543d2bb421e53893e9163508b3568..fdccb06c918d387e46c29ede7337159db8c5d9ca 100644 +index 0c0775bbb0c0ba0c37d1b884bb106b5250e94750..0dfb25ad032429a2aea7aa441dd5fd1848a6c617 100644 --- a/net/minecraft/server/level/ChunkMap.java +++ b/net/minecraft/server/level/ChunkMap.java @@ -1350,7 +1350,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP - double d1 = vec3_dx * vec3_dx + vec3_dz * vec3_dz; // Paper - double d2 = d * d; + double distanceSquared = deltaToPlayerX * deltaToPlayerX + deltaToPlayerZ * deltaToPlayerZ; // Paper + double rangeSquared = visibleRange * visibleRange; // Paper start - Configurable entity tracking range by Y -- boolean flag = d1 <= d2; -+ boolean flag = d1 <= d2 && !entity.isCulled(); // Luminol - Ray tracing entity tracker - if (flag && level.paperConfig().entities.trackingRangeY.enabled) { +- boolean visibleToPlayer = distanceSquared <= rangeSquared; ++ boolean visibleToPlayer = distanceSquared <= rangeSquared && !entity.isCulled(); // Luminol - Ray tracing entity tracker + if (visibleToPlayer && level.paperConfig().entities.trackingRangeY.enabled) { double rangeY = level.paperConfig().entities.trackingRangeY.get(this.entity, -1); if (rangeY != -1) { diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 040c0f8d26554ba583ecf370e2df3690d8f48dd6..22e68cabb4554c3e21e6f4ef316186f60ec77511 100644 +index 0e543348e48fdf2131dfa1460e37db238d02988c..b69698f47ccb0f1ac3eeea05a02ab9d798319b44 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -152,7 +152,7 @@ import org.jetbrains.annotations.Contract; - import org.jspecify.annotations.Nullable; - import org.slf4j.Logger; - --public abstract class Entity implements SyncedDataHolder, DebugValueSource, Nameable, ItemOwner, SlotProvider, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker -+public abstract class Entity implements SyncedDataHolder, DebugValueSource, Nameable, ItemOwner, SlotProvider, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity, dev.tr7zw.entityculling.versionless.access.Cullable { // Paper - rewrite chunk system // Paper - optimise entity tracker // Luminol - Ray tracing entity tracker +@@ -167,7 +167,7 @@ public abstract class Entity + ItemOwner, + SlotProvider, + DebugValueSource, +- TypedInstance>, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker ++ TypedInstance>, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity, dev.tr7zw.entityculling.versionless.access.Cullable { // Paper - rewrite chunk system // Paper - optimise entity tracker // Luminol - Ray tracing entity tracker // CraftBukkit start private static final int CURRENT_LEVEL = 2; static boolean isLevelAtLeast(ValueInput input, int level) { -@@ -6442,4 +6442,46 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name +@@ -6412,4 +6412,46 @@ public abstract class Entity // Paper end - Expose entity id counter public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG @@ -78,10 +78,10 @@ index 040c0f8d26554ba583ecf370e2df3690d8f48dd6..22e68cabb4554c3e21e6f4ef316186f6 + } diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java -index 0590d5723854a03a59fe9471710802f4e64e50b8..4f8ff2c024d6f2e67c5fa38fe2e660ba39e35499 100644 +index cb0a52dc3795e1cf54069bcbe82abf7877a658b8..1440946665f41ebf534d701515f982bbbf4c9686 100644 --- a/net/minecraft/world/entity/EntityType.java +++ b/net/minecraft/world/entity/EntityType.java -@@ -1254,6 +1254,9 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -1252,6 +1252,9 @@ public class EntityType implements EntityTypeTest, public final int passengerTickTimerId; public final int passengerInactiveTickTimerId; // Folia end - profiler @@ -90,12 +90,12 @@ index 0590d5723854a03a59fe9471710802f4e64e50b8..4f8ff2c024d6f2e67c5fa38fe2e660ba + // Luminol end public EntityType( - EntityType.EntityFactory factory, + final EntityType.EntityFactory factory, diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index 67c0f4027a1e8b364694b5ed8b71965f2fe9b359..0f6e1428cc71c370af45db3e2a4f47c66e5d8628 100644 +index 1b9fca50508a77f2b835edcdce153935b566d143..9061d9f980bec5cc362fa3aadd603c0c5193ad90 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -189,6 +189,25 @@ public abstract class Player extends Avatar implements ContainerUser { +@@ -185,6 +185,25 @@ public abstract class Player extends Avatar implements ContainerUser { return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity(); } // CraftBukkit end @@ -119,9 +119,9 @@ index 67c0f4027a1e8b364694b5ed8b71965f2fe9b359..0f6e1428cc71c370af45db3e2a4f47c6 + } + // Luminol end - public Player(Level level, GameProfile gameProfile) { + public Player(final Level level, final GameProfile gameProfile) { super(EntityType.PLAYER, level); -@@ -245,6 +264,26 @@ public abstract class Player extends Avatar implements ContainerUser { +@@ -240,6 +259,26 @@ public abstract class Player extends Avatar implements ContainerUser { @Override public void tick() { @@ -148,7 +148,7 @@ index 67c0f4027a1e8b364694b5ed8b71965f2fe9b359..0f6e1428cc71c370af45db3e2a4f47c6 this.noPhysics = this.isSpectator(); if (this.isSpectator() || this.isPassenger()) { this.setOnGround(false); -@@ -1353,6 +1392,7 @@ public abstract class Player extends Avatar implements ContainerUser { +@@ -1352,6 +1391,7 @@ public abstract class Player extends Avatar implements ContainerUser { if (this.hasContainerOpen()) { this.doCloseContainer(); } diff --git a/1todos/server/minecraft-patches/features/0020-Old-zombie-reinforcement.patch b/lophine-server/minecraft-patches/features/0011-Old-zombie-reinforcement.patch similarity index 63% rename from 1todos/server/minecraft-patches/features/0020-Old-zombie-reinforcement.patch rename to lophine-server/minecraft-patches/features/0011-Old-zombie-reinforcement.patch index 03f4376..d5a1e10 100644 --- a/1todos/server/minecraft-patches/features/0020-Old-zombie-reinforcement.patch +++ b/lophine-server/minecraft-patches/features/0011-Old-zombie-reinforcement.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Old zombie reinforcement diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java -index 7a9394d4555464312418964f1a7a5d2581496774..3fcd32cc77458ce196ce0e468c1a99f456a57604 100644 +index 0008aa0ca02fc4ea67b795b3f0a0e9656233ce89..2734ffc103ee4760d3521609fdd090ab99df675b 100644 --- a/net/minecraft/world/entity/monster/zombie/Zombie.java +++ b/net/minecraft/world/entity/monster/zombie/Zombie.java -@@ -314,7 +314,7 @@ public class Zombie extends Monster { - int floor = Mth.floor(this.getX()); - int floor1 = Mth.floor(this.getY()); - int floor2 = Mth.floor(this.getZ()); +@@ -331,7 +331,7 @@ public class Zombie extends Monster { + int x = Mth.floor(this.getX()); + int y = Mth.floor(this.getY()); + int z = Mth.floor(this.getZ()); - EntityType type = this.getType(); + EntityType type = fun.bm.lophine.config.modules.function.OldFeatureConfig.oldZombieReinforcement ? EntityType.ZOMBIE : this.getType(); // Lophine - old zombie reinforcement - Zombie zombie = type.create(level, EntitySpawnReason.REINFORCEMENT); - if (zombie == null) { + Zombie reinforcement = type.create(level, EntitySpawnReason.REINFORCEMENT); + if (reinforcement == null) { return true; diff --git a/1todos/server/minecraft-patches/features/0021-Spawn-invulnerable-time.patch b/lophine-server/minecraft-patches/features/0012-Spawn-invulnerable-time.patch similarity index 73% rename from 1todos/server/minecraft-patches/features/0021-Spawn-invulnerable-time.patch rename to lophine-server/minecraft-patches/features/0012-Spawn-invulnerable-time.patch index 3c35517..1f4c897 100644 --- a/1todos/server/minecraft-patches/features/0021-Spawn-invulnerable-time.patch +++ b/lophine-server/minecraft-patches/features/0012-Spawn-invulnerable-time.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Spawn invulnerable time diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index dcdb01fe5333d407a10f9872d09992c7b438ddeb..6df8f98afa7810815b8d7c86b3dac57cd5915682 100644 +index 4fe7841720e059f2dfc0984a37b3200804875d22..6feb00ab2cf81bd0bd36bd0fc7784fc57a79d93d 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -240,6 +240,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -242,6 +242,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc private int lastSentFood = -99999999; private boolean lastFoodSaturationZero = true; public int lastSentExp = -99999999; @@ -16,7 +16,7 @@ index dcdb01fe5333d407a10f9872d09992c7b438ddeb..6df8f98afa7810815b8d7c86b3dac57c private ChatVisiblity chatVisibility = ChatVisiblity.FULL; public ParticleStatus particleStatus = ParticleStatus.ALL; private boolean canChatColor = true; -@@ -898,6 +899,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -920,6 +921,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.connection.tickClientLoadTimeout(); this.gameMode.tick(); this.wardenSpawnTracker.tick(); @@ -24,17 +24,17 @@ index dcdb01fe5333d407a10f9872d09992c7b438ddeb..6df8f98afa7810815b8d7c86b3dac57c if (this.invulnerableTime > 0) { this.invulnerableTime--; } -@@ -1536,6 +1538,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc - if (this.isInvulnerableTo(level, damageSource)) { +@@ -1547,6 +1549,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc + if (this.isInvulnerableTo(level, source)) { return false; } else { + // Lophine start - spawn invulnerable time + if (fun.bm.lophine.config.modules.function.OldFeatureConfig.spawnInvulnerableTime) { -+ if (this.spawnInvulnerableTime > 0 && !damageSource.is(net.minecraft.tags.DamageTypeTags.BYPASSES_INVULNERABILITY)) { ++ if (this.spawnInvulnerableTime > 0 && !source.is(net.minecraft.tags.DamageTypeTags.BYPASSES_INVULNERABILITY)) { + return false; + } + } + // Lophine end - spawn invulnerable time - Entity entity = damageSource.getEntity(); + Entity entity = source.getEntity(); if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false. - !(entity instanceof Player player && !this.canHarmPlayer(player)) + !(entity instanceof Player playerx && !this.canHarmPlayer(playerx)) diff --git a/1todos/server/src/com/logisticscraft/occlusionculling/DataProvider.java b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/DataProvider.java similarity index 100% rename from 1todos/server/src/com/logisticscraft/occlusionculling/DataProvider.java rename to lophine-server/src/main/java/com/logisticscraft/occlusionculling/DataProvider.java diff --git a/1todos/server/src/com/logisticscraft/occlusionculling/OcclusionCullingInstance.java b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/OcclusionCullingInstance.java similarity index 100% rename from 1todos/server/src/com/logisticscraft/occlusionculling/OcclusionCullingInstance.java rename to lophine-server/src/main/java/com/logisticscraft/occlusionculling/OcclusionCullingInstance.java diff --git a/1todos/server/src/com/logisticscraft/occlusionculling/cache/ArrayOcclusionCache.java b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/cache/ArrayOcclusionCache.java similarity index 100% rename from 1todos/server/src/com/logisticscraft/occlusionculling/cache/ArrayOcclusionCache.java rename to lophine-server/src/main/java/com/logisticscraft/occlusionculling/cache/ArrayOcclusionCache.java diff --git a/1todos/server/src/com/logisticscraft/occlusionculling/cache/OcclusionCache.java b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/cache/OcclusionCache.java similarity index 100% rename from 1todos/server/src/com/logisticscraft/occlusionculling/cache/OcclusionCache.java rename to lophine-server/src/main/java/com/logisticscraft/occlusionculling/cache/OcclusionCache.java diff --git a/1todos/server/src/com/logisticscraft/occlusionculling/util/MathUtilities.java b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/MathUtilities.java similarity index 100% rename from 1todos/server/src/com/logisticscraft/occlusionculling/util/MathUtilities.java rename to lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/MathUtilities.java diff --git a/1todos/server/src/com/logisticscraft/occlusionculling/util/Vec3d.java b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/Vec3d.java similarity index 100% rename from 1todos/server/src/com/logisticscraft/occlusionculling/util/Vec3d.java rename to lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/Vec3d.java diff --git a/1todos/server/src/dev/tr7zw/entityculling/CullTask.java b/lophine-server/src/main/java/dev/tr7zw/entityculling/CullTask.java similarity index 100% rename from 1todos/server/src/dev/tr7zw/entityculling/CullTask.java rename to lophine-server/src/main/java/dev/tr7zw/entityculling/CullTask.java diff --git a/1todos/server/src/dev/tr7zw/entityculling/DefaultChunkDataProvider.java b/lophine-server/src/main/java/dev/tr7zw/entityculling/DefaultChunkDataProvider.java similarity index 100% rename from 1todos/server/src/dev/tr7zw/entityculling/DefaultChunkDataProvider.java rename to lophine-server/src/main/java/dev/tr7zw/entityculling/DefaultChunkDataProvider.java diff --git a/1todos/server/src/dev/tr7zw/entityculling/versionless/access/Cullable.java b/lophine-server/src/main/java/dev/tr7zw/entityculling/versionless/access/Cullable.java similarity index 100% rename from 1todos/server/src/dev/tr7zw/entityculling/versionless/access/Cullable.java rename to lophine-server/src/main/java/dev/tr7zw/entityculling/versionless/access/Cullable.java diff --git a/1todos/server/config-files/experiment/RayTrackingEntityTrackerConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/RayTrackingEntityTrackerConfig.java similarity index 100% rename from 1todos/server/config-files/experiment/RayTrackingEntityTrackerConfig.java rename to lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/RayTrackingEntityTrackerConfig.java diff --git a/1todos/server/config-files/function/OldFeatureConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/function/OldFeatureConfig.java similarity index 59% rename from 1todos/server/config-files/function/OldFeatureConfig.java rename to lophine-server/src/main/java/fun/bm/lophine/config/modules/function/OldFeatureConfig.java index 30f6ba3..8d40f9d 100644 --- a/1todos/server/config-files/function/OldFeatureConfig.java +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/function/OldFeatureConfig.java @@ -13,14 +13,14 @@ public class OldFeatureConfig implements IConfigModule { @ConfigInfo(name = "old_zombie_reinforcement") public static boolean oldZombieReinforcement = false; - @ConfigInfo(name = "old_explosion_damage_calculator") - public static boolean oldExplosionDamageCalculator = false; - - @ConfigInfo(name = "old_raid_behavior") - public static boolean oldRaidBehavior = false; - - @ConfigInfo(name = "villager-void-trade", comments = - """ - Allow villager void trade.""") - public static boolean villagerVoidTrade = false; +// @ConfigInfo(name = "old_explosion_damage_calculator") +// public static boolean oldExplosionDamageCalculator = false; +// +// @ConfigInfo(name = "old_raid_behavior") +// public static boolean oldRaidBehavior = false; +// +// @ConfigInfo(name = "villager-void-trade", comments = +// """ +// Allow villager void trade.""") +// public static boolean villagerVoidTrade = false; } \ No newline at end of file diff --git a/1todos/server/config-files/misc/ItemEntityConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/ItemEntityConfig.java similarity index 100% rename from 1todos/server/config-files/misc/ItemEntityConfig.java rename to lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/ItemEntityConfig.java