Skip to content

Commit

Permalink
Fix Mixin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Dec 14, 2024
1 parent 74e3cfe commit 3e43a9b
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import it.crystalnest.cobweb.platform.FabricRegistryHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.worldselection.CreateWorldCallback;
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.client.gui.screens.worldselection.WorldCreationContextMapper;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.packs.repository.PackRepository;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -18,14 +15,14 @@
@Mixin(CreateWorldScreen.class)
public abstract class CreateWorldScreenMixin {
/**
* Modifies the {@link PackRepository} variable in the method {@link CreateWorldScreen#openCreateWorldScreen(Minecraft, Screen, Function, WorldCreationContextMapper, ResourceKey, CreateWorldCallback)}.<br>
* Modifies the {@link PackRepository} variable in the method {@link CreateWorldScreen#openFresh(Minecraft, Screen)} )}.<br>
* Registers all dynamic and static data packs to the original repository.
*
* @param repository original {@link PackRepository}.
* @return updated repository.
*/
@ModifyVariable(method = "openFresh", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/worldselection/CreateWorldScreen;createDefaultLoadConfig(Lnet/minecraft/server/packs/repository/PackRepository;Lnet/minecraft/world/level/WorldDataConfiguration;)Lnet/minecraft/server/WorldLoader$InitConfig;"))
private static PackRepository onOpenCreateWorldScreen(PackRepository repository) {
private static PackRepository onOpenFresh(PackRepository repository) {
return FabricRegistryHelper.registerDataPacks(repository);
}
}

0 comments on commit 3e43a9b

Please sign in to comment.