Compare commits

..

5 Commits

Author SHA1 Message Date
Bacteriawa
9a6720e5f1 Merge branch 'dev/1.21.4-hardfork' of https://github.com/LuminolMC/Luminol into dev/1.21.4-hardfork 2025-05-23 23:00:16 +08:00
Helvetica Volubi
1d88056195 refactor: resort patches 2025-05-21 18:22:39 +08:00
Helvetica Volubi
3a7d1bd81d feat: Disable end crystal check (#102) 2025-05-21 13:05:30 +08:00
Helvetica Volubi
e84a8a5c18 [ci skip]refactor: rename some Class name 2025-05-21 12:20:17 +08:00
Bacteriawa
92928ee93d Updated Upstream (Folia) 2025-05-21 12:20:17 +08:00
57 changed files with 66 additions and 13 deletions

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Wed, 21 May 2025 13:04:00 +0800
Subject: [PATCH] Add config to disable end crystal check
diff --git a/net/minecraft/world/level/dimension/end/EndDragonFight.java b/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 2e156694b337760be986fdf1cbf863b0d896ef2d..b55ac3c0d19cf9117368c17687fa34099bfe3533 100644
--- a/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -546,6 +546,8 @@ public class EndDragonFight {
blockPos = this.portalLocation;
}
+ // Luminol start - Disable end crystal check
+ if (!me.earthme.luminol.config.modules.misc.DisableEndCrystalCheckConfig.disableEndCrystalCheck) {
// Paper start - Perf: Do crystal-portal proximity check before entity lookup
if (placedEndCrystalPos != null) {
// The end crystal must be 0 or 1 higher than the portal origin
@@ -561,6 +563,7 @@ public class EndDragonFight {
}
}
// Paper end - Perf: Do crystal-portal proximity check before entity lookup
+ } // Luminol end - Disable end crystal check
List<EndCrystal> list = Lists.newArrayList();

View File

@@ -31,7 +31,7 @@ index 9aace993c6c18f1a50610e4766225485984b8167..419c1c7e14691a472b70ed548ecb928c
}
}
diff --git a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
index f96fc1391167dea48cac1caa464b9026657df89a..ba2da205b046d7d3aab8fb21e116f9be73b13eb3 100644
index f96fc1391167dea48cac1caa464b9026657df89a..29b286386546db9d809f1b1b5c98571d3058a0f5 100644
--- a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
+++ b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
@@ -27,6 +27,11 @@ public class EndPlatformFeature extends Feature<NoneFeatureConfiguration> {
@@ -84,7 +84,7 @@ index f96fc1391167dea48cac1caa464b9026657df89a..ba2da205b046d7d3aab8fb21e116f9be
- // SPIGOT-7856: End platform not dropping items after replacing blocks
- if (dropBlocks) {
- blockList.getList().forEach((state) -> level.destroyBlock(state.getPosition(), true, null));
+ if (flag21 && !me.earthme.luminol.config.modules.misc.AllowTripwireDupe.enabled) {
+ if (flag21 || !me.earthme.luminol.config.modules.misc.AllowTripwireDupe.enabled) {
+ // Luminol start - When updated replace it with newer code
+ if (dropBlocks) {
+ java.util.function.Consumer<? super org.bukkit.craftbukkit.block.CraftBlockState> beforeRun = state -> level.destroyBlock(state.getPosition(), !blockList1.contains(state.getPosition()), null);

View File

@@ -21,7 +21,7 @@ index 80f17f33f670018240c854df589cf90cdeab6e70..8672757a4d5fb5c247599782fece6b8d
if (raidAt == null || raidAt.getRaidOmenLevel() < raidAt.getMaxRaidOmenLevel()) {
serverPlayer.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplifier));
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
index 2f45befbb50645f1bfb5961ad725f3670ff0d592..0d91ae860a5c506c634e88341d958618996cc5bc 100644
index 2f45befbb50645f1bfb5961ad725f3670ff0d592..190b9f46029ba0a0d69f68db2c56301f4ea21c94 100644
--- a/net/minecraft/world/entity/raid/Raid.java
+++ b/net/minecraft/world/entity/raid/Raid.java
@@ -325,7 +325,20 @@ public class Raid {
@@ -30,7 +30,7 @@ index 2f45befbb50645f1bfb5961ad725f3670ff0d592..0d91ae860a5c506c634e88341d958618
if (flag1) {
- this.waveSpawnPos = this.getValidSpawnPos();
+ // Luminol Start - Raid revert
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.pos_revert) {
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert) {
+ this.waveSpawnPos = this.getValidSpawnPos();
+ } else {
+ int n4 = 0;
@@ -53,7 +53,7 @@ index 2f45befbb50645f1bfb5961ad725f3670ff0d592..0d91ae860a5c506c634e88341d958618
- BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20));
+ // Luminol Start - Raid revert
+ BlockPos blockPos;
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.pos_revert) {
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert) {
+ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20));
+ } else {
+ blockPos = this.waveSpawnPos.isPresent() ? this.waveSpawnPos.get() : this.findRandomSpawnPos(i, 20);
@@ -67,7 +67,7 @@ index 2f45befbb50645f1bfb5961ad725f3670ff0d592..0d91ae860a5c506c634e88341d958618
}
- if (i > 5) {
+ if (i > (me.earthme.luminol.config.modules.misc.RaidChangesConfig.pos_revert ? 3 : 5)) { // Luminol - Raid revert
+ if (i > (me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert ? 3 : 5)) { // Luminol - Raid revert
org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit
this.stop();
break;
@@ -94,7 +94,7 @@ index 2f45befbb50645f1bfb5961ad725f3670ff0d592..0d91ae860a5c506c634e88341d958618
int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f);
int height = this.level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3);
- if (Mth.abs(height - this.center.getY()) <= 96) {
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.height_check || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - Disable height check
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.heightCheck || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - Disable height check
mutableBlockPos.set(i2, height, i3);
if (!this.level.isVillage(mutableBlockPos) || i <= 7) {
int i4 = 10;
@@ -126,7 +126,7 @@ index 2f45befbb50645f1bfb5961ad725f3670ff0d592..0d91ae860a5c506c634e88341d958618
return this.addWaveMob(wave, raider, true);
}
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
index 7c385baae81b9a987c0e1e4deb017884600331bc..75a8e0602c249df4b587a454e35f4cd7eab2a25c 100644
index 7c385baae81b9a987c0e1e4deb017884600331bc..075563d83fadd85191117685fa3b97a9fad14488 100644
--- a/net/minecraft/world/entity/raid/Raider.java
+++ b/net/minecraft/world/entity/raid/Raider.java
@@ -125,6 +125,43 @@ public abstract class Raider extends PatrollingMonster {
@@ -178,7 +178,7 @@ index 7c385baae81b9a987c0e1e4deb017884600331bc..75a8e0602c249df4b587a454e35f4cd7
public boolean hasRaid() {
- return this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null);
+ return !me.earthme.luminol.config.modules.misc.RaidChangesConfig.self_check && (this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null)); // Leaves - Disable raid self check
+ return !me.earthme.luminol.config.modules.misc.RaidChangesConfig.selfCheck && (this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null)); // Leaves - Disable raid self check
}
public boolean hasActiveRaid() {

View File

@@ -144,7 +144,7 @@
+ configFileInstance.add(fullConfigKeyName, oldValue);
+ } catch (Exception e) {
+ success = false;
+ logger.error("Failed to transfer removed config {}!", transformedConfig.name());
+ logger.error("Failed to transform removed config {}!", transformedConfig.name());
+ }
+ }
+

