-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored GrowthcraftMilk Data Generator
- Loading branch information
Showing
4 changed files
with
25 additions
and
16 deletions.
There are no files selected for viewing
20 changes: 14 additions & 6 deletions
20
...wthcraft/milk/datagen/DataGeneration.java → ...atagen/GrowthcraftMilkDataGenerators.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
package growthcraft.milk.datagen; | ||
|
||
import growthcraft.milk.datagen.loot.GrowthcraftMilkLootTables; | ||
import growthcraft.milk.datagen.providers.GrowthcraftMilkBlockStateProvider; | ||
import growthcraft.milk.datagen.providers.GrowthcraftMilkLootTableProvider; | ||
import growthcraft.milk.init.GrowthcraftMilkItems; | ||
import growthcraft.milk.shared.Reference; | ||
import net.minecraft.data.DataGenerator; | ||
import net.minecraft.data.PackOutput; | ||
import net.minecraftforge.client.event.ModelEvent; | ||
import net.minecraftforge.common.data.ExistingFileHelper; | ||
import net.minecraftforge.data.event.GatherDataEvent; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.fml.common.Mod; | ||
|
||
public class DataGeneration { | ||
public static void generate(GatherDataEvent event) { | ||
@Mod.EventBusSubscriber(modid = Reference.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) | ||
public class GrowthcraftMilkDataGenerators { | ||
|
||
@SubscribeEvent | ||
public static void gatherData(GatherDataEvent event) { | ||
DataGenerator generator = event.getGenerator(); | ||
PackOutput output = generator.getPackOutput(); | ||
ExistingFileHelper helper = event.getExistingFileHelper(); | ||
|
||
generator.addProvider( | ||
event.includeServer(), | ||
new GrowthcraftMilkLootTables(output) | ||
new GrowthcraftMilkLootTableProvider(output) | ||
); | ||
|
||
|
||
generator.addProvider(event.includeClient(), new GrowthcraftMilkBlockStates(output, helper)); | ||
generator.addProvider(event.includeClient(), new GrowthcraftMilkBlockStateProvider(output, helper)); | ||
|
||
} | ||
|
||
//@SubscribeEvent | ||
public static void modelBake(ModelEvent.ModifyBakingResult event) { | ||
GrowthcraftMilkItems.addItemModelProperties(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
...tagen/loot/GrowthcraftMilkLootTables.java → ...ers/GrowthcraftMilkLootTableProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package growthcraft.milk.datagen.loot; | ||
package growthcraft.milk.datagen.providers; | ||
|
||
import growthcraft.milk.datagen.providers.loot.CheeseWheelLootTable; | ||
import net.minecraft.data.PackOutput; | ||
import net.minecraft.data.loot.LootTableProvider; | ||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class GrowthcraftMilkLootTables extends LootTableProvider { | ||
public GrowthcraftMilkLootTables(PackOutput output) { | ||
public class GrowthcraftMilkLootTableProvider extends LootTableProvider { | ||
public GrowthcraftMilkLootTableProvider(PackOutput output) { | ||
super(output, Collections.emptySet(), List.of( | ||
new LootTableProvider.SubProviderEntry(CheeseWheelLoot::new, LootContextParamSets.BLOCK) | ||
new LootTableProvider.SubProviderEntry(CheeseWheelLootTable::new, LootContextParamSets.BLOCK) | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters