From 7cf4be9f2f164591db4835e82437154766fc1d5d Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 22 Apr 2021 11:50:26 -0400 Subject: [PATCH] revert lithium-AI.patch (more investigation needed) --- PATCHES.md | 2 -- .../server/0065-lithium-AI.patch | 0 ...-use-vanilla-method-for-getClosestEn.patch | 0 ...m-block.patch => 0065-lithium-block.patch} | 0 ...entity.patch => 0066-lithium-entity.patch} | 15 ++++++------- ...thium-gen.patch => 0067-lithium-gen.patch} | 0 ...m-shape.patch => 0068-lithium-shape.patch} | 12 +++++----- ...ing-block-entities-that-are-doing-n.patch} | 22 +++++++++---------- ...-Multithreaded-Entity-Tracker-fixup.patch} | 0 9 files changed, 24 insertions(+), 27 deletions(-) rename patches/{ => removed}/server/0065-lithium-AI.patch (100%) rename patches/{ => removed}/server/0072-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch (100%) rename patches/server/{0066-lithium-block.patch => 0065-lithium-block.patch} (100%) rename patches/server/{0067-lithium-entity.patch => 0066-lithium-entity.patch} (76%) rename patches/server/{0068-lithium-gen.patch => 0067-lithium-gen.patch} (100%) rename patches/server/{0069-lithium-shape.patch => 0068-lithium-shape.patch} (96%) rename patches/server/{0070-lithium-skip-ticking-block-entities-that-are-doing-n.patch => 0069-lithium-skip-ticking-block-entities-that-are-doing-n.patch} (98%) rename patches/server/{0071-Multithreaded-Entity-Tracker-fixup.patch => 0070-Multithreaded-Entity-Tracker-fixup.patch} (100%) diff --git a/PATCHES.md b/PATCHES.md index c2a2dc3c..2caa99f3 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -430,8 +430,6 @@ This is an overview over all patches that are currently used. | server | Zombie horse naturally spawn | William Blake Galbreath | | | server | add config for logging login location | Simon Gardling | | | server | dont load chunks for physics | Aikar | | -| server | lithium AI | JellySquid | Hugo Planque | -| server | lithium AI fixup: use vanilla method for getClosestEntity | Simon Gardling | | | server | lithium DataTrackerMixin | JellySquid | tr7zw | | server | lithium HashedList | JellySquid | | | server | lithium MixinBox | JellySquid | | diff --git a/patches/server/0065-lithium-AI.patch b/patches/removed/server/0065-lithium-AI.patch similarity index 100% rename from patches/server/0065-lithium-AI.patch rename to patches/removed/server/0065-lithium-AI.patch diff --git a/patches/server/0072-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch b/patches/removed/server/0072-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch similarity index 100% rename from patches/server/0072-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch rename to patches/removed/server/0072-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch diff --git a/patches/server/0066-lithium-block.patch b/patches/server/0065-lithium-block.patch similarity index 100% rename from patches/server/0066-lithium-block.patch rename to patches/server/0065-lithium-block.patch diff --git a/patches/server/0067-lithium-entity.patch b/patches/server/0066-lithium-entity.patch similarity index 76% rename from patches/server/0067-lithium-entity.patch rename to patches/server/0066-lithium-entity.patch index aac0736f..2de319a4 100644 --- a/patches/server/0067-lithium-entity.patch +++ b/patches/server/0066-lithium-entity.patch @@ -6,21 +6,20 @@ Subject: [PATCH] lithium entity Co-authored-by: Hugo Planque diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index a897ad3de8c18be8bb3c320950a7421477040e8a..a182cb8d641dbf8756267901a682f8e3e2a4c67c 100644 +index a057be22f488f76b926c81dc5c63e7f9c3fb54a1..45924c33b2928e25dedaae22d06f2a7a181ead25 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java -@@ -286,6 +286,10 @@ public abstract class EntityLiving extends Entity { - public NearbyEntityListenerMulti getListener() { - return this.tracker; +@@ -279,6 +279,9 @@ public abstract class EntityLiving extends Entity { + this.bg = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap())))); } -+ + + private IBlockData lastStateAtFeet = null; + + private long lastPos = Long.MIN_VALUE; - // Yatopia end protected void initAttributes() {} // Purpur -@@ -363,6 +367,10 @@ public abstract class EntityLiving extends Entity { + public BehaviorController getBehaviorController() { +@@ -355,6 +358,10 @@ public abstract class EntityLiving extends Entity { @Override public void entityBaseTick() { @@ -31,7 +30,7 @@ index a897ad3de8c18be8bb3c320950a7421477040e8a..a182cb8d641dbf8756267901a682f8e3 this.ar = this.as; if (this.justCreated) { this.getBedPosition().ifPresent(this::a); -@@ -1783,7 +1791,24 @@ public abstract class EntityLiving extends Entity { +@@ -1775,7 +1782,24 @@ public abstract class EntityLiving extends Entity { } public IBlockData ds() { diff --git a/patches/server/0068-lithium-gen.patch b/patches/server/0067-lithium-gen.patch similarity index 100% rename from patches/server/0068-lithium-gen.patch rename to patches/server/0067-lithium-gen.patch diff --git a/patches/server/0069-lithium-shape.patch b/patches/server/0068-lithium-shape.patch similarity index 96% rename from patches/server/0069-lithium-shape.patch rename to patches/server/0068-lithium-shape.patch index 32023d61..2ece7899 100644 --- a/patches/server/0069-lithium-shape.patch +++ b/patches/server/0068-lithium-shape.patch @@ -270,10 +270,10 @@ index b95115aca72ba0cf6451096ddbd8b50a8f3bb5c6..0afb8c643cb3e5938e12183c6132797d int j = i - 1; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7befe4263a2d046922438e1a9853f2d8290ee230..ab5fb00885d22126639e7459ef71c56be4b5eb9e 100644 +index cd1f94e5c1c923ee9d8dd451406ac2bee360e9c3..8735735eb116382b21b6751108629acb9411d332 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2647,6 +2647,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne +@@ -2646,6 +2646,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return this.isSneaking(); } @@ -282,18 +282,18 @@ index 7befe4263a2d046922438e1a9853f2d8290ee230..ab5fb00885d22126639e7459ef71c56b return this.isSneaking(); } diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 20c2c05ab09ac3f2b2924f2b5bc938fdc5cdd32e..e0d2d2f617594674824cdff34cdcfadaa16ac291 100644 +index fab55929f72c5784291b3bc87f7717ac24b7806f..024b1c8939a93e2802ea53eefc49dda182412f28 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -56,6 +56,7 @@ import net.minecraft.world.phys.shapes.VoxelShapes; +@@ -55,6 +55,7 @@ import net.minecraft.world.phys.shapes.VoxelShape; + import net.minecraft.world.phys.shapes.VoxelShapes; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - import me.jellysquid.mods.lithium.common.ai.pathing.PathNodeDefaults; +import me.jellysquid.mods.lithium.common.util.collections.Object2BooleanCacheTable; public class Block extends BlockBase implements IMaterial { -@@ -229,8 +230,14 @@ public class Block extends BlockBase implements IMaterial { +@@ -217,8 +218,14 @@ public class Block extends BlockBase implements IMaterial { return a(voxelshape1); } diff --git a/patches/server/0070-lithium-skip-ticking-block-entities-that-are-doing-n.patch b/patches/server/0069-lithium-skip-ticking-block-entities-that-are-doing-n.patch similarity index 98% rename from patches/server/0070-lithium-skip-ticking-block-entities-that-are-doing-n.patch rename to patches/server/0069-lithium-skip-ticking-block-entities-that-are-doing-n.patch index 38e3d9f1..fc56bc43 100644 --- a/patches/server/0070-lithium-skip-ticking-block-entities-that-are-doing-n.patch +++ b/patches/server/0069-lithium-skip-ticking-block-entities-that-are-doing-n.patch @@ -621,13 +621,13 @@ index 0000000000000000000000000000000000000000..4e765ab19ffb300b6c810333b2dc7976 +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java -index db2b1863b7f46be53839fb3e86870745fb7567fd..8cecf61169d28b7ddb8e1af180ac8bc0e5fef324 100644 +index f5badbe0dee5c40cf83a5d2993d27ed70ddd2c85..a23c5172857a003b546e33d2935492e3260be560 100644 --- a/src/main/java/net/minecraft/world/level/World.java +++ b/src/main/java/net/minecraft/world/level/World.java -@@ -98,8 +98,11 @@ import org.bukkit.event.block.BlockPhysicsEvent; +@@ -97,8 +97,11 @@ import org.bukkit.event.block.BlockPhysicsEvent; + // CraftBukkit end import net.gegy1000.tictacs.NonBlockingWorldAccess; // Yatopia - import me.jellysquid.mods.lithium.common.entity.tracker.EntityTrackerEngine; // Yatopia +import me.jellysquid.mods.lithium.common.util.collections.MaskedTickingBlockEntityList; // Yatopia +import me.jellysquid.mods.lithium.common.world.blockentity.BlockEntitySleepTracker; // Yatopia +import me.jellysquid.mods.lithium.common.world.blockentity.SleepingBlockEntity; // Yatopia @@ -637,7 +637,7 @@ index db2b1863b7f46be53839fb3e86870745fb7567fd..8cecf61169d28b7ddb8e1af180ac8bc0 protected static final Logger LOGGER = LogManager.getLogger(); public static final Codec> f = MinecraftKey.a.xmap(ResourceKey.b(IRegistry.L), ResourceKey::a); -@@ -108,9 +111,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki +@@ -107,9 +110,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki public static final ResourceKey THE_END = ResourceKey.a(IRegistry.L, new MinecraftKey("the_end")); private static final EnumDirection[] a = EnumDirection.values(); //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list @@ -656,16 +656,16 @@ index db2b1863b7f46be53839fb3e86870745fb7567fd..8cecf61169d28b7ddb8e1af180ac8bc0 public final Thread serverThread; private final boolean debugWorld; private int d; -@@ -371,6 +382,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki +@@ -368,6 +379,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki + this.keepSpawnInMemory = this.paperConfig.keepSpawnInMemory; // Paper this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); - this.tracker = new EntityTrackerEngine(); // Yatopia - Port lithium + this.tileEntityListTick$lithium = new MaskedTickingBlockEntityList<>(this.tileEntityListTick, blockEntity -> ((SleepingBlockEntity) blockEntity).canTickOnSide(false)); // Yatopia + this.tileEntityListTick = tileEntityListTick$lithium; // Yatopia } - // Yatopia start - Port lithium -@@ -1041,6 +1054,15 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki + // Paper start +@@ -1032,6 +1045,15 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki } @@ -681,7 +681,7 @@ index db2b1863b7f46be53839fb3e86870745fb7567fd..8cecf61169d28b7ddb8e1af180ac8bc0 public void tickBlockEntities() { GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); -@@ -1063,11 +1085,19 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki +@@ -1054,11 +1076,19 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki this.tickingTileEntities = true; // Spigot start @@ -701,7 +701,7 @@ index db2b1863b7f46be53839fb3e86870745fb7567fd..8cecf61169d28b7ddb8e1af180ac8bc0 // Spigot start if (tileentity == null) { getServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); -@@ -1105,8 +1135,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki +@@ -1096,8 +1126,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki throwable.printStackTrace(); getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Paper end @@ -711,7 +711,7 @@ index db2b1863b7f46be53839fb3e86870745fb7567fd..8cecf61169d28b7ddb8e1af180ac8bc0 continue; // Paper end // Spigot start -@@ -1119,8 +1148,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki +@@ -1110,8 +1139,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable, NonBlocki if (tileentity.isRemoved()) { // Spigot start diff --git a/patches/server/0071-Multithreaded-Entity-Tracker-fixup.patch b/patches/server/0070-Multithreaded-Entity-Tracker-fixup.patch similarity index 100% rename from patches/server/0071-Multithreaded-Entity-Tracker-fixup.patch rename to patches/server/0070-Multithreaded-Entity-Tracker-fixup.patch