View File

@@ -0,0 +1,26 @@
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/DisableEndCrystalCheckConfig.java
@@ -1,0 +_,23 @@
+package me.earthme.luminol.config.modules.misc;
+
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.IConfigModule;
+
+public class DisableEndCrystalCheckConfig implements IConfigModule {
+ @ConfigInfo(baseName = "disable_end_crystal_check", comments =
+ """
+ Disable paper's End Crystal position check.
+ It reverts to vanilla respawn dragon logic.""")
+ public static boolean disableEndCrystalCheck = false;
+
+ @Override
+ public EnumConfigCategory getCategory() {
+ return EnumConfigCategory.MISC;
+ }
+
+ @Override
+ public String getBaseName() {
+ return "end_crystal";
+ }
+}

View File

@@ -31,19 +31,19 @@
+ Disable y <= 96 check.
+ If you enabled revert_274911, this config will useless
+ and always behavior of enabled""")
+ public static boolean height_check = false;
+ public static boolean heightCheck = false;
+
+ @ConfigInfo(baseName = "skip-self-raid-check", comments =
+ """
+ Disable raid self check\s
+ --- this config is not old version's function""")
+ public static boolean self_check = false;
+ public static boolean selfCheck = false;
+
+ @ConfigInfo(baseName = "revert-274911", comments =
+ """
+ Revert Old raid's find spawn position logic
+ --- This revert MC-274911""")
+ public static boolean pos_revert = false;
+ public static boolean posRevert = false;
+
+ @Override
+ public EnumConfigCategory getCategory() {