Skip to content

Commit 6706656

Browse files
committed
Merge remote-tracking branch 'origin/1.20' into 1.21.1
2 parents db5363a + e7f86f8 commit 6706656

File tree

7 files changed

+37
-82
lines changed

7 files changed

+37
-82
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "architectury-plugin" version "3.4-SNAPSHOT"
3-
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
3+
id "dev.architectury.loom" version "1.9-SNAPSHOT" apply false
44
id "maven-publish"
55
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
66
id 'com.palantir.git-version' version '1.0.0'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.embeddedt.modernfix.common.mixin.bugfix.chunk_deadlock;
2+
3+
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
4+
import net.minecraft.core.Holder;
5+
import net.minecraft.server.level.ServerLevel;
6+
import net.minecraft.world.entity.Entity;
7+
import net.minecraft.world.level.gameevent.GameEvent;
8+
import org.embeddedt.modernfix.ModernFix;
9+
import org.spongepowered.asm.mixin.Mixin;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
12+
@Mixin(Entity.class)
13+
public class EntityMixin {
14+
/**
15+
* @author embeddedt
16+
* @reason When an entity is added to the world via the worldgen load path (ChunkMap#postLoadProtoChunk calling
17+
* ServerLevel#addWorldGenChunkEntities), attempts to add a passenger result in a deadlock when the sculk event
18+
* tries to raytrace blocks. To fix this, we skip firing the sculk event if the chunk the entity is within is not
19+
* loaded.
20+
*/
21+
@WrapWithCondition(method = "addPassenger", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;gameEvent(Lnet/minecraft/core/Holder;Lnet/minecraft/world/entity/Entity;)V"))
22+
private boolean onlyAddIfSelfChunkLoaded(Entity instance, Holder<GameEvent> gameEvent, Entity entity) {
23+
var chunkPos = instance.chunkPosition();
24+
if (instance.level() instanceof ServerLevel serverLevel && serverLevel.getChunkSource().getChunkNow(chunkPos.x, chunkPos.z) == null) {
25+
ModernFix.LOGGER.warn("Skipped emitting ENTITY_MOUNT game event for entity {} as it would cause deadlock", instance.toString());
26+
return false;
27+
} else {
28+
return true;
29+
}
30+
}
31+
}

fabric/src/main/java/org/embeddedt/modernfix/ModernFixPreLaunchFabric.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import net.fabricmc.loader.impl.gui.FabricGuiEntry;
66
import net.fabricmc.loader.impl.gui.FabricStatusTree;
77
import org.embeddedt.modernfix.core.ModernFixMixinPlugin;
8-
import org.embeddedt.modernfix.fabric.mappings.MappingsClearer;
98
import org.embeddedt.modernfix.spark.SparkLaunchProfiler;
109
import org.embeddedt.modernfix.util.CommonModUtil;
1110

@@ -19,9 +18,6 @@ public void onPreLaunch() {
1918
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.spark_profile_launch.OnFabric")) {
2019
CommonModUtil.runWithoutCrash(() -> SparkLaunchProfiler.start("launch"), "Failed to start profiler");
2120
}
22-
if(ModernFixMixinPlugin.instance.isOptionEnabled("perf.clear_fabric_mapping_tables.MappingsClearer")) {
23-
MappingsClearer.clear();
24-
}
2521

2622
// Prevent launching with Continuity when dynamic resources is on
2723
if(false && ModernFixMixinPlugin.instance.isOptionEnabled("perf.dynamic_resources.ContinuityCheck")

fabric/src/main/java/org/embeddedt/modernfix/fabric/mappings/MappingsClearer.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

fabric/src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
],
4343
"depends": {
4444
"minecraft": ">=1.16.2",
45-
"fabricloader": ">=0.15.0"
45+
"fabricloader": ">=0.16.10"
4646
},
4747
"breaks": {
4848
"dashloader": "<5.0.0-beta.1"

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
org.gradle.jvmargs=-Xmx2G
33

44
junit_version=5.10.0-M1
5-
mixinextras_version=0.3.2
5+
mixinextras_version=0.4.1
66

77
mod_id=modernfix
88
minecraft_version=1.21.1
@@ -19,7 +19,7 @@ kubejs_version=1902.6.0-build.142
1919
rhino_version=1902.2.2-build.268
2020
supported_minecraft_versions=1.21.1
2121

22-
fabric_loader_version=0.15.11
22+
fabric_loader_version=0.16.10
2323
fabric_api_version=0.102.1+1.21.1
2424

2525
continuity_version=3.0.0-beta.4+1.20.2
@@ -29,7 +29,7 @@ diagonal_fences_version=4558828
2929

3030
spark_version=5759671
3131

32-
use_fabric_api_at_runtime=false
32+
use_fabric_api_at_runtime=true
3333

3434
# Look up maven coordinates when changing shadow_version
3535
shadow_version=7.1.2

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)