Skip to content

Commit

Permalink
loottable overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
Thepigcat76 committed Oct 4, 2024
1 parent c5ed4b0 commit 576e803
Show file tree
Hide file tree
Showing 27 changed files with 459 additions and 257 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ loader_version_range=[4,)
mod_id=nautec
mod_name=NauTec
mod_license=MIT
mod_version=0.0.9
mod_version=0.1.2
mod_group_id=com.portingdeadmods.nautec
mod_authors=Thepigcat76, Leclowndu93150, Ktpatient, Reclipse, Iglee42
mod_description=Mod for the curseforge 2024 modjam

## Dependency Properties

jei_version = 19.16.4.170
curios_version = 9.0.9
curios_version = 9.0.9
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.1 2024-10-03T12:10:15.5878811 Languages: en_us
9f7f8f34477ebb434059509acb7eaeb6dd166fab assets/nautec/lang/en_us.json
// 1.21.1 2024-10-04T17:50:00.787311498 Languages: en_us
a16a4a6169e79ea1d67ea163a83bde9f46f2e9b3 assets/nautec/lang/en_us.json
2 changes: 1 addition & 1 deletion src/generated/resources/assets/nautec/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"item.nautec.drowned_lungs": "Drowned Lungs",
"item.nautec.eas_bucket": "Electrolyte Algae Serum (EAS) Bucket",
"item.nautec.eas_vial": "Electrolyte Algae Serum (EAS) Vial",
"item.nautec.eldritch_heart": "Eldritch Artifact",
"item.nautec.eldritch_heart": "Eldritch Heart",
"item.nautec.etching_acid_bucket": "Etching Acid Bucket",
"item.nautec.gear": "Gear",
"item.nautec.glass_vial": "Glass Vial",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import java.util.Optional;

