Skip to content

Commit

Permalink
修复dg问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Glyceryl6 committed Aug 18, 2024
1 parent 95eccc9 commit 2f229fb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/main/java/org/hiedacamellia/whispergrove/core/data/Data.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
package org.hiedacamellia.whispergrove.core.data;

import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.data.event.GatherDataEvent;
import org.hiedacamellia.whispergrove.WhisperGrove;
import org.hiedacamellia.whispergrove.core.data.lang.ChineseLanguageProvider;
import org.hiedacamellia.whispergrove.core.data.lang.ClassicalChineseLanguageProvider;
import org.hiedacamellia.whispergrove.core.data.lang.EnglishLanguageProvider;
import org.hiedacamellia.whispergrove.core.data.provider.ModelProvider;
import org.hiedacamellia.whispergrove.core.data.provider.StateProvider;
import org.hiedacamellia.whispergrove.core.data.provider.WGItemModelProvider;
import org.hiedacamellia.whispergrove.core.data.provider.WGBlockStateProvider;
import org.hiedacamellia.whispergrove.core.data.provider.WGRecipeProvider;

@EventBusSubscriber(modid = WhisperGrove.MODID, bus = EventBusSubscriber.Bus.MOD)
public class Data {

@SubscribeEvent
public static void onGatherData(GatherDataEvent event) {
var gen = event.getGenerator();
var packOutput = gen.getPackOutput();
var helper = event.getExistingFileHelper();
gen.addProvider(event.includeClient(), new EnglishLanguageProvider(packOutput));
gen.addProvider(event.includeClient(), new ChineseLanguageProvider(packOutput));
gen.addProvider(event.includeClient(), new ClassicalChineseLanguageProvider(packOutput));
gen.addProvider(event.includeClient(), new ModelProvider(packOutput, helper));
gen.addProvider(event.includeClient(), new StateProvider(packOutput, helper));
gen.addProvider(event.includeClient(), new WGItemModelProvider(packOutput, helper));
gen.addProvider(event.includeClient(), new WGBlockStateProvider(packOutput, helper));
gen.addProvider(event.includeServer(), new WGRecipeProvider(packOutput, event.getLookupProvider()));
}
}

}

0 comments on commit 2f229fb

Please sign in to comment.