mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
23/50 patches (lithium)
This commit is contained in:
@@ -7,10 +7,10 @@ Original code by RelativityMC, licensed under MIT
|
||||
You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d220ed3592be8f8103bb02bbd761abf9bd8ad958..e71b24837f71839020a508971b3da161ace8fe7e 100644
|
||||
index 2892d3ad489f0fe2a1b11ef0eb7f8b5290f841a4..50a818fc10a717ddeaf35cb2c4455510bfd9cbad 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -319,6 +319,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -323,6 +323,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public float yRotO;
|
||||
public float xRotO;
|
||||
private AABB bb;
|
||||
@@ -18,8 +18,8 @@ index d220ed3592be8f8103bb02bbd761abf9bd8ad958..e71b24837f71839020a508971b3da161
|
||||
public boolean onGround;
|
||||
public boolean horizontalCollision;
|
||||
public boolean verticalCollision;
|
||||
@@ -1152,6 +1153,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// Paper end - detailed watchdog information
|
||||
@@ -1090,6 +1091,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public void move(MoverType movementType, Vec3 movement) {
|
||||
+ // DivineMC start - vmp: skip entity move if movement is zero
|
||||
@@ -29,9 +29,9 @@ index d220ed3592be8f8103bb02bbd761abf9bd8ad958..e71b24837f71839020a508971b3da161
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
||||
// Paper start - detailed watchdog information
|
||||
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
||||
@@ -4222,6 +4229,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
@@ -4045,6 +4052,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public final void setBoundingBox(AABB boundingBox) {
|
||||
@@ -7,24 +7,23 @@ Original code by RelativityMC, licensed under MIT
|
||||
You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 345f143b0eeb77acb96e4bc716f3b23782ac782f..97545fd84b9b1716e9847cac9e233742ea7f9252 100644
|
||||
index 686f3d8c91e1ffc0c7ffe1cd9bcf5df5503cb938..da56e8d58f8b0391689f697807a4873fc759a26b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -110,6 +110,8 @@ import org.slf4j.Logger;
|
||||
import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
+import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; // DivineMC - vmp: use linked map for entity trackers for faster iteration
|
||||
+
|
||||
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
|
||||
|
||||
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
|
||||
@@ -254,7 +256,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper - rewrite chunk system
|
||||
import it.unimi.dsi.fastutil.longs.Long2ByteMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2LongMap;
|
||||
@@ -229,7 +230,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.toDrop = new LongOpenHashSet();
|
||||
this.tickingGenerated = new AtomicInteger();
|
||||
this.playerMap = new PlayerMap();
|
||||
- this.entityMap = new Int2ObjectOpenHashMap();
|
||||
+ this.entityMap = new Int2ObjectLinkedOpenHashMap<>(); // DivineMC - vmp: use linked map for entity trackers for faster iteration
|
||||
this.chunkTypeCache = new Long2ByteOpenHashMap();
|
||||
this.chunkSaveCooldowns = new Long2LongOpenHashMap();
|
||||
this.unloadQueue = Queues.newConcurrentLinkedQueue();
|
||||
// Paper - rewrite chunk system
|
||||
@@ -10,10 +10,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index fdff9788eaf663be79214b2ca491f0f0444f6136..e09f137f4f412eee55a18c0d14593f7b5b7c6319 100644
|
||||
index dcbef04bbaab988096bf416163264833e84d1967..f3e3013c0b02224de86ea4f3dd945fd8a26090e1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -110,6 +110,7 @@ public class Raid {
|
||||
@@ -107,6 +107,7 @@ public class Raid {
|
||||
private Raid.RaidStatus status;
|
||||
private int celebrationTicks;
|
||||
private Optional<BlockPos> waveSpawnPos;
|
||||
@@ -21,7 +21,7 @@ index fdff9788eaf663be79214b2ca491f0f0444f6136..e09f137f4f412eee55a18c0d14593f7b
|
||||
// Paper start
|
||||
private static final String PDC_NBT_KEY = "BukkitValues";
|
||||
private static final org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry PDC_TYPE_REGISTRY = new org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry();
|
||||
@@ -295,6 +296,12 @@ public class Raid {
|
||||
@@ -292,6 +293,12 @@ public class Raid {
|
||||
|
||||
public void tick() {
|
||||
if (!this.isStopped()) {
|
||||
@@ -34,7 +34,7 @@ index fdff9788eaf663be79214b2ca491f0f0444f6136..e09f137f4f412eee55a18c0d14593f7b
|
||||
if (this.status == Raid.RaidStatus.ONGOING) {
|
||||
boolean flag = this.active;
|
||||
|
||||
@@ -663,9 +670,15 @@ public class Raid {
|
||||
@@ -660,9 +667,15 @@ public class Raid {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ Original code by CaffeineMC, licensed under LGPL v3
|
||||
You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 5d1a21232cfcd21e080d8a23003406af2e0b09b1..def38ac6896ccdd7bab344cec13c76d74817e001 100644
|
||||
index 8c2dd45a146395168e92f2304082a7f6e53edec6..6aaee520213e576f131db430bd4d6df1b34ba197 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2640,6 +2640,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2641,6 +2641,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected void updateSwingTime() {
|
||||
@@ -18,7 +18,7 @@ index 5d1a21232cfcd21e080d8a23003406af2e0b09b1..def38ac6896ccdd7bab344cec13c76d7
|
||||
int i = this.getCurrentSwingDuration();
|
||||
|
||||
if (this.swinging) {
|
||||
@@ -3613,6 +3614,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3641,6 +3642,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
private void updateFallFlying() {
|
||||
@@ -7,7 +7,7 @@ Original code by CaffeineMC, licensed under LGPL v3
|
||||
You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java
|
||||
index ab289a6ca85459e03acb2089c6b9e931caa9c873..377e327432ae2ba7edde7fac807d542f16568e3d 100644
|
||||
index 03c45ee77276462818a6f774b5945b25924aa3f0..7c56228639027d0bfcf8901a5f3c996c6b1faa8c 100644
|
||||
--- a/src/main/java/net/minecraft/core/Direction.java
|
||||
+++ b/src/main/java/net/minecraft/core/Direction.java
|
||||
@@ -46,7 +46,7 @@ public enum Direction implements StringRepresentable {
|
||||
@@ -20,7 +20,7 @@ index ab289a6ca85459e03acb2089c6b9e931caa9c873..377e327432ae2ba7edde7fac807d542f
|
||||
.sorted(Comparator.comparingInt(direction -> direction.data3d))
|
||||
.toArray(Direction[]::new);
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java b/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
index a544db042c8d2ecec8d323770552c4f10ca758a6..fc6a8b1cf33427320a60e3f2d9894ed2f0177bf7 100644
|
||||
index ad02cdb00360165f6405eb3044bd8320f01a7ef1..61f6f612470076c7b6930dcb63911a2ac6d45be1 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
@@ -4,6 +4,7 @@ import it.unimi.dsi.fastutil.doubles.AbstractDoubleList;
|
||||
@@ -29,7 +29,7 @@ index a544db042c8d2ecec8d323770552c4f10ca758a6..fc6a8b1cf33427320a60e3f2d9894ed2
|
||||
private final int parts;
|
||||
+ private double scale; // DivineMC - lithium: precompute shape arrays
|
||||
|
||||
CubePointRange(int sectionCount) {
|
||||
public CubePointRange(int sectionCount) {
|
||||
if (sectionCount <= 0) {
|
||||
@@ -11,10 +12,11 @@ public class CubePointRange extends AbstractDoubleList {
|
||||
} else {
|
||||
@@ -45,10 +45,10 @@ index a544db042c8d2ecec8d323770552c4f10ca758a6..fc6a8b1cf33427320a60e3f2d9894ed2
|
||||
|
||||
public int size() {
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java b/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java
|
||||
index b9af1d14c7815c99273bce8165cf384d669c1a75..16bf73856465c10e1ab84c17e7b317ef9081704d 100644
|
||||
index d812949c7329ae2696b38dc792fa011ba87decb9..98e218c65d489822f334c06fddd1ab608662597b 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java
|
||||
@@ -5,6 +5,8 @@ import net.minecraft.core.Direction;
|
||||
@@ -5,13 +5,23 @@ import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
public final class CubeVoxelShape extends VoxelShape {
|
||||
@@ -56,11 +56,10 @@ index b9af1d14c7815c99273bce8165cf384d669c1a75..16bf73856465c10e1ab84c17e7b317ef
|
||||
+
|
||||
protected CubeVoxelShape(DiscreteVoxelShape voxels) {
|
||||
super(voxels);
|
||||
this.initCache(); // Paper - optimise collisions
|
||||
@@ -12,7 +14,15 @@ public final class CubeVoxelShape extends VoxelShape {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DoubleList getCoords(Direction.Axis axis) {
|
||||
public DoubleList getCoords(Direction.Axis axis) {
|
||||
- return new CubePointRange(this.shape.getSize(axis));
|
||||
+ // DivineMC start - lithium: precompute shape arrays
|
||||
+ if (this.list == null) {
|
||||
@@ -7,7 +7,7 @@ Original code by RelativityMC, licensed under MIT
|
||||
You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
index 09199c574169057ae6e52ee7df277c03fa6ba5c2..1124432a2ad0be2866c0d08e59cd697190c62347 100644
|
||||
index 2039b16e5e9bc0797b3f31081d221bb8b34a4dc7..4239fa40788fb92211cc52ed5e06236621195018 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
@@ -3,8 +3,6 @@ package net.minecraft.world.level;
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] lithium: cached_hashcode
|
||||
|
||||
|
||||
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 22d38bd7a8434685f2af084f1c608f48e9e6c0c2..888f763bb0ac451d4166055c2308fd6b5f4f0f88 100644
|
||||
index 6d012ca724f1373bcf9e8d86d22194143f56d52b..daad0d67428bb49d7f0b37bec430ceb0d30564cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -629,11 +629,19 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -633,11 +633,19 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
private final BlockState first;
|
||||
private final BlockState second;
|
||||
private final Direction direction;
|
||||
@@ -28,7 +28,7 @@ index 22d38bd7a8434685f2af084f1c608f48e9e6c0c2..888f763bb0ac451d4166055c2308fd6b
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
@@ -649,11 +657,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -653,11 +661,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] lithium: math.sine_lut
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
|
||||
index 990ea96de8e940390b67e9462fcfd6025f2f5770..41141bd08f3340ca20680641e315637ffa7cd331 100644
|
||||
index f298cdfcf1539e467f57f9f7789de3cf2ca54665..f83a544be66206ddd52f11524e84e821eb15343c 100644
|
||||
--- a/src/main/java/net/minecraft/util/Mth.java
|
||||
+++ b/src/main/java/net/minecraft/util/Mth.java
|
||||
@@ -29,7 +29,7 @@ public class Mth {
|
||||
Reference in New Issue
Block a user