Compare commits
14 Commits
1.21.4-866
...
1.21.4-588
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
588900adbf | ||
|
|
9f4ffccfe7 | ||
|
|
d6e9602210 | ||
|
|
c4deb93977 | ||
|
|
c764d5330b | ||
|
|
29772be9fa | ||
|
|
b7971229f4 | ||
|
|
fbc64bd17c | ||
|
|
462f2d940d | ||
|
|
157b73620a | ||
|
|
bb107e7e4c | ||
|
|
7e41183c7f | ||
|
|
04d414a04b | ||
|
|
3a8425d3e9 |
8
.github/workflows/build_1.21.4.yml
vendored
8
.github/workflows/build_1.21.4.yml
vendored
@@ -22,6 +22,12 @@ jobs:
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '22'
|
||||
- name: Setup environment variables
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
export PRIVATE_MAVEN_REPO_LINK=${{ secrets.PRIVATE_MAVEN_REPO_LINK }}
|
||||
export PRIVATE_MAVEN_REPO_PASSWORD=${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
|
||||
export PRIVATE_MAVEN_REPO_USERNAME=${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Configure Git User Details
|
||||
@@ -34,8 +40,6 @@ jobs:
|
||||
if: github.event_name != 'pull_request'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
export MAVEN_REPO_USER=${{ secrets.MAVEN_REPO_USER }}
|
||||
export MAVEN_REPO_PASSWORD=${{ secrets.MAVEN_REPO_PASSWORD }}
|
||||
./gradlew publish -PpublishDevBundle=true
|
||||
- name: Upload Artifact
|
||||
uses: "actions/upload-artifact@v4"
|
||||
|
||||
@@ -81,12 +81,27 @@ subprojects {
|
||||
|
||||
extensions.configure<PublishingExtension> {
|
||||
repositories {
|
||||
/*
|
||||
maven("https://repo.papermc.io/repository/maven-snapshots/") {
|
||||
name = "paperSnapshots"
|
||||
credentials(PasswordCredentials::class)
|
||||
val privateMvnRepoLink = System.getenv("PRIVATE_MAVEN_REPO_LINK")
|
||||
val privateMvnRepoUsername = System.getenv("PRIVATE_MAVEN_REPO_USERNAME")
|
||||
val privateMvnRepoPassword = System.getenv("PRIVATE_MAVEN_REPO_PASSWORD")
|
||||
|
||||
if (privateMvnRepoLink != null && privateMvnRepoUsername != null && privateMvnRepoPassword != null) {
|
||||
maven(privateMvnRepoLink) {
|
||||
name = "LuminolMC-Private"
|
||||
credentials {
|
||||
username = privateMvnRepoUsername
|
||||
password = privateMvnRepoPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tasks.withType<Javadoc> {
|
||||
options {
|
||||
(this as StandardJavadocDocletOptions).apply {
|
||||
addStringOption("-add-modules", "jdk.incubator.vector")
|
||||
addStringOption("Xdoclint:none", "-quiet")
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 13 Apr 2025 11:07:04 +0800
|
||||
Subject: [PATCH] Disable Heightmap Warning
|
||||
Subject: [PATCH] Add config to disable heightmap warning
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/levelgen/Heightmap.java b/net/minecraft/world/level/levelgen/Heightmap.java
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Fri, 11 Apr 2025 16:53:57 +0800
|
||||
Subject: [PATCH] Leaves-Revert-raid-changes
|
||||
Subject: [PATCH] Add config to revert raid changes
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||
@@ -21,93 +21,112 @@ 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..4e2ec7f7946a70b676393f090c5ce6219314c3da 100644
|
||||
index 2f45befbb50645f1bfb5961ad725f3670ff0d592..0d91ae860a5c506c634e88341d958618996cc5bc 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -109,6 +109,12 @@ public class Raid {
|
||||
private static final org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry PDC_TYPE_REGISTRY = new org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry();
|
||||
public final org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer(PDC_TYPE_REGISTRY);
|
||||
// Paper end
|
||||
+ // Luminol Start - Raid revert
|
||||
+ private boolean flagForceWin = false;
|
||||
+ private boolean flag274911 = false;
|
||||
+ private int freshTick = 0;
|
||||
+ private int retryTimes = 0;
|
||||
+ // Luminol End - Raid revert
|
||||
@@ -325,7 +325,20 @@ public class Raid {
|
||||
}
|
||||
|
||||
// Folia start - make raids thread-safe
|
||||
public boolean ownsRaid() {
|
||||
@@ -270,7 +276,36 @@ public class Raid {
|
||||
if (flag1) {
|
||||
- this.waveSpawnPos = this.getValidSpawnPos();
|
||||
+ // Luminol Start - Raid revert
|
||||
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.pos_revert) {
|
||||
+ this.waveSpawnPos = this.getValidSpawnPos();
|
||||
+ } else {
|
||||
+ int n4 = 0;
|
||||
+ if (this.raidCooldownTicks < 100) {
|
||||
+ n4 = 1;
|
||||
+ }
|
||||
+ if (this.raidCooldownTicks < 40) {
|
||||
+ n4 = 2;
|
||||
+ }
|
||||
+ this.waveSpawnPos = this.getValidSpawnPos(n4);
|
||||
+ }
|
||||
+ // Luminol End - Raid revert
|
||||
}
|
||||
|
||||
if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) {
|
||||
@@ -360,7 +373,14 @@ public class Raid {
|
||||
int i = 0;
|
||||
|
||||
while (this.shouldSpawnGroup()) {
|
||||
- BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20));
|
||||
+ // Luminol Start - Raid revert
|
||||
+ BlockPos blockPos;
|
||||
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.pos_revert) {
|
||||
+ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20));
|
||||
+ } else {
|
||||
+ blockPos = this.waveSpawnPos.isPresent() ? this.waveSpawnPos.get() : this.findRandomSpawnPos(i, 20);
|
||||
+ }
|
||||
+ // Luminol End - Raid revert
|
||||
if (blockPos != null) {
|
||||
this.started = true;
|
||||
this.spawnGroup(blockPos);
|
||||
@@ -372,7 +392,7 @@ public class Raid {
|
||||
i++;
|
||||
}
|
||||
|
||||
- if (i > 5) {
|
||||
+ if (i > (me.earthme.luminol.config.modules.misc.RaidChangesConfig.pos_revert ? 3 : 5)) { // Luminol - Raid revert
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit
|
||||
this.stop();
|
||||
break;
|
||||
@@ -449,6 +469,17 @@ public class Raid {
|
||||
return blockPos != null ? Optional.of(blockPos) : Optional.empty();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
- if (!this.isStopped()) {
|
||||
+ // Luminol Start - Raid revert
|
||||
+ if (this.flag274911) {
|
||||
+ if (this.freshTick == 20) {
|
||||
+ if (this.waveSpawnPos.isPresent() && !this.level.isPositionEntityTicking(this.waveSpawnPos.get())) {
|
||||
+ this.waveSpawnPos = this.getValidSpawnPos();
|
||||
+ }
|
||||
+
|
||||
+ BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20));
|
||||
+ if (blockPos != null && retryTimes < 3) {
|
||||
+ this.started = true;
|
||||
+ this.spawnGroup(blockPos);
|
||||
+ this.retryTimes = 0;
|
||||
+ } else if (retryTimes == 3) {
|
||||
+ this.waveSpawnPos = Optional.empty();
|
||||
+ this.groupsSpawned++;
|
||||
+ this.retryTimes = 0;
|
||||
+ } else {
|
||||
+ this.retryTimes++;
|
||||
+ }
|
||||
+ if (!this.hasMoreWaves()) {
|
||||
+ this.flag274911 = false;
|
||||
+ this.flagForceWin = true;
|
||||
+ }
|
||||
+ this.freshTick = 0;
|
||||
+ } else {
|
||||
+ this.freshTick++;
|
||||
+ }
|
||||
+ return;
|
||||
+ // Luminol Start - Raid revert
|
||||
+ private Optional<BlockPos> getValidSpawnPos(int n) {
|
||||
+ for (int i = 0; i < 3; ++i) {
|
||||
+ BlockPos blockPos = this.findRandomSpawnPos(n, 1);
|
||||
+ if (blockPos == null) continue;
|
||||
+ return Optional.of(blockPos);
|
||||
+ }
|
||||
+ if (!this.isStopped() || this.flagForceWin) { // Luminol End - Raid revert
|
||||
if (this.status == Raid.RaidStatus.ONGOING) {
|
||||
boolean flag = this.active;
|
||||
this.active = this.level.hasChunkAt(this.center);
|
||||
@@ -288,6 +323,12 @@ public class Raid {
|
||||
return;
|
||||
}
|
||||
|
||||
+ // Luminol Start - Raid revert
|
||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.revert_274911 && this.waveSpawnPos.isPresent() && this.center.distSqr(this.waveSpawnPos.get()) >= 12544) {
|
||||
+ this.flag274911 = true;
|
||||
+ }
|
||||
+ // Luminol End - Raid revert
|
||||
+ return Optional.empty();
|
||||
+ }
|
||||
+ // Luminol End - Raid revert
|
||||
+
|
||||
if (!this.level.isVillage(this.center)) {
|
||||
this.moveRaidCenterToNearbyVillageSection();
|
||||
}
|
||||
@@ -379,7 +420,7 @@ public class Raid {
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.isStarted() && !this.hasMoreWaves() && totalRaidersAlive == 0) {
|
||||
+ if (this.flagForceWin || (this.isStarted() && !this.hasMoreWaves() && totalRaidersAlive == 0)) { // Luminol - Raid revert
|
||||
if (this.postRaidTicks < 40) {
|
||||
this.postRaidTicks++;
|
||||
} else {
|
||||
@@ -674,7 +715,7 @@ public class Raid {
|
||||
private boolean hasMoreWaves() {
|
||||
return this.hasBonusWave() ? !this.hasSpawnedBonusWave() : !this.isFinalWave();
|
||||
}
|
||||
@@ -674,7 +705,7 @@ public class Raid {
|
||||
int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f);
|
||||
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) { // Disable height check
|
||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.height_check || 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;
|
||||
@@ -694,6 +725,26 @@ public class Raid {
|
||||
return null;
|
||||
}
|
||||
|
||||
+ // Luminol Start - Raid revert
|
||||
+ @Nullable
|
||||
+ private BlockPos findRandomSpawnPos(int n, int n2) {
|
||||
+ int n3 = 2 - n;
|
||||
+ BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
||||
+ SpawnPlacementType spawnPlacementType = SpawnPlacements.getPlacementType(EntityType.RAVAGER);
|
||||
+ for (int i = 0; i < n2; ++i) {
|
||||
+ float f = this.level.random.nextFloat() * ((float)Math.PI * 2);
|
||||
+ int n4 = this.center.getX() + Mth.floor(Mth.cos(f) * 32.0f * (float)n3) + this.level.random.nextInt(5);
|
||||
+ int n5 = this.center.getZ() + Mth.floor(Mth.sin(f) * 32.0f * (float)n3) + this.level.random.nextInt(5);
|
||||
+ int n6 = this.level.getHeight(Heightmap.Types.WORLD_SURFACE, n4, n5);
|
||||
+ mutableBlockPos.set(n4, n6, n5);
|
||||
+ if (this.level.isVillage(mutableBlockPos) && n < 2) continue;
|
||||
+ if (!this.level.hasChunksAt(mutableBlockPos.getX() - 10, mutableBlockPos.getZ() - 10, mutableBlockPos.getX() + 10, mutableBlockPos.getZ() + 10) || !this.level.isPositionEntityTicking(mutableBlockPos) || !spawnPlacementType.isSpawnPositionOk(this.level, mutableBlockPos, EntityType.RAVAGER) && (!this.level.getBlockState((BlockPos)mutableBlockPos.below()).is(Blocks.SNOW) || !this.level.getBlockState(mutableBlockPos).isAir())) continue;
|
||||
+ return mutableBlockPos;
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Luminol End - Raid revert
|
||||
+
|
||||
private boolean addWaveMob(int wave, Raider raider) {
|
||||
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..262291eaeb9bc250affeda67957588d14ec1eebc 100644
|
||||
index 7c385baae81b9a987c0e1e4deb017884600331bc..75a8e0602c249df4b587a454e35f4cd7eab2a25c 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 {
|
||||
@@ -144,7 +163,7 @@ index 7c385baae81b9a987c0e1e4deb017884600331bc..262291eaeb9bc250affeda67957588d1
|
||||
+ net.minecraft.world.effect.MobEffectInstance mobeffect1 = new net.minecraft.world.effect.MobEffectInstance(net.minecraft.world.effect.MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, i, false, false, true);
|
||||
+
|
||||
+ if (!serverLevel.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_DISABLE_RAIDS)) {
|
||||
+ entityhuman.addEffect(mobeffect1, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN); // CraftBukkit
|
||||
+ entityhuman.addEffect(mobeffect1, entityhuman, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true, true); // CraftBukkit // Luminol - Raid revert adapt Cross Region Damage trace
|
||||
+ }
|
||||
+ this.setPatrolLeader(false);
|
||||
+ }
|
||||
@@ -164,24 +183,15 @@ index 7c385baae81b9a987c0e1e4deb017884600331bc..262291eaeb9bc250affeda67957588d1
|
||||
|
||||
public boolean hasActiveRaid() {
|
||||
diff --git a/net/minecraft/world/item/component/OminousBottleAmplifier.java b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
index 318f24d67be4daf6993ba547da0540be9c221a75..9a6820fce3977419fd81d802720c318ac15d07c4 100644
|
||||
index 318f24d67be4daf6993ba547da0540be9c221a75..5607d2f21131510563f8fdc9079d1145483b11df 100644
|
||||
--- a/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
+++ b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
@@ -28,7 +28,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
|
||||
|
||||
@Override
|
||||
public void onConsume(Level level, LivingEntity entity, ItemStack stack, Consumable consumable) {
|
||||
- entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below
|
||||
+ entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below
|
||||
}
|
||||
|
||||
// Paper start - properly resend entities - collect packets for bundle
|
||||
@@ -40,7 +40,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
|
||||
|
||||
@Override
|
||||
public void addToTooltip(Item.TooltipContext context, Consumer<Component> tooltipAdder, TooltipFlag tooltipFlag) {
|
||||
- List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true));
|
||||
+ List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true));
|
||||
+ List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Luminol - Raid effect infinite
|
||||
PotionContents.addPotionTooltip(list, tooltipAdder, 1.0F, context.tickRate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Thu, 24 Apr 2025 20:59:52 +0800
|
||||
Subject: [PATCH] Command IllegalArgumentException crash fix
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/commands/FillCommand.java b/net/minecraft/server/commands/FillCommand.java
|
||||
index 89154adfc659afa188cd771e70087e3b1a9c98b9..e622f96e6e116bf491bbea39da099e02ceaee502 100644
|
||||
--- a/net/minecraft/server/commands/FillCommand.java
|
||||
+++ b/net/minecraft/server/commands/FillCommand.java
|
||||
@@ -210,6 +210,10 @@ public class FillCommand {
|
||||
// Folia start - region threading
|
||||
} catch (CommandSyntaxException ex) {
|
||||
sendMessage(source, ex);
|
||||
+ // Luminol Start - Server crash fix
|
||||
+ } catch (IllegalArgumentException ex) {
|
||||
+ net.minecraft.server.commands.SetBlockCommand.processIAE(source, ex);
|
||||
+ // Luminol End - Server crash fix
|
||||
}
|
||||
}); return 0; // Folia end - region threading
|
||||
}
|
||||
diff --git a/net/minecraft/server/commands/SetBlockCommand.java b/net/minecraft/server/commands/SetBlockCommand.java
|
||||
index 05b824409546ba8bacf7efdaeac106af89ff0715..55911d49c7650b344b46b2cfa9c4ae840ae433c8 100644
|
||||
--- a/net/minecraft/server/commands/SetBlockCommand.java
|
||||
+++ b/net/minecraft/server/commands/SetBlockCommand.java
|
||||
@@ -86,6 +86,15 @@ public class SetBlockCommand {
|
||||
}
|
||||
// Folia end - region threading
|
||||
|
||||
+ // Luminol Start - Server crash fix
|
||||
+ public static void processIAE(CommandSourceStack src, IllegalArgumentException ex) {
|
||||
+ Component hoverText = Component.translatable("command.failed")
|
||||
+ .withStyle(style -> style.withHoverEvent(new net.minecraft.network.chat.HoverEvent(net.minecraft.network.chat.HoverEvent.Action.SHOW_TEXT, Component.literal(ex.getMessage()))));
|
||||
+ src.sendFailure(hoverText);
|
||||
+ com.mojang.logging.LogUtils.getLogger().error(ex.getMessage(), ex);
|
||||
+ }
|
||||
+ // Luminol end - Server crash fix
|
||||
+
|
||||
private static int setBlock(
|
||||
CommandSourceStack source, BlockPos pos, BlockInput state, SetBlockCommand.Mode mode, @Nullable Predicate<BlockInWorld> predicate
|
||||
) throws CommandSyntaxException {
|
||||
@@ -119,6 +128,10 @@ public class SetBlockCommand {
|
||||
// Folia start - region threading
|
||||
} catch (CommandSyntaxException ex) {
|
||||
sendMessage(source, ex);
|
||||
+ // Luminol Start - Server crash fix
|
||||
+ } catch (IllegalArgumentException ex) {
|
||||
+ processIAE(source, ex);
|
||||
+ // Luminol End - Server crash fix
|
||||
}
|
||||
});
|
||||
return 1;
|
||||
@@ -0,0 +1,33 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 2 May 2025 12:03:14 +0800
|
||||
Subject: [PATCH] Fix incorrectly synced data after player teleportation
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index b6df8df78105e08ca7be82524685d8b9422abf21..10e3a54f3e7aa02a5c9986d3694c02bef07a66bf 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1812,14 +1812,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.connection.send(new ClientboundChangeDifficultyPacket(
|
||||
worlddata.getDifficulty(), worlddata.isDifficultyLocked()
|
||||
));
|
||||
- this.connection.send(new ClientboundSetExperiencePacket(
|
||||
+ /*this.connection.send(new ClientboundSetExperiencePacket( // Luminol start - teleportAsync tweaks, will send in next tick, see the changes below
|
||||
this.experienceProgress, this.totalExperience, this.experienceLevel
|
||||
- ));
|
||||
+ ));*/ // Luminol end
|
||||
|
||||
playerlist.sendActivePlayerEffects(this);
|
||||
playerlist.sendLevelInfo(this, destination);
|
||||
playerlist.sendPlayerPermissionLevel(this);
|
||||
|
||||
+ // Luminol start - teleportAsync tweaks
|
||||
+ this.lastSentExp = -1;
|
||||
+ this.lastSentHealth = -1.0F;
|
||||
+ this.lastSentFood = -1;
|
||||
+ // Luminol end
|
||||
+
|
||||
// regular world add logic
|
||||
this.unsetRemoved();
|
||||
destination.addDuringTeleport(this);
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add missing teleportation apis for folia
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index b6df8df78105e08ca7be82524685d8b9422abf21..98ce0736c18cbb09704ef7ca6b67866d5736f7c7 100644
|
||||
index 10e3a54f3e7aa02a5c9986d3694c02bef07a66bf..ca67950e35c7f420846337e885d95b8eabca3f37 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1673,6 +1673,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -5,18 +5,20 @@ Subject: [PATCH] Fix off tickregion sync teleport
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index ceca76a5791e319dd7cc4048c9860b1df065b95a..4a0d07a3263704a7c6e6859ddcbe767c202ed794 100644
|
||||
index ccf1914b4f48ecc0f4fe980510f42d5415ec1daa..2ea6160492cb23e96271dfbfd3bd35fe03109d6a 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4067,6 +4067,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4067,6 +4067,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.resetStoredPositions();
|
||||
}
|
||||
|
||||
+ // Luminol start - Fix sync teleport issue
|
||||
+ private boolean getNearByEdge(int destX, int destZ) {
|
||||
+ private boolean checkNearbyTickRegions(int destX, int destZ) {
|
||||
+ // Dumb end gateway search the chunks in radius of 5 chunks, so we need keep 6(5+1) by default check radius
|
||||
+ int sizeBx = Math.min(6, (int) (this.bb.maxX - this.bb.minX) + this.level.getCraftServer().getSimulationDistance());
|
||||
+ int sizeBz = Math.min(6, (int) (this.bb.maxZ - this.bb.minZ) + this.level.getCraftServer().getSimulationDistance());
|
||||
+
|
||||
+ // check tick thread around these area
|
||||
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level,
|
||||
+ (destX >> 4) - sizeBx,
|
||||
+ (destZ >> 4) - sizeBz,
|
||||
@@ -28,15 +30,13 @@ index ceca76a5791e319dd7cc4048c9860b1df065b95a..4a0d07a3263704a7c6e6859ddcbe767c
|
||||
protected final void transform(TeleportTransition telpeort) {
|
||||
PositionMoveRotation move = PositionMoveRotation.calculateAbsolute(
|
||||
PositionMoveRotation.of(this), PositionMoveRotation.of(telpeort), telpeort.relatives()
|
||||
@@ -4186,10 +4199,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
wrapped.callEvent();
|
||||
// Luminol end
|
||||
|
||||
- // check for same region
|
||||
@@ -4189,7 +4204,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// check for same region
|
||||
if (destination == this.level()) {
|
||||
Vec3 currPos = this.position();
|
||||
- if (
|
||||
+ if (this.getNearByEdge((int) pos.x, (int) pos.z) && // Luminol - Fix sync teleport issue
|
||||
+ // Luminol - Prevent entity sync teleported to the edge of tickregion
|
||||
+ if (this.checkNearbyTickRegions((int) pos.x, (int) pos.z) && // Luminol - Fix sync teleport issue
|
||||
destination.regioniser.getRegionAtUnsynchronised(
|
||||
ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkX(currPos), ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkZ(currPos)
|
||||
) == destination.regioniser.getRegionAtUnsynchronised(
|
||||
@@ -0,0 +1,127 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 27 Apr 2025 14:26:01 +0800
|
||||
Subject: [PATCH] Portal Behavior Modifiers
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 2ea6160492cb23e96271dfbfd3bd35fe03109d6a..2871980e53a66bdacf7c00e7045ad01d68a972d3 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -3304,7 +3304,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.setPortalCooldown();
|
||||
} else {
|
||||
if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) {
|
||||
- this.portalProcess = new PortalProcessor(portal, pos.immutable());
|
||||
+ this.portalProcess = new PortalProcessor(portal, pos.immutable(), this.getDeltaMovement()); // Luminol - Entity portal-teleport speed fix
|
||||
} else if (!this.portalProcess.isInsidePortalThisTick()) {
|
||||
this.portalProcess.updateEntryPosition(pos.immutable());
|
||||
this.portalProcess.setAsInsidePortalThisTick(true);
|
||||
@@ -3829,20 +3829,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
EntityTreeNode curr;
|
||||
while ((curr = queue.pollFirst()) != null) {
|
||||
- EntityTreeNode[] passengers = curr.passengers;
|
||||
+ restore(curr); // Luminol - EndGateway Portal Passengers Fix
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Luminol Start - EndGateway Portal Passengers Fix
|
||||
+ private EntityTreeNode[] restore(EntityTreeNode entity) {
|
||||
+ EntityTreeNode[] passengers = entity.passengers;
|
||||
if (passengers == null) {
|
||||
- continue;
|
||||
+ return null;
|
||||
}
|
||||
|
||||
List<Entity> newPassengers = new java.util.ArrayList<>();
|
||||
for (EntityTreeNode passenger : passengers) {
|
||||
+ passenger.passengers = restore(passenger);
|
||||
newPassengers.add(passenger.root);
|
||||
- passenger.root.vehicle = curr.root;
|
||||
+ passenger.root.vehicle = entity.root;
|
||||
}
|
||||
-
|
||||
- curr.root.passengers = ImmutableList.copyOf(newPassengers);
|
||||
- }
|
||||
+ entity.root.passengers = ImmutableList.copyOf(newPassengers);
|
||||
+ return passengers;
|
||||
}
|
||||
+ // Luminol End - EndGateway Portal Passengers Fix
|
||||
|
||||
public void addTracker() {
|
||||
for (final EntityTreeNode node : this.getFullTree()) {
|
||||
@@ -4561,6 +4568,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
}
|
||||
|
||||
+ // Luminol start - Add afterPortalLogic
|
||||
+ protected void afterPortalLogic() {
|
||||
+
|
||||
+ }
|
||||
+ // Luminol end - Add afterPortalLogic
|
||||
+
|
||||
protected boolean portalToAsync(ServerLevel destination, BlockPos portalPos, boolean takePassengers,
|
||||
PortalType type, java.util.function.Consumer<Entity> teleportComplete) {
|
||||
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
|
||||
@@ -4644,6 +4657,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
info.postTeleportTransition().onTransition(teleported);
|
||||
}
|
||||
|
||||
+ teleported.afterPortalLogic(); // Luminol - Add afterPortalLogic
|
||||
+
|
||||
// Kaiiju start - vanilla end teleportation
|
||||
/*if (teleportComplete != null) {
|
||||
teleportComplete.accept(teleported);
|
||||
diff --git a/net/minecraft/world/entity/PortalProcessor.java b/net/minecraft/world/entity/PortalProcessor.java
|
||||
index 46d989aef0eceebd98bfd93999153319de77a8a0..6e9171fa0c636439bd96401ea9e5fe80ffdc8bdd 100644
|
||||
--- a/net/minecraft/world/entity/PortalProcessor.java
|
||||
+++ b/net/minecraft/world/entity/PortalProcessor.java
|
||||
@@ -9,12 +9,14 @@ import net.minecraft.world.level.portal.TeleportTransition;
|
||||
public class PortalProcessor {
|
||||
private final Portal portal;
|
||||
private BlockPos entryPosition;
|
||||
+ private net.minecraft.world.phys.Vec3 speedVec3; // Luminol - Entity portal-teleport speed fix
|
||||
private int portalTime;
|
||||
private boolean insidePortalThisTick;
|
||||
|
||||
- public PortalProcessor(Portal portal, BlockPos entryPosition) {
|
||||
+ public PortalProcessor(Portal portal, BlockPos entryPosition, net.minecraft.world.phys.Vec3 speedVec3) { // Luminol - Entity portal-teleport speed fix
|
||||
this.portal = portal;
|
||||
this.entryPosition = entryPosition;
|
||||
+ this.speedVec3 = speedVec3; // Luminol - Entity portal-teleport speed fix
|
||||
this.insidePortalThisTick = true;
|
||||
}
|
||||
|
||||
@@ -35,7 +37,15 @@ public class PortalProcessor {
|
||||
|
||||
// Folia start - region threading
|
||||
public boolean portalAsync(ServerLevel sourceWorld, Entity portalTarget) {
|
||||
- return this.portal.portalAsync(sourceWorld, portalTarget, this.entryPosition);
|
||||
+ // Luminol start - Entity portal-teleport speed fix
|
||||
+ net.minecraft.world.phys.Vec3 oldSpeed = portalTarget.getDeltaMovement();
|
||||
+ portalTarget.setDeltaMovement(this.speedVec3);
|
||||
+ boolean flag = this.portal.portalAsync(sourceWorld, portalTarget, this.entryPosition);
|
||||
+ if (!flag) {
|
||||
+ portalTarget.setDeltaMovement(oldSpeed);
|
||||
+ }
|
||||
+ return flag;
|
||||
+ // Luminol end - Entity portal-teleport speed fix
|
||||
}
|
||||
// Folia end - region threading
|
||||
|
||||
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
index 88570bb4aa02896545805d7721c45cf9599befea..bbf9748a36404139356db606dbb3b0cc13c66b50 100644
|
||||
--- a/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
@@ -251,4 +251,10 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||
return !this.level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid();
|
||||
}
|
||||
// Paper end - Option to prevent TNT from moving in water
|
||||
+
|
||||
+ // Luminol start - Add afterPortalLogic
|
||||
+ protected void afterPortalLogic() {
|
||||
+ this.setUsedPortal(true);
|
||||
+ }
|
||||
+ // Luminol start - Add afterPortalLogic
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Leaves Fix SculkCatalyst exp skip
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 98ce0736c18cbb09704ef7ca6b67866d5736f7c7..d0853f44f1b4c88ba62a74db9e49a32709685425 100644
|
||||
index ca67950e35c7f420846337e885d95b8eabca3f37..d9ea3db817878ff56a2772ce983ff95431e1326c 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1358,7 +1358,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1,47 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 27 Apr 2025 14:26:01 +0800
|
||||
Subject: [PATCH] Add afterPortalLogic to process some logics
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 4a0d07a3263704a7c6e6859ddcbe767c202ed794..dc0a9f39751173824d8cef569f94b459ee6e94dc 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4557,6 +4557,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
}
|
||||
|
||||
+ // Luminol start - Add afterPortalLogic
|
||||
+ protected void afterPortalLogic() {
|
||||
+
|
||||
+ }
|
||||
+ // Luminol end - Add afterPortalLogic
|
||||
+
|
||||
protected boolean portalToAsync(ServerLevel destination, BlockPos portalPos, boolean takePassengers,
|
||||
PortalType type, java.util.function.Consumer<Entity> teleportComplete) {
|
||||
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
|
||||
@@ -4640,6 +4646,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
info.postTeleportTransition().onTransition(teleported);
|
||||
}
|
||||
|
||||
+ teleported.afterPortalLogic(); // Luminol - Add afterPortalLogic
|
||||
+
|
||||
// Kaiiju start - vanilla end teleportation
|
||||
/*if (teleportComplete != null) {
|
||||
teleportComplete.accept(teleported);
|
||||
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
index 88570bb4aa02896545805d7721c45cf9599befea..bbf9748a36404139356db606dbb3b0cc13c66b50 100644
|
||||
--- a/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
@@ -251,4 +251,10 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||
return !this.level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid();
|
||||
}
|
||||
// Paper end - Option to prevent TNT from moving in water
|
||||
+
|
||||
+ // Luminol start - Add afterPortalLogic
|
||||
+ protected void afterPortalLogic() {
|
||||
+ this.setUsedPortal(true);
|
||||
+ }
|
||||
+ // Luminol start - Add afterPortalLogic
|
||||
}
|
||||
@@ -19,7 +19,7 @@ index 7eff847790394aecd058e7a61905da86163b4c6e..9099457f55a2829297ac1db8a69a98ff
|
||||
double rangeY = level.paperConfig().entities.trackingRangeY.get(this.entity, -1);
|
||||
if (rangeY != -1) {
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index ccf1914b4f48ecc0f4fe980510f42d5415ec1daa..ceca76a5791e319dd7cc4048c9860b1df065b95a 100644
|
||||
index 2871980e53a66bdacf7c00e7045ad01d68a972d3..2005f769d21de40621beb913446e816b87a03c3a 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -135,7 +135,7 @@ import net.minecraft.world.scores.ScoreHolder;
|
||||
@@ -31,7 +31,7 @@ index ccf1914b4f48ecc0f4fe980510f42d5415ec1daa..ceca76a5791e319dd7cc4048c9860b1d
|
||||
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
@@ -6049,4 +6049,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -6080,4 +6080,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// Paper end - Expose entity id counter
|
||||
|
||||
public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
|
||||
@@ -1,56 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 28 Apr 2025 11:53:13 +0800
|
||||
Subject: [PATCH] Entity portal-teleport speed fix
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index dc0a9f39751173824d8cef569f94b459ee6e94dc..a4e5c5675dc09f598a6ae05d7aea21b48e451b21 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -3304,7 +3304,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.setPortalCooldown();
|
||||
} else {
|
||||
if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) {
|
||||
- this.portalProcess = new PortalProcessor(portal, pos.immutable());
|
||||
+ this.portalProcess = new PortalProcessor(portal, pos.immutable(), this.getDeltaMovement()); // Luminol - Entity portal-teleport speed fix
|
||||
} else if (!this.portalProcess.isInsidePortalThisTick()) {
|
||||
this.portalProcess.updateEntryPosition(pos.immutable());
|
||||
this.portalProcess.setAsInsidePortalThisTick(true);
|
||||
diff --git a/net/minecraft/world/entity/PortalProcessor.java b/net/minecraft/world/entity/PortalProcessor.java
|
||||
index 46d989aef0eceebd98bfd93999153319de77a8a0..6e9171fa0c636439bd96401ea9e5fe80ffdc8bdd 100644
|
||||
--- a/net/minecraft/world/entity/PortalProcessor.java
|
||||
+++ b/net/minecraft/world/entity/PortalProcessor.java
|
||||
@@ -9,12 +9,14 @@ import net.minecraft.world.level.portal.TeleportTransition;
|
||||
public class PortalProcessor {
|
||||
private final Portal portal;
|
||||
private BlockPos entryPosition;
|
||||
+ private net.minecraft.world.phys.Vec3 speedVec3; // Luminol - Entity portal-teleport speed fix
|
||||
private int portalTime;
|
||||
private boolean insidePortalThisTick;
|
||||
|
||||
- public PortalProcessor(Portal portal, BlockPos entryPosition) {
|
||||
+ public PortalProcessor(Portal portal, BlockPos entryPosition, net.minecraft.world.phys.Vec3 speedVec3) { // Luminol - Entity portal-teleport speed fix
|
||||
this.portal = portal;
|
||||
this.entryPosition = entryPosition;
|
||||
+ this.speedVec3 = speedVec3; // Luminol - Entity portal-teleport speed fix
|
||||
this.insidePortalThisTick = true;
|
||||
}
|
||||
|
||||
@@ -35,7 +37,15 @@ public class PortalProcessor {
|
||||
|
||||
// Folia start - region threading
|
||||
public boolean portalAsync(ServerLevel sourceWorld, Entity portalTarget) {
|
||||
- return this.portal.portalAsync(sourceWorld, portalTarget, this.entryPosition);
|
||||
+ // Luminol start - Entity portal-teleport speed fix
|
||||
+ net.minecraft.world.phys.Vec3 oldSpeed = portalTarget.getDeltaMovement();
|
||||
+ portalTarget.setDeltaMovement(this.speedVec3);
|
||||
+ boolean flag = this.portal.portalAsync(sourceWorld, portalTarget, this.entryPosition);
|
||||
+ if (!flag) {
|
||||
+ portalTarget.setDeltaMovement(oldSpeed);
|
||||
+ }
|
||||
+ return flag;
|
||||
+ // Luminol end - Entity portal-teleport speed fix
|
||||
}
|
||||
// Folia end - region threading
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Tue, 29 Apr 2025 23:03:56 +0800
|
||||
Subject: [PATCH] Cross Region Damage trace
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index d9ea3db817878ff56a2772ce983ff95431e1326c..fd4e37719baced819100f7ad2d1cf0350950cb60 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1378,6 +1378,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.awardStat(Stats.ENTITY_KILLED_BY.get(killCredit.getType()));
|
||||
killCredit.awardKillScore(this, cause);
|
||||
this.createWitherRose(killCredit);
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
||||
+ final LivingEntity entitylivingnew = this.getKillCreditOrigin();
|
||||
+ if (entitylivingnew != null) {
|
||||
+ this.damageTransferToAsync(entitylivingnew, cause);
|
||||
+ }
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
}
|
||||
|
||||
this.level().broadcastEntityEvent(this, (byte)3);
|
||||
@@ -1392,6 +1399,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.setClientLoaded(false);
|
||||
}
|
||||
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ private void damageTransferToAsync(LivingEntity entity, DamageSource cause) {
|
||||
+ // Operations running on current entity
|
||||
+ this.awardStat(Stats.ENTITY_KILLED_BY.get(entity.getType()));
|
||||
+ this.createWitherRose(entity);
|
||||
+
|
||||
+ // the entity might be in another tickregion sometimes, so we need to schedule the task onto the entity
|
||||
+ // to ensure thread safe
|
||||
+ entity.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
|
||||
+ try {
|
||||
+ nmsEntity.awardKillScore(this, cause);
|
||||
+ } catch (Throwable ex) {
|
||||
+ LOGGER.error(ex.getMessage(), ex);
|
||||
+ }
|
||||
+ }, null, 1L );
|
||||
+ }
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
+
|
||||
// Leaves start - exp fix
|
||||
private boolean shouldDropExperience(boolean eventResult, boolean forceUseEvent) {
|
||||
if (forceUseEvent) {
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 1df158d30622ea71fcc937140c682d0e994d54c1..4eddc407d04428516dc3607e4726d3ff58588c62 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1181,6 +1181,29 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Luminol Start - raid revert adapt Cross Region Damage trace
|
||||
+ public boolean addEffect(MobEffectInstance effectInstance, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause, boolean fireEvent, boolean async) {
|
||||
+ if (ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
|
||||
+ return addEffect(effectInstance, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true);
|
||||
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
||||
+ postToEntityThreadAddEffect(effectInstance, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true);
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ private void postToEntityThreadAddEffect(MobEffectInstance effectInstance, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause, boolean fireEvent) {
|
||||
+ if (entity != null)
|
||||
+ entity.getBukkitEntity().taskScheduler.schedule((Entity nmsEntity) -> {
|
||||
+ try {
|
||||
+ addEffect(effectInstance, nmsEntity, cause, fireEvent);
|
||||
+ } catch (Throwable ex) {
|
||||
+ LOGGER.error(ex.getMessage(), ex);
|
||||
+ }
|
||||
+ }, null, 1L );
|
||||
+ }
|
||||
+ // Luminol End - raid revert adapt Cross Region Damage trace
|
||||
+
|
||||
public boolean canBeAffected(MobEffectInstance effectInstance) {
|
||||
if (this.getType().is(EntityTypeTags.IMMUNE_TO_INFESTED)) {
|
||||
return !effectInstance.is(MobEffects.INFESTED);
|
||||
@@ -1831,6 +1854,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
final LivingEntity entityliving = this.getKillCredit();
|
||||
if (entityliving != null) {
|
||||
entityliving.awardKillScore(this, damageSource);
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
||||
+ final LivingEntity entitylivingnew = this.getKillCreditOrigin();
|
||||
+ if (entitylivingnew != null) {
|
||||
+ this.damageTransferToAsync(entitylivingnew, damageSource);
|
||||
+ }
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
}
|
||||
}); // Paper end
|
||||
this.postDeathDropItems(deathEvent); // Paper
|
||||
@@ -1841,6 +1871,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return deathEvent; // Paper
|
||||
}
|
||||
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ private void damageTransferToAsync(LivingEntity entity, DamageSource damageSource) {
|
||||
+ entity.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
|
||||
+ try {
|
||||
+ nmsEntity.awardKillScore(this, damageSource);
|
||||
+ } catch (Throwable ex) {
|
||||
+ LOGGER.error(ex.getMessage(), ex);
|
||||
+ }
|
||||
+ }, null, 1L );
|
||||
+ }
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
+
|
||||
protected void dropEquipment(ServerLevel level) {
|
||||
}
|
||||
protected void postDeathDropItems(org.bukkit.event.entity.EntityDeathEvent event) {} // Paper - method for post death logic that cannot be ran before the event is potentially cancelled
|
||||
@@ -2474,6 +2516,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ @Nullable
|
||||
+ public LivingEntity getKillCreditOrigin() {
|
||||
+ if (this.lastHurtByPlayer != null) {
|
||||
+ return this.lastHurtByPlayer;
|
||||
+ } else if (this.lastHurtByMob != null) {
|
||||
+ return this.lastHurtByMob;
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
+
|
||||
public final float getMaxHealth() {
|
||||
return (float)this.getAttributeValue(Attributes.MAX_HEALTH);
|
||||
}
|
||||
diff --git a/net/minecraft/world/item/component/OminousBottleAmplifier.java b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
index 5607d2f21131510563f8fdc9079d1145483b11df..f709880a8c1064298aa133617055e7aa5cc2be5e 100644
|
||||
--- a/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
+++ b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
@@ -28,7 +28,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
|
||||
|
||||
@Override
|
||||
public void onConsume(Level level, LivingEntity entity, ItemStack stack, Consumable consumable) {
|
||||
- entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below
|
||||
+ entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below // Luminol - Raid effect infinite
|
||||
}
|
||||
|
||||
// Paper start - properly resend entities - collect packets for bundle
|
||||
@@ -0,0 +1,167 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Thu, 1 May 2025 22:43:08 +0800
|
||||
Subject: [PATCH] Add config to enable tick command
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
index 1382c695c4991488b113401e231875ddc74f6b01..68280b07a71dcdb42eaee6f62fbda074813a22e4 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
@@ -286,6 +286,11 @@ public final class RegionizedServer {
|
||||
this.randomWalk();
|
||||
*/
|
||||
++this.tickCount;
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
||||
+ MinecraftServer.tickRateManager.tick();
|
||||
+ }
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
// expire invalid click command callbacks
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue((int)this.tickCount);
|
||||
|
||||
@@ -308,6 +313,13 @@ public final class RegionizedServer {
|
||||
this.globalTick(world, tickCount);
|
||||
}
|
||||
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
||||
+ MinecraftServer.tickRateManager.reduceSprintTicks();
|
||||
+ MinecraftServer.tickRateManager.endTickWork();
|
||||
+ }
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
+
|
||||
// tick connections
|
||||
this.tickConnections();
|
||||
|
||||
@@ -441,7 +453,7 @@ public final class RegionizedServer {
|
||||
}
|
||||
|
||||
private void tickTime(final ServerLevel world, final int tickCount) {
|
||||
- if (world.tickTime) {
|
||||
+ if ((!me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled || world.tickRateManager().runsNormally()) && world.tickTime) { // Luminol - Add a config to enable tick command
|
||||
if (world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
||||
world.setDayTime(world.levelData.getDayTime() + (long)tickCount);
|
||||
}
|
||||
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
index 7123b3eb2f2e52946b8ef9de993a6828eb0bb6f7..82948984404a183711588932a4a026dc4c241feb 100644
|
||||
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
@@ -31,8 +31,8 @@ public final class TickRegionScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
- public static final int TICK_RATE = 20;
|
||||
- public static final long TIME_BETWEEN_TICKS = 1_000_000_000L / TICK_RATE; // ns
|
||||
+ public static float TICK_RATE = 20; // Luminol - Add tick command support
|
||||
+ public static long TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE); // ns // Luminol - Add tick command support
|
||||
|
||||
// Folia start - watchdog
|
||||
public static final FoliaWatchdogThread WATCHDOG_THREAD = new FoliaWatchdogThread();
|
||||
@@ -375,8 +375,23 @@ public final class TickRegionScheduler {
|
||||
final long cpuStart = MEASURE_CPU_TIME ? THREAD_MX_BEAN.getCurrentThreadCpuTime() : 0L;
|
||||
final long tickStart = System.nanoTime();
|
||||
|
||||
- // use max(), don't assume that tickStart >= scheduledStart
|
||||
- final int tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ final int tickCount;
|
||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
||||
+ if (MinecraftServer.tickRateManager.isSprinting() && MinecraftServer.tickRateManager.checkShouldSprintThisTick()) {
|
||||
+ TICK_RATE = net.minecraft.server.commands.TickCommand.MAX_TICKRATE;
|
||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
||||
+ tickCount = 1;
|
||||
+ } else {
|
||||
+ TICK_RATE = MinecraftServer.tickRateManager.tickrate();
|
||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
||||
+ tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
+ } else {
|
||||
+ // use max(), don't assume that tickStart >= scheduledStart
|
||||
+ tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
+ // Luminol end - Add tick command support
|
||||
|
||||
if (!this.tryMarkTicking()) {
|
||||
if (!this.cancelled.get()) {
|
||||
@@ -416,6 +431,11 @@ public final class TickRegionScheduler {
|
||||
try {
|
||||
// next start isn't updated until the end of this tick
|
||||
this.tickRegion(tickCount, tickStart, scheduledEnd);
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
||||
+ MinecraftServer.tickRateManager.endTickWork();
|
||||
+ }
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
} catch (final Throwable thr) {
|
||||
this.scheduler.regionFailed(this, false, thr);
|
||||
// regionFailed will schedule a shutdown, so we should avoid letting this region tick further
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index cfb37f2e428605965a37dc1eb83f302fe1bd6299..8f7b28e5688252207ad8ce9f3fb6f9c3b65d1adc 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -213,7 +213,11 @@ public class Commands {
|
||||
//TeamMsgCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
TeleportCommand.register(this.dispatcher);
|
||||
TellRawCommand.register(this.dispatcher, context);
|
||||
- //TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
||||
+ TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
+ }
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
TimeCommand.register(this.dispatcher);
|
||||
TitleCommand.register(this.dispatcher, context);
|
||||
//TriggerCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 330af9f4de1c72387326816065350e71fe546efe..e62e8b9af7ad3e4454702ac86ad2b27973eba66f 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -267,7 +267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private String serverId;
|
||||
public MinecraftServer.ReloadableResources resources;
|
||||
private final StructureTemplateManager structureTemplateManager;
|
||||
- private final ServerTickRateManager tickRateManager;
|
||||
+ public static ServerTickRateManager tickRateManager; // Luminol - Add tick command support
|
||||
protected WorldData worldData;
|
||||
public PotionBrewing potionBrewing;
|
||||
private FuelValues fuelValues;
|
||||
diff --git a/net/minecraft/server/ServerTickRateManager.java b/net/minecraft/server/ServerTickRateManager.java
|
||||
index 40338efd1c0e56d869d03f1d0687e7ff0fcbf11a..d0d90a25a10bbecfffceee1992af88c60d14fd87 100644
|
||||
--- a/net/minecraft/server/ServerTickRateManager.java
|
||||
+++ b/net/minecraft/server/ServerTickRateManager.java
|
||||
@@ -105,7 +105,7 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
return false;
|
||||
} else if (this.remainingSprintTicks > 0L) {
|
||||
this.sprintTickStartTime = System.nanoTime();
|
||||
- this.remainingSprintTicks--;
|
||||
+ // this.remainingSprintTicks--; // Luminol - Add tick command support
|
||||
return true;
|
||||
} else {
|
||||
this.finishTickSprint();
|
||||
@@ -113,6 +113,12 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Luminol start - Add tick command support
|
||||
+ public void reduceSprintTicks() {
|
||||
+ this.remainingSprintTicks--;
|
||||
+ }
|
||||
+ // Luminol end - Add tick command support
|
||||
+
|
||||
public void endTickWork() {
|
||||
this.sprintTimeSpend = this.sprintTimeSpend + (System.nanoTime() - this.sprintTickStartTime);
|
||||
}
|
||||
diff --git a/net/minecraft/server/commands/TickCommand.java b/net/minecraft/server/commands/TickCommand.java
|
||||
index 6b6c8ce49eda6806c8288d70848dd143ba2c4703..5d09d2c8bb45cc10b2a13100793249adc7b5a7e9 100644
|
||||
--- a/net/minecraft/server/commands/TickCommand.java
|
||||
+++ b/net/minecraft/server/commands/TickCommand.java
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.server.ServerTickRateManager;
|
||||
import net.minecraft.util.TimeUtil;
|
||||
|
||||
public class TickCommand {
|
||||
- private static final float MAX_TICKRATE = 10000.0F;
|
||||
+ public static final float MAX_TICKRATE = 10000.0F; // Luminol - Add tick command support
|
||||
private static final String DEFAULT_TICKRATE = String.valueOf(20);
|
||||
|
||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
|
||||
@@ -0,0 +1,25 @@
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandTickConfig.java
|
||||
@@ -1,0 +_,22 @@
|
||||
+package me.earthme.luminol.config.modules.experiment;
|
||||
+
|
||||
+import me.earthme.luminol.config.ConfigInfo;
|
||||
+import me.earthme.luminol.config.EnumConfigCategory;
|
||||
+import me.earthme.luminol.config.IConfigModule;
|
||||
+
|
||||
+public class CommandTickConfig implements IConfigModule {
|
||||
+ @ConfigInfo(baseName = "enabled", comments =
|
||||
+ """
|
||||
+ Allow to use tick command""")
|
||||
+ public static boolean enabled = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
+ return EnumConfigCategory.EXPERIMENT;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getBaseName() {
|
||||
+ return "enable_tick_command";
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,25 @@
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/EntityDamageSourceTraceConfig.java
|
||||
@@ -1,0 +_,22 @@
|
||||
+package me.earthme.luminol.config.modules.experiment;
|
||||
+
|
||||
+import me.earthme.luminol.config.ConfigInfo;
|
||||
+import me.earthme.luminol.config.EnumConfigCategory;
|
||||
+import me.earthme.luminol.config.IConfigModule;
|
||||
+
|
||||
+public class EntityDamageSourceTraceConfig implements IConfigModule {
|
||||
+ @ConfigInfo(baseName = "enabled", comments =
|
||||
+ """
|
||||
+ Allow trace damage source cross different Region Scheduler.""")
|
||||
+ public static boolean enabled = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
+ return EnumConfigCategory.EXPERIMENT;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getBaseName() {
|
||||
+ return "entity-damage-source-trace";
|
||||
+ }
|
||||
+}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/RaidChangesConfig.java
|
||||
@@ -1,0 +_,52 @@
|
||||
@@ -1,0 +_,54 @@
|
||||
+package me.earthme.luminol.config.modules.misc;
|
||||
+
|
||||
+import me.earthme.luminol.config.ConfigInfo;
|
||||
@@ -28,7 +28,9 @@
|
||||
+
|
||||
+ @ConfigInfo(baseName = "skip-height-check", comments =
|
||||
+ """
|
||||
+ Disable y <= 96 check""")
|
||||
+ Disable y <= 96 check.
|
||||
+ If you enabled revert_274911, this config will useless
|
||||
+ and always behavior of enabled""")
|
||||
+ public static boolean height_check = false;
|
||||
+
|
||||
+ @ConfigInfo(baseName = "skip-self-raid-check", comments =
|
||||
@@ -39,9 +41,9 @@
|
||||
+
|
||||
+ @ConfigInfo(baseName = "revert-274911", comments =
|
||||
+ """
|
||||
+ Revert MC-274911(hard-revert)
|
||||
+ --- maybe have some bugs""")
|
||||
+ public static boolean revert_274911 = false;
|
||||
+ Revert Old raid's find spawn position logic
|
||||
+ --- This revert MC-274911""")
|
||||
+ public static boolean pos_revert = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
|
||||
Reference in New Issue
Block a user