Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9ad7304e6 | ||
|
|
087825eb26 | ||
|
|
efa1abc1d7 | ||
|
|
ccebb2b390 | ||
|
|
2ed10d07b0 | ||
|
|
160f0452d0 | ||
|
|
57d89067d7 | ||
|
|
1139843c98 | ||
|
|
fe414e027b | ||
|
|
ab7a79c7b7 | ||
|
|
3044e2a70d | ||
|
|
ee365adb62 | ||
|
|
d78112453c | ||
|
|
42d7d8a151 | ||
|
|
f936afbdfd | ||
|
|
e611832cb7 | ||
|
|
62951f0d92 | ||
|
|
73ab029e4c | ||
|
|
47b4ce394c | ||
|
|
6275320901 | ||
|
|
a113654b36 | ||
|
|
671522acdc | ||
|
|
2779390c6b | ||
|
|
4fc704f16a | ||
|
|
423f48684a | ||
|
|
c027a2e37f |
20
README.md
20
README.md
@@ -24,25 +24,27 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
verbose: false
|
verbose: false
|
||||||
gameplay:
|
region-format:
|
||||||
server-mod-name: Kaiiju
|
debug: false
|
||||||
network:
|
network:
|
||||||
send-null-entity-packets: true
|
send-null-entity-packets: true
|
||||||
alternate-keepalive: false
|
alternate-keepalive: false
|
||||||
region-format:
|
gameplay:
|
||||||
debug: false
|
server-mod-name: Kaiiju
|
||||||
|
shared-random-for-players: true
|
||||||
world-settings:
|
world-settings:
|
||||||
default:
|
default:
|
||||||
gameplay:
|
|
||||||
shulker-box-drop-contents-when-destroyed: true
|
|
||||||
fix-void-trading: true
|
|
||||||
optimize-hoppers: true
|
|
||||||
tick-when-empty: true
|
|
||||||
region-format:
|
region-format:
|
||||||
format: ANVIL
|
format: ANVIL
|
||||||
linear:
|
linear:
|
||||||
compression-level: 1
|
compression-level: 1
|
||||||
crash-on-broken-symlink: true
|
crash-on-broken-symlink: true
|
||||||
|
gameplay:
|
||||||
|
shulker-box-drop-contents-when-destroyed: true
|
||||||
|
fix-void-trading: true
|
||||||
|
optimize-hoppers: true
|
||||||
|
tick-when-empty: true
|
||||||
|
break-redstone-on-top-of-trap-doors-early: true
|
||||||
config-version: 1
|
config-version: 1
|
||||||
```
|
```
|
||||||
Documentation: [Kaiiju Wiki](https://github.com/KaiijuMC/Kaiiju/wiki/Configuration)
|
Documentation: [Kaiiju Wiki](https://github.com/KaiijuMC/Kaiiju/wiki/Configuration)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ group = dev.kaiijumc.kaiiju
|
|||||||
version = 1.19.4-R0.1-SNAPSHOT
|
version = 1.19.4-R0.1-SNAPSHOT
|
||||||
mcVersion = 1.19.4
|
mcVersion = 1.19.4
|
||||||
|
|
||||||
foliaRef = 47105ea28e71d337c2683c7b7ae8228e61901cbb
|
foliaRef = ca3b7adee262589e379183f8c36a50d10967a0b2
|
||||||
|
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ index abe37c7c3c6f5ab73afd738ec78f06d7e4d2ed96..52fc6bb99f6024273c7438d01314b576
|
|||||||
stringbuilder.append(CrashReport.DATE_TIME_FORMATTER.format(ZonedDateTime.now()));
|
stringbuilder.append(CrashReport.DATE_TIME_FORMATTER.format(ZonedDateTime.now()));
|
||||||
stringbuilder.append("\n");
|
stringbuilder.append("\n");
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index f5721f6d719b7055fdccc81d5e67ed758e90cb10..0696ad97437726fd6a13badfe7db0617dfbfb1ad 100644
|
index 61bac6fda2d2f4b3db8a3f7e3003f47c84d5c4cd..19d6b811dccdc2b7a22054d3fe72b3981a6aae3a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -999,7 +999,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -999,7 +999,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@@ -145,7 +145,7 @@ index f5721f6d719b7055fdccc81d5e67ed758e90cb10..0696ad97437726fd6a13badfe7db0617
|
|||||||
while (this.getRunningThread().isAlive()) {
|
while (this.getRunningThread().isAlive()) {
|
||||||
this.getRunningThread().stop();
|
this.getRunningThread().stop();
|
||||||
try {
|
try {
|
||||||
@@ -1833,7 +1833,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1815,7 +1815,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ index 6d0e1edfb7d3c020f70f6a194f16e836b462c4de..9fb33b35b4d6842ca8597f77a4116e39
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index a7233bcc99e9bf148348ebb36bbb15b2eadb381f..865b022bb52d8d7b12355a01f3216a4ee8d4c045 100644
|
index a2cb5aae38e8666da8c8f3b5095d426c62371a3b..2ee67890df46c8eb23c387519721c88b762599ce 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1833,7 +1833,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1815,7 +1815,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
|
|||||||
@@ -0,0 +1,139 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Wed, 10 May 2023 16:30:38 +0300
|
||||||
|
Subject: [PATCH] Strip raytracing for EntityLiving#hasLineOfSight
|
||||||
|
|
||||||
|
This has been benchmarked on a huge gold farm.
|
||||||
|
Resulting in significative performance improvements.
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
index 49716190b784339b80c8a3ac8e5b13bc450284ee..440735caab3be903546638a3d01903720225c553 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
@@ -3612,7 +3612,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
|
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
|
||||||
|
|
||||||
|
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
|
||||||
|
- return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS; // Paper - use distanceToSqr
|
||||||
|
+ return !(vec3d1.distanceToSqr(vec3d) > 128D * 128D) && this.level.rayTraceDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.BlockHitResult.Type.MISS; // Paper - use distanceToSqr // Kaiiju - Pufferfish - Strip raytracing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
|
index 2ee9e8e3c1a28c1823de8e1fe421cc1f3e72f384..d99d77536e4d49b53575ae30614c0ab5fdbd3f73 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||||
|
@@ -73,6 +73,17 @@ public interface BlockGetter extends LevelHeightAccessor {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Kaiiju start - Pufferfish - broken down variant of below rayTraceBlock, used by World#rayTraceDirect
|
||||||
|
+ @Nullable
|
||||||
|
+ default net.minecraft.world.phys.BlockHitResult.Type rayTraceBlockDirect(Vec3 vec3d, Vec3 vec3d1, BlockPos blockposition, BlockState iblockdata, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
|
||||||
|
+ if (iblockdata.isAir()) return null;
|
||||||
|
+ VoxelShape voxelshape = ClipContext.Block.COLLIDER.get(iblockdata, this, blockposition, voxelshapecoll);
|
||||||
|
+ net.minecraft.world.phys.BlockHitResult movingobjectpositionblock = this.clipWithInteractionOverride(vec3d, vec3d1, blockposition, voxelshape, iblockdata);
|
||||||
|
+
|
||||||
|
+ return movingobjectpositionblock == null ? null : movingobjectpositionblock.getType();
|
||||||
|
+ }
|
||||||
|
+ // Kaiiju end
|
||||||
|
+
|
||||||
|
// CraftBukkit start - moved block handling into separate method for use by Block#rayTrace
|
||||||
|
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
|
||||||
|
// Paper start - Prevent raytrace from loading chunks
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
index a3b4b49ca8612a61bc2e7a1e2d2e942e7ebe1883..933373aaa7b1fa07862e2146e079abe91d126263 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
@@ -433,6 +433,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Kaiiju start - Pufferfish - broken down method of raytracing for EntityLiving#hasLineOfSight, replaces IBlockAccess#rayTrace(RayTrace)
|
||||||
|
+ public net.minecraft.world.phys.BlockHitResult.Type rayTraceDirect(net.minecraft.world.phys.Vec3 vec3d, net.minecraft.world.phys.Vec3 vec3d1, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
|
||||||
|
+ // most of this code comes from IBlockAccess#a(RayTrace, BiFunction, Function), but removes the needless functions
|
||||||
|
+ if (vec3d.equals(vec3d1)) {
|
||||||
|
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ double endX = Mth.lerp(-1.0E-7D, vec3d1.x, vec3d.x);
|
||||||
|
+ double endY = Mth.lerp(-1.0E-7D, vec3d1.y, vec3d.y);
|
||||||
|
+ double endZ = Mth.lerp(-1.0E-7D, vec3d1.z, vec3d.z);
|
||||||
|
+
|
||||||
|
+ double startX = Mth.lerp(-1.0E-7D, vec3d.x, vec3d1.x);
|
||||||
|
+ double startY = Mth.lerp(-1.0E-7D, vec3d.y, vec3d1.y);
|
||||||
|
+ double startZ = Mth.lerp(-1.0E-7D, vec3d.z, vec3d1.z);
|
||||||
|
+
|
||||||
|
+ int currentX = Mth.floor(startX);
|
||||||
|
+ int currentY = Mth.floor(startY);
|
||||||
|
+ int currentZ = Mth.floor(startZ);
|
||||||
|
+
|
||||||
|
+ BlockPos.MutableBlockPos currentBlock = new BlockPos.MutableBlockPos(currentX, currentY, currentZ);
|
||||||
|
+
|
||||||
|
+ LevelChunk chunk = this.getChunkIfLoaded(currentBlock);
|
||||||
|
+ if (chunk == null) {
|
||||||
|
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ net.minecraft.world.phys.BlockHitResult.Type initialCheck = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
|
||||||
|
+
|
||||||
|
+ if (initialCheck != null) {
|
||||||
|
+ return initialCheck;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ double diffX = endX - startX;
|
||||||
|
+ double diffY = endY - startY;
|
||||||
|
+ double diffZ = endZ - startZ;
|
||||||
|
+
|
||||||
|
+ int xDirection = Mth.sign(diffX);
|
||||||
|
+ int yDirection = Mth.sign(diffY);
|
||||||
|
+ int zDirection = Mth.sign(diffZ);
|
||||||
|
+
|
||||||
|
+ double normalizedX = xDirection == 0 ? Double.MAX_VALUE : (double) xDirection / diffX;
|
||||||
|
+ double normalizedY = yDirection == 0 ? Double.MAX_VALUE : (double) yDirection / diffY;
|
||||||
|
+ double normalizedZ = zDirection == 0 ? Double.MAX_VALUE : (double) zDirection / diffZ;
|
||||||
|
+
|
||||||
|
+ double normalizedXDirection = normalizedX * (xDirection > 0 ? 1.0D - Mth.frac(startX) : Mth.frac(startX));
|
||||||
|
+ double normalizedYDirection = normalizedY * (yDirection > 0 ? 1.0D - Mth.frac(startY) : Mth.frac(startY));
|
||||||
|
+ double normalizedZDirection = normalizedZ * (zDirection > 0 ? 1.0D - Mth.frac(startZ) : Mth.frac(startZ));
|
||||||
|
+
|
||||||
|
+ net.minecraft.world.phys.BlockHitResult.Type result;
|
||||||
|
+
|
||||||
|
+ do {
|
||||||
|
+ if (normalizedXDirection > 1.0D && normalizedYDirection > 1.0D && normalizedZDirection > 1.0D) {
|
||||||
|
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (normalizedXDirection < normalizedYDirection) {
|
||||||
|
+ if (normalizedXDirection < normalizedZDirection) {
|
||||||
|
+ currentX += xDirection;
|
||||||
|
+ normalizedXDirection += normalizedX;
|
||||||
|
+ } else {
|
||||||
|
+ currentZ += zDirection;
|
||||||
|
+ normalizedZDirection += normalizedZ;
|
||||||
|
+ }
|
||||||
|
+ } else if (normalizedYDirection < normalizedZDirection) {
|
||||||
|
+ currentY += yDirection;
|
||||||
|
+ normalizedYDirection += normalizedY;
|
||||||
|
+ } else {
|
||||||
|
+ currentZ += zDirection;
|
||||||
|
+ normalizedZDirection += normalizedZ;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ currentBlock.set(currentX, currentY, currentZ);
|
||||||
|
+ if (chunk.getPos().x != currentBlock.getX() >> 4 || chunk.getPos().z != currentBlock.getZ() >> 4) {
|
||||||
|
+ chunk = this.getChunkIfLoaded(currentBlock);
|
||||||
|
+ if (chunk == null) {
|
||||||
|
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ result = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
|
||||||
|
+ } while (result == null);
|
||||||
|
+
|
||||||
|
+ return result;
|
||||||
|
+ }
|
||||||
|
+ // Kaiiju end
|
||||||
|
+
|
||||||
|
public boolean isInWorldBounds(BlockPos pos) {
|
||||||
|
return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check
|
||||||
|
}
|
||||||
20
patches/server/0017-Fix-off-thread-spider-addEffect.patch
Normal file
20
patches/server/0017-Fix-off-thread-spider-addEffect.patch
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Wed, 10 May 2023 17:58:37 +0300
|
||||||
|
Subject: [PATCH] Fix off thread spider addEffect
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||||
|
index 0c36bb47bd7040f1544817810e1c87157cdaff96..089c7bc00b8b4354d795cd864dc2c310bcf6de86 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||||
|
@@ -180,7 +180,9 @@ public class Spider extends Monster {
|
||||||
|
MobEffect mobeffectlist = entityspider_groupdataspider.effect;
|
||||||
|
|
||||||
|
if (mobeffectlist != null) {
|
||||||
|
+ this.getBukkitEntity().taskScheduler.schedule(task -> { // Kaiiju - Fix off thread spider add effect
|
||||||
|
this.addEffect(new MobEffectInstance(mobeffectlist, -1), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.SPIDER_SPAWN); // CraftBukkit
|
||||||
|
+ }, null, 1); // Kaiiju - Fix off thread spider add effect
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
143
patches/server/0018-Add-SIMD-utilities.patch
Normal file
143
patches/server/0018-Add-SIMD-utilities.patch
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Thu, 11 May 2023 05:02:40 +0300
|
||||||
|
Subject: [PATCH] Add SIMD utilities
|
||||||
|
|
||||||
|
Patch from Pufferfish
|
||||||
|
|
||||||
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
|
index 4686019a152114e63e997ee103fc8424b24b4581..0851203a4bed670242afc5ac86562075f32693ab 100644
|
||||||
|
--- a/build.gradle.kts
|
||||||
|
+++ b/build.gradle.kts
|
||||||
|
@@ -58,6 +58,14 @@ dependencies {
|
||||||
|
}
|
||||||
|
|
||||||
|
val craftbukkitPackageVersion = "1_19_R3" // Paper
|
||||||
|
+
|
||||||
|
+// Kaiiju start - Pufferfish - SIMD utilities
|
||||||
|
+tasks.withType<JavaCompile> {
|
||||||
|
+ val compilerArgs = options.compilerArgs
|
||||||
|
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||||
|
+}
|
||||||
|
+// Kaiiju end
|
||||||
|
+
|
||||||
|
tasks.jar {
|
||||||
|
archiveClassifier.set("dev")
|
||||||
|
|
||||||
|
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..586b4cd007b3b106966524e2697edddf88e3ac9d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||||
|
@@ -0,0 +1,59 @@
|
||||||
|
+package gg.pufferfish.pufferfish.simd;
|
||||||
|
+
|
||||||
|
+import org.bukkit.Bukkit;
|
||||||
|
+import java.util.logging.Level;
|
||||||
|
+import java.util.logging.Logger;
|
||||||
|
+import jdk.incubator.vector.FloatVector;
|
||||||
|
+import jdk.incubator.vector.IntVector;
|
||||||
|
+import jdk.incubator.vector.VectorSpecies;
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * Basically, java is annoying and we have to push this out to its own class.
|
||||||
|
+ */
|
||||||
|
+public class SIMDChecker {
|
||||||
|
+
|
||||||
|
+ public static boolean canEnable(Logger logger) {
|
||||||
|
+ try {
|
||||||
|
+ if (SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19) {
|
||||||
|
+ return false;
|
||||||
|
+ } else {
|
||||||
|
+ SIMDDetection.testRun = true;
|
||||||
|
+
|
||||||
|
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
|
||||||
|
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
|
||||||
|
+
|
||||||
|
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + ISPEC.vectorBitSize() + " bits (int)");
|
||||||
|
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
|
||||||
|
+
|
||||||
|
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
|
||||||
|
+ logger.log(Level.WARNING, "SIMD is not properly supported on this system!");
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ } catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static void simdWarning() {
|
||||||
|
+ // Attempt to detect vectorization
|
||||||
|
+ try {
|
||||||
|
+ SIMDDetection.isEnabled = SIMDDetection.canEnable(Bukkit.getLogger());
|
||||||
|
+ SIMDDetection.versionLimited = SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19;
|
||||||
|
+ } catch (NoClassDefFoundError | Exception ignored) {
|
||||||
|
+ ignored.printStackTrace();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (SIMDDetection.isEnabled) {
|
||||||
|
+ Bukkit.getLogger().info("SIMD operations detected as functional. Will replace some operations with faster versions.");
|
||||||
|
+ } else if (SIMDDetection.versionLimited) {
|
||||||
|
+ Bukkit.getLogger().warning("Will not enable SIMD! These optimizations are only safely supported on Java 17, Java 18, and Java 19.");
|
||||||
|
+ } else {
|
||||||
|
+ Bukkit.getLogger().warning("SIMD operations are available for your server, but are not configured!");
|
||||||
|
+ Bukkit.getLogger().warning("To enable additional optimizations, add \"--add-modules=jdk.incubator.vector\" to your startup flags, BEFORE the \"-jar\".");
|
||||||
|
+ Bukkit.getLogger().warning("If you have already added this flag, then SIMD operations are not supported on your JVM or CPU.");
|
||||||
|
+ Bukkit.getLogger().warning("Debug: Java: " + System.getProperty("java.version") + ", test run: " + SIMDDetection.testRun);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..758fa97304a32bf17935c86dc03cbf50606935d8
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+package gg.pufferfish.pufferfish.simd;
|
||||||
|
+
|
||||||
|
+import java.util.logging.Logger;
|
||||||
|
+
|
||||||
|
+public class SIMDDetection {
|
||||||
|
+
|
||||||
|
+ public static boolean isEnabled = false;
|
||||||
|
+ public static boolean versionLimited = false;
|
||||||
|
+ public static boolean testRun = false;
|
||||||
|
+
|
||||||
|
+ public static boolean canEnable(Logger logger) {
|
||||||
|
+ try {
|
||||||
|
+ return SIMDChecker.canEnable(logger);
|
||||||
|
+ } catch (NoClassDefFoundError | Exception ignored) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static int getJavaVersion() {
|
||||||
|
+ // https://stackoverflow.com/a/2591122
|
||||||
|
+ String version = System.getProperty("java.version");
|
||||||
|
+ if(version.startsWith("1.")) {
|
||||||
|
+ version = version.substring(2, 3);
|
||||||
|
+ } else {
|
||||||
|
+ int dot = version.indexOf(".");
|
||||||
|
+ if(dot != -1) { version = version.substring(0, dot); }
|
||||||
|
+ }
|
||||||
|
+ version = version.split("-")[0]; // Azul is stupid
|
||||||
|
+ return Integer.parseInt(version);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index 426777730f77664c69bd0a084a9323d767ebc0ad..5272164b18c2ca999c4744aede32f4a4c72525ed 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -225,6 +225,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
+ gg.pufferfish.pufferfish.simd.SIMDChecker.simdWarning();
|
||||||
|
dev.kaiijumc.kaiiju.KaiijuConfig.registerCommands();
|
||||||
|
// Kaiiju end
|
||||||
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||||
37
patches/server/0019-Toggle-shared-random-for-players.patch
Normal file
37
patches/server/0019-Toggle-shared-random-for-players.patch
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Thu, 11 May 2023 17:12:34 +0300
|
||||||
|
Subject: [PATCH] Toggle shared random for players
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
|
||||||
|
index f1fe094c4b4c5932ba656165bb1671020c1277a5..d3f6e5c873255d00160cf792898204a82a0ec5e8 100644
|
||||||
|
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
|
||||||
|
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
|
||||||
|
@@ -208,8 +208,10 @@ public class KaiijuConfig {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String serverModName = "Kaiiju";
|
||||||
|
+ public static boolean sharedRandomForPlayers = true;
|
||||||
|
|
||||||
|
private static void gameplaySettings() {
|
||||||
|
serverModName = getString("gameplay.server-mod-name", serverModName);
|
||||||
|
+ sharedRandomForPlayers = getBoolean("gameplay.shared-random-for-players", sharedRandomForPlayers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
index 08e61a8940c142c68ed93359084ea46c7fd52310..f22b4ad629845462656834abb3e28d2c2588ace6 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
@@ -560,6 +560,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||||
|
this.bb = Entity.INITIAL_AABB;
|
||||||
|
this.stuckSpeedMultiplier = Vec3.ZERO;
|
||||||
|
this.nextStep = 1.0F;
|
||||||
|
+ // Kaiiju start - Toggle shared random for players
|
||||||
|
+ if (!dev.kaiijumc.kaiiju.KaiijuConfig.sharedRandomForPlayers && this instanceof Player)
|
||||||
|
+ this.random = RandomSource.create();
|
||||||
|
+ else
|
||||||
|
+ // Kaiiju end
|
||||||
|
this.random = SHARED_RANDOM; // Paper
|
||||||
|
this.remainingFireTicks = -this.getFireImmuneTicks();
|
||||||
|
this.fluidHeight = new Object2DoubleArrayMap(2);
|
||||||
42
patches/server/0020-Kick-player-instead-of-crashing.patch
Normal file
42
patches/server/0020-Kick-player-instead-of-crashing.patch
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Sun, 14 May 2023 18:50:57 +0300
|
||||||
|
Subject: [PATCH] Kick player instead of crashing
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
|
||||||
|
index d52a522fe6d5c4375862691fa32450bc458ca38b..648aff395887d2f13846b1bbe59f4115206ad7cf 100644
|
||||||
|
--- a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
|
||||||
|
+++ b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
|
||||||
|
@@ -486,7 +486,12 @@ public class RegionizedPlayerChunkLoader {
|
||||||
|
new ChunkPos(chunkX, chunkZ), new MutableObject<>(), false, true); // unloaded, loaded
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
- throw new IllegalStateException();
|
||||||
|
+ // Kaiiju - Kick player instead of crashing
|
||||||
|
+ String errorMsg = "Already sent chunk [" + chunkX + ", " + chunkZ + "] in world " + this.world;
|
||||||
|
+ this.player.getBukkitEntity().kickPlayer(errorMsg);
|
||||||
|
+ org.bukkit.Bukkit.getLogger().severe(errorMsg);
|
||||||
|
+ // throw new IllegalStateException();
|
||||||
|
+ // Kaiiju end
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendUnloadChunk(final int chunkX, final int chunkZ) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
|
index 5ccfc95f51a899b1cd3f34af5e5bb05d902016b8..9c20bd199454b6032a6a90676d12526168b8dd0b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
|
@@ -133,7 +133,12 @@ public class ChunkHolder {
|
||||||
|
|
||||||
|
public void addPlayer(ServerPlayer player) {
|
||||||
|
if (!this.playersSentChunkTo.add(player)) {
|
||||||
|
- throw new IllegalStateException("Already sent chunk " + this.pos + " in world '" + this.chunkMap.level.getWorld().getName() + "' to player " + player);
|
||||||
|
+ // Kaiiju start - Kick player instead of crashing
|
||||||
|
+ String errorMsg = "Already sent chunk " + this.pos + " in world " + this.chunkMap.level.getWorld().getName();
|
||||||
|
+ player.getBukkitEntity().kickPlayer(errorMsg);
|
||||||
|
+ org.bukkit.Bukkit.getLogger().severe(errorMsg);
|
||||||
|
+ //throw new IllegalStateException("Already sent chunk " + this.pos + " in world '" + this.chunkMap.level.getWorld().getName() + "' to player " + player);
|
||||||
|
+ // Kaiiju end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Thu, 18 May 2023 15:50:40 +0300
|
||||||
|
Subject: [PATCH] Toggle fix TripWire state inconsistency
|
||||||
|
|
||||||
|
This allow string duplication
|
||||||
|
|
||||||
|
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
index 43c8e95454cfe831f69858eb3b520f9958280b54..8026f9ac95cd54e74ff7e161fe4768830f8e0d30 100644
|
||||||
|
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
@@ -151,6 +151,7 @@ public class KaiijuWorldConfig {
|
||||||
|
public boolean optimizeHoppers = true;
|
||||||
|
public boolean tickWhenEmpty = true;
|
||||||
|
public boolean breakRedstoneOnTopOfTrapDoorsEarly = true;
|
||||||
|
+ public boolean fixTripWireStateInconsistency = true;
|
||||||
|
|
||||||
|
private void gameplaySettings() {
|
||||||
|
shulkerBoxDropContentsWhenDestroyed = getBoolean("gameplay.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed);
|
||||||
|
@@ -158,5 +159,6 @@ public class KaiijuWorldConfig {
|
||||||
|
optimizeHoppers = getBoolean("gameplay.optimize-hoppers", optimizeHoppers);
|
||||||
|
tickWhenEmpty = getBoolean("gameplay.tick-when-empty", tickWhenEmpty);
|
||||||
|
breakRedstoneOnTopOfTrapDoorsEarly = getBoolean("gameplay.break-redstone-on-top-of-trap-doors-early", breakRedstoneOnTopOfTrapDoorsEarly);
|
||||||
|
+ fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||||
|
index 7f60175bf671d282c11e9084670d2bb900968255..baa6d2bb3a4bec920cb8b57cb08d706929985ea9 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||||
|
@@ -74,7 +74,7 @@ public class TripWireBlock extends Block {
|
||||||
|
@Override
|
||||||
|
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
||||||
|
if (!moved && !state.is(newState.getBlock())) {
|
||||||
|
- this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true), true); // Paper - fix state inconsistency
|
||||||
|
+ this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true), world.kaiijuConfig.fixTripWireStateInconsistency); // Paper - fix state inconsistency // Kaiiju - Toggle this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
56
patches/server/0022-Toggle-safe-teleportation.patch
Normal file
56
patches/server/0022-Toggle-safe-teleportation.patch
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Thu, 18 May 2023 20:05:49 +0300
|
||||||
|
Subject: [PATCH] Toggle safe teleportation
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
index 8026f9ac95cd54e74ff7e161fe4768830f8e0d30..bf23ddc5fdc274c9fc755f64d30d6792c9f4b0da 100644
|
||||||
|
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
@@ -152,6 +152,7 @@ public class KaiijuWorldConfig {
|
||||||
|
public boolean tickWhenEmpty = true;
|
||||||
|
public boolean breakRedstoneOnTopOfTrapDoorsEarly = true;
|
||||||
|
public boolean fixTripWireStateInconsistency = true;
|
||||||
|
+ public boolean safeTeleporting = true;
|
||||||
|
|
||||||
|
private void gameplaySettings() {
|
||||||
|
shulkerBoxDropContentsWhenDestroyed = getBoolean("gameplay.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed);
|
||||||
|
@@ -160,5 +161,6 @@ public class KaiijuWorldConfig {
|
||||||
|
tickWhenEmpty = getBoolean("gameplay.tick-when-empty", tickWhenEmpty);
|
||||||
|
breakRedstoneOnTopOfTrapDoorsEarly = getBoolean("gameplay.break-redstone-on-top-of-trap-doors-early", breakRedstoneOnTopOfTrapDoorsEarly);
|
||||||
|
fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
|
||||||
|
+ safeTeleporting = getBoolean("gameplay.safe-teleportation", safeTeleporting);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
index f22b4ad629845462656834abb3e28d2c2588ace6..7af60ebb91fb39374355c64396b6adc48b2a5f89 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
@@ -3826,6 +3826,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||||
|
|
||||||
|
protected boolean tryEndPortal() {
|
||||||
|
io.papermc.paper.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
|
||||||
|
+ if (!this.level.kaiijuConfig.safeTeleporting && !(this instanceof net.minecraft.world.entity.player.Player)) return false; // Kaiiju - Unsafe teleportation
|
||||||
|
BlockPos pos = this.portalBlock;
|
||||||
|
ServerLevel world = this.portalWorld;
|
||||||
|
this.portalBlock = null;
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||||
|
index 41d7cff39fc37955877668337689b4b26cd8c7cf..aee4ae51a73ac3c74bf4b3db23247b0eb45c2d7a 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||||
|
@@ -53,6 +53,13 @@ public class EndPortalBlock extends BaseEntityBlock {
|
||||||
|
// return; // CraftBukkit - always fire event in case plugins wish to change it
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Kaiiju start - Unsafe teleportation
|
||||||
|
+ if (!entity.level.kaiijuConfig.safeTeleporting && !(entity instanceof net.minecraft.world.entity.player.Player)) {
|
||||||
|
+ entity.endPortalLogicAsync();
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Kaiiju end
|
||||||
|
+
|
||||||
|
// Paper start - move all of this logic into portal tick
|
||||||
|
entity.portalWorld = ((ServerLevel)world);
|
||||||
|
entity.portalBlock = pos.immutable();
|
||||||
48
patches/server/0023-Toggle-sand-duplication.patch
Normal file
48
patches/server/0023-Toggle-sand-duplication.patch
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Sun, 28 May 2023 01:51:52 +0300
|
||||||
|
Subject: [PATCH] Toggle sand duplication
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
index bf23ddc5fdc274c9fc755f64d30d6792c9f4b0da..96f676cacbbb25e818d0f197c175a5f1179d3df9 100644
|
||||||
|
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
|
||||||
|
@@ -153,6 +153,7 @@ public class KaiijuWorldConfig {
|
||||||
|
public boolean breakRedstoneOnTopOfTrapDoorsEarly = true;
|
||||||
|
public boolean fixTripWireStateInconsistency = true;
|
||||||
|
public boolean safeTeleporting = true;
|
||||||
|
+ public boolean sandDuplication = false;
|
||||||
|
|
||||||
|
private void gameplaySettings() {
|
||||||
|
shulkerBoxDropContentsWhenDestroyed = getBoolean("gameplay.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed);
|
||||||
|
@@ -162,5 +163,6 @@ public class KaiijuWorldConfig {
|
||||||
|
breakRedstoneOnTopOfTrapDoorsEarly = getBoolean("gameplay.break-redstone-on-top-of-trap-doors-early", breakRedstoneOnTopOfTrapDoorsEarly);
|
||||||
|
fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
|
||||||
|
safeTeleporting = getBoolean("gameplay.safe-teleportation", safeTeleporting);
|
||||||
|
+ sandDuplication = getBoolean("gameplay.sand-duplication", sandDuplication);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
|
index c8d125955754e27da54d95fb5b1cea39ca54b618..ffe82c153602babb679dee29d20e807a771a00ce 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
|
@@ -131,7 +131,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
// Paper start - fix sand duping
|
||||||
|
- if (this.isRemoved()) {
|
||||||
|
+ if (!this.level.kaiijuConfig.sandDuplication && this.isRemoved()) { // Kaiiju - Toggle sand duplication
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Paper end - fix sand duping
|
||||||
|
@@ -148,7 +148,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||||
|
|
||||||
|
// Paper start - fix sand duping
|
||||||
|
- if (this.isRemoved()) {
|
||||||
|
+ if (!this.level.kaiijuConfig.sandDuplication && this.isRemoved()) { // Kaiiju - Toggle sand duplication
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Paper end - fix sand duping
|
||||||
27
patches/server/0024-Vanilla-end-portal-teleportation.patch
Normal file
27
patches/server/0024-Vanilla-end-portal-teleportation.patch
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
||||||
|
Date: Fri, 19 May 2023 03:38:03 +0300
|
||||||
|
Subject: [PATCH] Vanilla end portal teleportation
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
index 7af60ebb91fb39374355c64396b6adc48b2a5f89..4e442c605c281900dda18088cade2a719bf6e4ee 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
@@ -3914,10 +3914,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||||
|
(chunks) -> {
|
||||||
|
ServerLevel.makeObsidianPlatform(destination, null, targetPos);
|
||||||
|
|
||||||
|
+ // Kaiiju start - Vanilla end teleportation
|
||||||
|
+ Vec3 finalPos;
|
||||||
|
+ if (this instanceof Player) finalPos = Vec3.atBottomCenterOf(targetPos.below());
|
||||||
|
+ else finalPos = Vec3.atBottomCenterOf(targetPos);
|
||||||
|
+ // Kaiiju end
|
||||||
|
// the portal obsidian is placed at targetPos.y - 2, so if we want to place the entity
|
||||||
|
// on the obsidian, we need to spawn at targetPos.y - 1
|
||||||
|
portalInfoCompletable.complete(
|
||||||
|
- new PortalInfo(Vec3.atBottomCenterOf(targetPos.below()), Vec3.ZERO, 90.0f, 0.0f, destination, null)
|
||||||
|
+ new PortalInfo(finalPos, this.getDeltaMovement(), 90.0f, 0.0f, destination, null) // Kaiiju - Vanilla end teleportation
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user