public class Deepslate_crystal_geode extends Structure {
public static final MapCodec<Deepslate_crystal_geode> CODEC = RecordCodecBuilder.mapCodec(instance ->
public class DeepslateCrystalGeode extends Structure {
public static final MapCodec<DeepslateCrystalGeode> CODEC = RecordCodecBuilder.mapCodec(instance ->
instance.group(Ruins1.settingsCodec(instance),
StructureTemplatePool.CODEC.fieldOf("start_pool").forGetter(structure -> structure.startPool),
ResourceLocation.CODEC.optionalFieldOf("start_jigsaw_name").forGetter(structure -> structure.startJigsawName),
Expand All @@ -33,7 +33,7 @@ public class Deepslate_crystal_geode extends Structure {
Codec.intRange(1, 128).fieldOf("max_distance_from_center").forGetter(structure -> structure.maxDistanceFromCenter),
DimensionPadding.CODEC.optionalFieldOf("dimension_padding", JigsawStructure.DEFAULT_DIMENSION_PADDING).forGetter(structure -> structure.dimensionPadding),
LiquidSettings.CODEC.optionalFieldOf("liquid_settings", JigsawStructure.DEFAULT_LIQUID_SETTINGS).forGetter(structure -> structure.liquidSettings)
).apply(instance, Deepslate_crystal_geode::new));
).apply(instance, DeepslateCrystalGeode::new));

private final Holder<StructureTemplatePool> startPool;
private final Optional<ResourceLocation> startJigsawName;
Expand All @@ -44,15 +44,15 @@ public class Deepslate_crystal_geode extends Structure {
private final DimensionPadding dimensionPadding;
private final LiquidSettings liquidSettings;

public Deepslate_crystal_geode(StructureSettings config,
Holder<StructureTemplatePool> startPool,
Optional<ResourceLocation> startJigsawName,
int size,
HeightProvider startHeight,
Optional<Heightmap.Types> projectStartToHeightmap,
int maxDistanceFromCenter,
DimensionPadding dimensionPadding,
LiquidSettings liquidSettings)
public DeepslateCrystalGeode(StructureSettings config,
Holder<StructureTemplatePool> startPool,
Optional<ResourceLocation> startJigsawName,
int size,
HeightProvider startHeight,
Optional<Heightmap.Types> projectStartToHeightmap,
int maxDistanceFromCenter,
DimensionPadding dimensionPadding,
LiquidSettings liquidSettings)
{
super(config);
this.startPool = startPool;
Expand Down Expand Up @@ -82,7 +82,7 @@ private static boolean extraSpawningChecks(GenerationContext context) {
@Override
public Optional<GenerationStub> findGenerationPoint(GenerationContext context) {

if (!Deepslate_crystal_geode.extraSpawningChecks(context)) {
if (!DeepslateCrystalGeode.extraSpawningChecks(context)) {
return Optional.empty();
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import java.util.Optional;

public class Stone_crystal_geode extends Structure {
public static final MapCodec<Stone_crystal_geode> CODEC = RecordCodecBuilder.mapCodec(instance ->
public class StoneCrystalGeode extends Structure {
public static final MapCodec<StoneCrystalGeode> CODEC = RecordCodecBuilder.mapCodec(instance ->
instance.group(Ruins1.settingsCodec(instance),
StructureTemplatePool.CODEC.fieldOf("start_pool").forGetter(structure -> structure.startPool),
ResourceLocation.CODEC.optionalFieldOf("start_jigsaw_name").forGetter(structure -> structure.startJigsawName),
Expand All @@ -33,7 +33,7 @@ public class Stone_crystal_geode extends Structure {
Codec.intRange(1, 128).fieldOf("max_distance_from_center").forGetter(structure -> structure.maxDistanceFromCenter),
DimensionPadding.CODEC.optionalFieldOf("dimension_padding", JigsawStructure.DEFAULT_DIMENSION_PADDING).forGetter(structure -> structure.dimensionPadding),
LiquidSettings.CODEC.optionalFieldOf("liquid_settings", JigsawStructure.DEFAULT_LIQUID_SETTINGS).forGetter(structure -> structure.liquidSettings)
).apply(instance, Stone_crystal_geode::new));
).apply(instance, StoneCrystalGeode::new));

private final Holder<StructureTemplatePool> startPool;
private final Optional<ResourceLocation> startJigsawName;
Expand All @@ -44,15 +44,15 @@ public class Stone_crystal_geode extends Structure {
private final DimensionPadding dimensionPadding;
private final LiquidSettings liquidSettings;

public Stone_crystal_geode(Structure.StructureSettings config,
Holder<StructureTemplatePool> startPool,
Optional<ResourceLocation> startJigsawName,
int size,
HeightProvider startHeight,
Optional<Heightmap.Types> projectStartToHeightmap,
int maxDistanceFromCenter,
DimensionPadding dimensionPadding,
LiquidSettings liquidSettings)
public StoneCrystalGeode(Structure.StructureSettings config,
Holder<StructureTemplatePool> startPool,
Optional<ResourceLocation> startJigsawName,
int size,
HeightProvider startHeight,
Optional<Heightmap.Types> projectStartToHeightmap,
int maxDistanceFromCenter,
DimensionPadding dimensionPadding,
LiquidSettings liquidSettings)
{
super(config);
this.startPool = startPool;
Expand Down Expand Up @@ -82,7 +82,7 @@ private static boolean extraSpawningChecks(Structure.GenerationContext context)
@Override
public Optional<Structure.GenerationStub> findGenerationPoint(Structure.GenerationContext context) {

if (!Stone_crystal_geode.extraSpawningChecks(context)) {
if (!StoneCrystalGeode.extraSpawningChecks(context)) {
return Optional.empty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import com.portingdeadmods.nautec.Nautec;
import com.portingdeadmods.nautec.compat.modonomicon.datagen.ModonomiconDatagen;
import com.portingdeadmods.nautec.datagen.loot.BlockLootTableProvider;
import com.portingdeadmods.nautec.datagen.loot.LootModifierProvider;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.minecraft.data.loot.LootTableProvider;
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModList;
Expand All @@ -31,8 +34,8 @@ public static void onGatherData(GatherDataEvent event) {
generator.addProvider(event.includeClient(), new ItemModelProvider(output, existingFileHelper));
generator.addProvider(event.includeClient(), new BlockModelProvider(output, existingFileHelper));
generator.addProvider(event.includeClient(), new RecipesProvider(output, lookupProvider));
generator.addProvider(event.includeServer(), new net.minecraft.data.loot.LootTableProvider(output, Collections.emptySet(), List.of(
new net.minecraft.data.loot.LootTableProvider.SubProviderEntry(LootTableProvider::new, LootContextParamSets.BLOCK)
generator.addProvider(event.includeServer(), new LootTableProvider(output, Collections.emptySet(), List.of(
new LootTableProvider.SubProviderEntry(BlockLootTableProvider::new, LootContextParamSets.BLOCK)
), lookupProvider));
BlockTagProvider blockTagProvider = new BlockTagProvider(output, lookupProvider, existingFileHelper);
generator.addProvider(event.includeClient(), blockTagProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected void addTranslations() {
addItem("cast_iron_nugget", "Cast Iron Nugget");
addItem(LASER_CHANNELING_COIL, "Laser Channeling Coil");
addItem(BURNT_COIL, "Burnt Coil");
addItem(ELDRITCH_HEART, "Eldritch Artifact");
addItem(ELDRITCH_HEART, "Eldritch Heart");
addItem(GUARDIAN_EYE, "Guardian Eye");
addItem(VALVE, "Valve");
add("nautec_guide.desc.0","Nautec's Guide");
Expand Down
Loading

0 comments on commit 576e803

Please sign in to comment.