Skip to content

Commit

Permalink
Fix mistake with passing the wrong PackType for the AddPackFindersEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon-Seeker committed Nov 11, 2024
1 parent 65ae246 commit fdbc057
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ private void onCreate(CallbackInfo ci) {

@Inject(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 void aetherFabric$addClientPackResources(Minecraft minecraft, Screen lastScreen, CallbackInfo ci, @Local() PackRepository repository) {
AddPackFindersEvent.invokeEvent(PackType.CLIENT_RESOURCES, repository);
AddPackFindersEvent.invokeEvent(PackType.SERVER_DATA, repository);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public abstract class ServerPacksSourceMixin {

@Inject(method = "createPackRepository(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;)Lnet/minecraft/server/packs/repository/PackRepository;", at = @At("RETURN"))
private static void aetherFabric$addServerPackResources(LevelStorageSource.LevelStorageAccess level, CallbackInfoReturnable<PackRepository> cir) {
AddPackFindersEvent.invokeEvent(PackType.CLIENT_RESOURCES, cir.getReturnValue());
AddPackFindersEvent.invokeEvent(PackType.SERVER_DATA, cir.getReturnValue());
}

@Inject(method = "createVanillaTrustedRepository", at = @At("RETURN"))
private static void aetherFabric$addServerPackResourcesVanilla(CallbackInfoReturnable<PackRepository> cir) {
AddPackFindersEvent.invokeEvent(PackType.SERVER_DATA, cir.getReturnValue());
}
}

0 comments on commit fdbc057

Please sign in to comment.