revert lithium-AI.patch (more investigation needed)

This commit is contained in:
Simon Gardling 2021-04-22 11:50:26 -04:00
parent c1a03b89af
commit 7cf4be9f2f
9 changed files with 24 additions and 27 deletions

View File

@ -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 | |

View File

@ -6,21 +6,20 @@ Subject: [PATCH] lithium entity
Co-authored-by: Hugo Planque <hookwood01@gmail.com>
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() {

View File

@ -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);
}

View File

@ -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<ResourceKey<World>> 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<World> THE_END = ResourceKey.a(IRegistry.L, new MinecraftKey("the_end"));
private static final EnumDirection[] a = EnumDirection.values();
//public final List<TileEntity> 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