diff --git a/README.md b/README.md index e919a6330..4940d8022 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,6 @@ See the patches list below. [IonSpigot-0003] Explosion Improvements [IonSpigot-0006] Fix Chunk Loading -[IonSpigot-0012] Movement Cache [IonSpigot-0013] Implement PandaWire [IonSpigot-0014] Faster Chunk Entity List [IonSpigot-0020] Faster EntityTracker Collections diff --git a/WindSpigot-Server/src/main/java/com/windpvp/windspigot/world/WorldTicker.java b/WindSpigot-Server/src/main/java/com/windpvp/windspigot/world/WorldTicker.java index b96e1a9cc..fd1572a7c 100644 --- a/WindSpigot-Server/src/main/java/com/windpvp/windspigot/world/WorldTicker.java +++ b/WindSpigot-Server/src/main/java/com/windpvp/windspigot/world/WorldTicker.java @@ -97,7 +97,6 @@ public void run() { // this.methodProfiler.b(); // this.methodProfiler.b(); worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions - worldserver.movementCache.clear(); // IonSpigot - Movement Cache } public ResettableLatch getLatch() { diff --git a/WindSpigot-Server/src/main/java/me/suicidalkids/ion/movement/MovementCache.java b/WindSpigot-Server/src/main/java/me/suicidalkids/ion/movement/MovementCache.java deleted file mode 100644 index 9ce2a0f36..000000000 --- a/WindSpigot-Server/src/main/java/me/suicidalkids/ion/movement/MovementCache.java +++ /dev/null @@ -1,51 +0,0 @@ -package me.suicidalkids.ion.movement; - -import net.minecraft.server.AxisAlignedBB; -import net.minecraft.server.Entity; - -public class MovementCache { - - private AxisAlignedBB bb; - private double locX, locY, locZ, lastX, lastY, lastZ; - private double motX, motY, motZ, lastMotX, lastMotY, lastMotZ; - private boolean onGround; - - public boolean move(Entity entity) { - if (entity.locX == lastX && entity.locY == lastY && entity.locZ == lastZ && entity.motX == lastMotX - && entity.motY == lastMotY && entity.motZ == lastMotZ) { - entity.boundingBox = bb; - entity.onGround = onGround; - entity.locX = locX; - entity.locY = locY; - entity.locZ = locZ; - entity.motX = motX; - entity.motY = motY; - entity.motZ = motZ; - return true; - } - - return false; - } - - public void cache(Entity entity) { - onGround = entity.onGround; - bb = entity.boundingBox; - lastX = entity.lastX; - lastY = entity.lastY; - lastZ = entity.lastZ; - lastMotX = entity.lastMotX; - lastMotY = entity.lastMotY; - lastMotZ = entity.lastMotZ; - locX = entity.locX; - locY = entity.locY; - locZ = entity.locZ; - motX = entity.motX; - motY = entity.motY; - motZ = entity.motZ; - } - - public void clear() { - lastX = Double.MAX_VALUE; - } - -} \ No newline at end of file diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java b/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java index f7e4a22b6..a28178d23 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java @@ -73,11 +73,6 @@ static boolean isLevelAtLeast(NBTTagCompound tag, int level) { public double motX; public double motY; public double motZ; - // IonSpigot start - Movement Cache - public double lastMotX; - public double lastMotY; - public double lastMotZ; - // IonSpigot end public float yaw; public float pitch; public float lastYaw; @@ -538,16 +533,6 @@ public void move(double d0, double d1, double d2) { return; } - // IonSpigot start - Movement Cache - this.lastMotX = this.motX; - this.lastMotY = this.motY; - this.lastMotZ = this.motZ; - - if (world.movementCache.move(this)) { - return; - } - // IonSpigot end - // CraftBukkit start - Don't do anything if we aren't moving // We need to do this regardless of whether or not we are moving thanks to // portals @@ -847,7 +832,6 @@ public void move(double d0, double d1, double d2) { if (d7 != d1) { block.a(this.world, this); } - world.movementCache.cache(this); // IonSpigot - Movement Cache // CraftBukkit start if (positionChanged && getBukkitEntity() instanceof Vehicle) { diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/PlayerConnection.java b/WindSpigot-Server/src/main/java/net/minecraft/server/PlayerConnection.java index d1e67ebc5..80d8f6aad 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/PlayerConnection.java @@ -587,7 +587,6 @@ public void a(PacketPlayInFlying packetplayinflying) { this.player.bF(); } - this.player.world.movementCache.clear(); // IonSpigot - Movement Cache this.player.move(d11, d12, d13); this.player.onGround = packetplayinflying.f(); double d16 = d12; diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/World.java b/WindSpigot-Server/src/main/java/net/minecraft/server/World.java index fbe4dcfe3..63fb18825 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/World.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/World.java @@ -36,7 +36,6 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; import me.elier.nachospigot.config.NachoWorldConfig; import me.rastrian.dev.PlayerMap; -import me.suicidalkids.ion.movement.MovementCache; // WindSpigot end public abstract class World implements IBlockAccess { @@ -172,8 +171,6 @@ public boolean add(BlockState blockState) { public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in // BlockRedstoneTorch to // here - - public final MovementCache movementCache = new MovementCache(); // IonSpigot - Movement Cache public static long chunkToKey(int x, int z) { long k = (((x) & 0xFFFF0000L) << 16) | (((x) & 0x0000FFFFL)); @@ -535,7 +532,6 @@ public boolean setTypeAndData(BlockPosition blockposition, IBlockData iblockdata this.methodProfiler.b(); } - movementCache.clear(); // IonSpigot - Movement Cache /* * if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && chunk.isReady()) * { this.notify(blockposition); }