Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Oct 26, 2024
1 parent f60aea5 commit 88c5865
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package dev.ithundxr.railwaystweaks.mixin;

import dev.ithundxr.railwaystweaks.mixinsupport.LevelLoadAppliers;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.progress.ChunkProgressListener;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(MinecraftServer.class)
public class MinecraftServerMixin {
@Inject(method = "createLevels", at = @At("HEAD"))
private void railwaysTweaks$setupEntityTypeFilters(ChunkProgressListener listener, CallbackInfo ci) {
LevelLoadAppliers.init();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package dev.ithundxr.railwaystweaks.mixinsupport;

public class LevelLoadAppliers {
private static boolean ran = false;

public static void init() {
if (ran) {
return;
}
ran = true;

FlatBlockstateArray.apply();
}
}
1 change: 1 addition & 0 deletions src/main/resources/railwaystweaks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"mixins": [
"DedicatedServerMixin",
"LevelChunkSectionMixin",
"MinecraftServerMixin",
"ServerPlayerMixin",
"ServerStatusPacketListenerImplMixin",
"compat.appleskin.SyncHandlerMixin",
Expand Down

0 comments on commit 88c5865

Please sign in to comment.