Skip to content

Commit 10f1365

Browse files
committed
Merge 1.19.2 into 1.20
2 parents b088fee + dfb9378 commit 10f1365

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.embeddedt.modernfix.common.mixin.bugfix.restore_old_dragon_movement;
2+
3+
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.injection.At;
6+
import org.spongepowered.asm.mixin.injection.ModifyArg;
7+
import org.spongepowered.asm.mixin.injection.Slice;
8+
9+
@Mixin(EnderDragon.class)
10+
public class EnderDragonMixin {
11+
/**
12+
* @author embeddedt (regression identified by Jukitsu in MC-272431)
13+
* @reason Revert dragon vertical movement behavior to how it worked in 1.13 and older. Note: this patches techniques
14+
* that rely on the predictable vertical descent like one-cycling.
15+
*/
16+
@ModifyArg(method = "aiStep",
17+
slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/boss/enderdragon/phases/DragonPhaseInstance;getFlyTargetLocation()Lnet/minecraft/world/phys/Vec3;")),
18+
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/phys/Vec3;add(DDD)Lnet/minecraft/world/phys/Vec3;", ordinal = 0), index = 1)
19+
private double fixVerticalVelocityScale(double y) {
20+
return y * 10;
21+
}
22+
}

common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public DefaultSettingMapBuilder put(String key, Boolean value) {
165165
.put("mixin.feature.direct_stack_trace", false)
166166
.put("mixin.feature.stalled_chunk_load_detection", false)
167167
.put("mixin.perf.blast_search_trees.force", false)
168+
.put("mixin.bugfix.restore_old_dragon_movement", false)
168169
.put("mixin.perf.clear_mixin_classinfo", false)
169170
.put("mixin.perf.deduplicate_climate_parameters", false)
170171
.put("mixin.bugfix.packet_leak", false)

common/src/main/java/org/embeddedt/modernfix/world/IntegratedWatchdog.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public void run() {
3737
if(!lastTickStart.isPresent()) {
3838
return;
3939
}
40+
if(lastTickStart.getAsLong() < 0) {
41+
continue;
42+
}
4043
long curTime = Util.getMillis();
4144
long delta = curTime - lastTickStart.getAsLong();
4245
if(delta > MAX_TICK_DELTA) {

common/src/main/resources/assets/modernfix/lang/en_us.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,6 @@
132132
"modernfix.option.mixin.feature.stalled_chunk_load_detection": "This option may help to detect the cause of chunkloading freezes. However, leaving it enabled may cause slightly worse performance.",
133133
"modernfix.option.mixin.perf.fix_loop_spin_waiting": "Fixes Minecraft's built-in wait function consuming excessive amounts of CPU resources.",
134134
"modernfix.option.mixin.perf.forge_cap_retrieval": "Small micro-optimization that makes retrieving custom entity data slightly more efficient on Forge.",
135-
"modernfix.option.mixin.perf.forge_registry_lambda": "Fixes oversights in Forge that lead to excessive allocation in hot registry methods."
135+
"modernfix.option.mixin.perf.forge_registry_lambda": "Fixes oversights in Forge that lead to excessive allocation in hot registry methods.",
136+
"modernfix.option.mixin.bugfix.restore_old_dragon_movement": "Fixes MC-272431, which tracks the ender dragon being unable to dive to the portal as it did in 1.13 and older. This causes the dragon to fly quite a bit differently from what modern players are used to and also patches out one-cycling, so it's not enabled by default. Thanks to Jukitsu for identifying the regression in the vanilla code."
136137
}

0 commit comments

Comments
 (0)