2021-04-18 02:13:30 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: JellySquid <jellysquid+atwork@protonmail.com>
|
|
|
|
Date: Sun, 24 Jan 2021 22:55:55 +0100
|
|
|
|
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
|
2021-06-08 20:22:10 +02:00
|
|
|
index 4de845117c06915943d517bdab7fcc3651589dcf..a0d1d98135cfea5b2afa2b68a1ab95aa46b8f485 100644
|
2021-04-18 02:13:30 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
2021-06-03 04:37:38 +02:00
|
|
|
@@ -276,6 +276,9 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
this.bg = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap()))));
|
2021-04-18 02:13:30 +02:00
|
|
|
}
|
2021-04-22 17:50:26 +02:00
|
|
|
|
2021-04-18 02:13:30 +02:00
|
|
|
+ private IBlockData lastStateAtFeet = null;
|
|
|
|
+
|
|
|
|
+ private long lastPos = Long.MIN_VALUE;
|
2021-04-22 17:50:26 +02:00
|
|
|
public BehaviorController<?> getBehaviorController() {
|
2021-06-03 04:37:38 +02:00
|
|
|
return this.bg;
|
|
|
|
}
|
|
|
|
@@ -350,6 +353,10 @@ public abstract class EntityLiving extends Entity {
|
2021-04-18 02:13:30 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void entityBaseTick() {
|
|
|
|
+ // Yatopia start - port lithium
|
|
|
|
+ this.lastStateAtFeet = null;
|
|
|
|
+ this.lastPos = Long.MIN_VALUE;
|
|
|
|
+ // Yatopia end
|
|
|
|
this.ar = this.as;
|
|
|
|
if (this.justCreated) {
|
|
|
|
this.getBedPosition().ifPresent(this::a);
|
2021-06-03 04:37:38 +02:00
|
|
|
@@ -1767,7 +1774,24 @@ public abstract class EntityLiving extends Entity {
|
2021-04-27 18:40:55 +02:00
|
|
|
// Airplane end
|
2021-04-18 02:13:30 +02:00
|
|
|
|
|
|
|
public IBlockData ds() {
|
2021-04-21 18:12:08 +02:00
|
|
|
- return this.world.getBlockStateIfLoaded(this.getChunkCoordinates()); // Yatopia
|
2021-04-18 02:13:30 +02:00
|
|
|
+ // Yatopia start - port lithium
|
|
|
|
+ int x = MathHelper.floor(this.locX());
|
|
|
|
+ int y = MathHelper.floor(this.locY());
|
|
|
|
+ int z = MathHelper.floor(this.locZ());
|
|
|
|
+
|
|
|
|
+ long pos = getChunkCoordinates().asLong();
|
|
|
|
+
|
|
|
|
+ if (this.lastPos == pos) {
|
|
|
|
+ return this.lastStateAtFeet;
|
|
|
|
+ }
|
|
|
|
+
|
2021-04-21 18:12:08 +02:00
|
|
|
+ IBlockData state = this.world.getBlockStateIfLoaded(this.getChunkCoordinates());
|
2021-04-18 02:13:30 +02:00
|
|
|
+
|
|
|
|
+ this.lastPos = pos;
|
|
|
|
+ this.lastStateAtFeet = state;
|
|
|
|
+
|
|
|
|
+ return state;
|
|
|
|
+ // Yatopia end
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean c(BlockPosition blockposition, IBlockData iblockdata) {
|