Compare commits

...

1 Commits

6 changed files with 50 additions and 32 deletions

View File

@@ -1,18 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:02:06 +0800
Subject: [PATCH] Set old pos before moving entity by piston
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
index 3df23feff6937b6a2dbeff82e489a9a4ff644843..5d98069b61df57792e6b0cab809f2996b7d45c88 100644
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
@@ -195,6 +195,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
private static void moveEntityByPiston(Direction noClipDirection, Entity entity, double progress, Direction direction) {
NOCLIP.set(noClipDirection);
+ if (me.earthme.luminol.config.modules.fixes.FoliaPistonIssueFixConfig.enabled) entity.setOldPosAndRot(); // Luminol- Try fixing folia issue #311
entity.move(MoverType.PISTON, new Vec3(progress * direction.getStepX(), progress * direction.getStepY(), progress * direction.getStepZ()));
entity.applyEffectsFromBlocks();
NOCLIP.set(null);

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:02:06 +0800
Subject: [PATCH] Skip collision check if the block is not belong to current
tick region
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index c87db2d497ca9ed2e8aad5f1bc52555ff0952b80..759db5813cc83daa6f0e397483fdb8bd90950a72 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1675,6 +1675,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return;
}
+ if(!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level, blockPos) && me.earthme.luminol.config.modules.fixes.FoliaOldPositionIssueFixConfig.enabled) {
+ continue;
+ }
+
BlockState blockState = this.level().getBlockState(blockPos);
if (!blockState.isAir() && set.add(blockPos.asLong())) {
try {
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
index 3df23feff6937b6a2dbeff82e489a9a4ff644843..ab33af9ea9e7729abb7cc0073c468c2f8ecbcbb9 100644
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
@@ -2,6 +2,8 @@ package net.minecraft.world.level.block.piston;
import java.util.Iterator;
import java.util.List;
+
+import me.earthme.luminol.config.modules.fixes.FoliaOldPositionIssueFixConfig;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.HolderGetter;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Kaiiju Vanilla end portal teleportation
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index c87db2d497ca9ed2e8aad5f1bc52555ff0952b80..88ca22ed6af613370ca8691ad9ebeb113e1637fe 100644
index 759db5813cc83daa6f0e397483fdb8bd90950a72..975c6bdbfbf3ff5f721b98e561b3bb0f0ca943b9 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -110,6 +110,7 @@ import net.minecraft.world.level.block.Rotation;
@@ -16,7 +16,7 @@ index c87db2d497ca9ed2e8aad5f1bc52555ff0952b80..88ca22ed6af613370ca8691ad9ebeb11
import net.minecraft.world.level.entity.EntityAccess;
import net.minecraft.world.level.entity.EntityInLevelCallback;
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
@@ -4265,13 +4266,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4269,13 +4270,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
targetPos, 16, // load 16 blocks to be safe from block physics
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
(chunks) -> {
@@ -37,7 +37,7 @@ index c87db2d497ca9ed2e8aad5f1bc52555ff0952b80..88ca22ed6af613370ca8691ad9ebeb11
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
)
@@ -4467,6 +4473,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4471,6 +4477,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!this.canPortalAsync(destination, takePassengers)) {
return false;
}
@@ -48,7 +48,7 @@ index c87db2d497ca9ed2e8aad5f1bc52555ff0952b80..88ca22ed6af613370ca8691ad9ebeb11
Vec3 initialPosition = this.position();
ChunkPos initialPositionChunk = new ChunkPos(
@@ -4531,9 +4541,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4535,9 +4545,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
info.postTeleportTransition().onTransition(teleported);
}

View File

@@ -159,10 +159,10 @@ index 23b342cc31c7e72ade0e1ccad86a9ccf34380f13..249cb7326c8e4012dcffdb6bbb7bfc1f
+ // KioCG end
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 88ca22ed6af613370ca8691ad9ebeb113e1637fe..41313532c739027351d6fd848aa1c515aa4acd4a 100644
index 975c6bdbfbf3ff5f721b98e561b3bb0f0ca943b9..71b751ec16ecbbcc18bcc228d0ebe7bfea0eb15d 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -5940,4 +5940,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -5944,4 +5944,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return ((ServerLevel) this.level).isPositionEntityTicking(this.blockPosition());
}
// Paper end - Expose entity id counter

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Gale Skip entity move if movement is zero
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 41313532c739027351d6fd848aa1c515aa4acd4a..d58f2bfde617ab55a550cbf8eb0187c9663d38fc 100644
index 71b751ec16ecbbcc18bcc228d0ebe7bfea0eb15d..1a011dccbf116410d6b268917965f89c206ea693 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1104,7 +1104,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -23,7 +23,7 @@ index 41313532c739027351d6fd848aa1c515aa4acd4a..d58f2bfde617ab55a550cbf8eb0187c9
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
@@ -5031,6 +5038,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -5035,6 +5042,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public final void setBoundingBox(AABB bb) {

View File

@@ -1,14 +1,15 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:02:07 +0800
Subject: [PATCH] Set old pos before moving entity by piston
Subject: [PATCH] Skip collision check if the block is not belong to current
tick region
diff --git a/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaPistonIssueFixConfig.java b/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaPistonIssueFixConfig.java
diff --git a/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaOldPositionIssueFixConfig.java b/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaOldPositionIssueFixConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..6edfb1d36a88d319151d28ba14873269736f84b6
index 0000000000000000000000000000000000000000..7294792d934e7374dcf335135dda739702fdcc62
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaPistonIssueFixConfig.java
+++ b/src/main/java/me/earthme/luminol/config/modules/fixes/FoliaOldPositionIssueFixConfig.java
@@ -0,0 +1,20 @@
+package me.earthme.luminol.config.modules.fixes;
+
@@ -16,7 +17,7 @@ index 0000000000000000000000000000000000000000..6edfb1d36a88d319151d28ba14873269
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.IConfigModule;
+
+public class FoliaPistonIssueFixConfig implements IConfigModule {
+public class FoliaOldPositionIssueFixConfig implements IConfigModule {
+ @ConfigInfo(baseName = "enabled")
+ public static boolean enabled = false;
+
@@ -27,6 +28,6 @@ index 0000000000000000000000000000000000000000..6edfb1d36a88d319151d28ba14873269
+
+ @Override
+ public String getBaseName() {
+ return "folia.fix_piston_moving_issue";
+ return "folia.fix_old_position_issue";
+ }
+}