Skip to content

Commit

Permalink
1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthian committed Sep 21, 2023
1 parent 3f391a8 commit e31baee
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 34 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
org.gradle.jvmargs=-Xmx4G
org.gradle.parallel=true

minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.1
loader_version=0.14.22

#Fabric api
fabric_version=0.88.1+1.20.1
fabric_version=0.89.0+1.20.2

# Mod Properties
mod_version=6.2
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/xanthian/variantcraftingtables/Initialise.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public void onInitialize() {
ModCreativeTab.registerItemGroup();

// Datagen Block - disable for client run
//SnifferPlus.registerTables();
//RegionsUnexplored.register04Tables();
//NaturesSpirit.registerTables();
//DeeperAndDarker.registerTables();
//AdAstra.registerTables();
SnifferPlus.registerTables();
RegionsUnexplored.register04Tables();
NaturesSpirit.registerTables();
DeeperAndDarker.registerTables();
AdAstra.registerTables();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;

import net.fabricmc.fabric.api.resource.conditions.v1.ConditionJsonProvider;
import net.fabricmc.fabric.api.resource.conditions.v1.DefaultResourceConditions;
import net.fabricmc.fabric.impl.datagen.FabricDataGenHelper;

import net.minecraft.block.Block;
import net.minecraft.loot.LootTable;

import net.xanthian.variantcraftingtables.block.Vanilla;
import net.xanthian.variantcraftingtables.block.compatability.*;

import java.util.List;

public class LootTableGenerator extends FabricBlockLootTableProvider {
public LootTableGenerator(FabricDataOutput dataOutput) {
super(dataOutput);
Expand All @@ -29,54 +23,49 @@ public void generate() {

// Ad Astra
for (Block table : AdAstra.AA_TABLES.values()) {
addDrop(table, (Block block) -> this.addConditions(drops(block), List.of(DefaultResourceConditions.allModsLoaded("ad_astra"))));
withConditions(DefaultResourceConditions.allModsLoaded("ad_astra")).addDrop(table, this::drops);
}

// Beach Party (Lets Do)
addDrop(BeachParty.LDBP_PALM_CRAFTING_TABLE, addConditions(drops(BeachParty.LDBP_PALM_CRAFTING_TABLE), List.of(DefaultResourceConditions.allModsLoaded("beachparty"))));
withConditions(DefaultResourceConditions.allModsLoaded("beachparty")).addDrop(BeachParty.LDBP_PALM_CRAFTING_TABLE);

// Better Archeology
addDrop(BetterArcheology.BA_ROTTEN_CRAFTING_TABLE, addConditions(drops(BetterArcheology.BA_ROTTEN_CRAFTING_TABLE), List.of(DefaultResourceConditions.allModsLoaded("betterarcheology"))));
withConditions(DefaultResourceConditions.allModsLoaded("betterarcheology")).addDrop(BetterArcheology.BA_ROTTEN_CRAFTING_TABLE);

// Bewitchment
for (Block table : Bewitchment.BW_TABLES.values()) {
addDrop(table, (Block block) -> this.addConditions(drops(block), List.of(DefaultResourceConditions.allModsLoaded("bewitchment"))));
withConditions(DefaultResourceConditions.allModsLoaded("bewitchment")).addDrop(table, this::drops);
}

// Deeper & Darker
addDrop(DeeperAndDarker.DAD_ECHO_CRAFTING_TABLE, addConditions(drops(DeeperAndDarker.DAD_ECHO_CRAFTING_TABLE), List.of(DefaultResourceConditions.allModsLoaded("deeperdarker"))));
withConditions(DefaultResourceConditions.allModsLoaded("deeperdarker")).addDrop(DeeperAndDarker.DAD_ECHO_CRAFTING_TABLE);

// MineCells
addDrop(MineCells.MC_PUTRID_CRAFTING_TABLE, addConditions(drops(MineCells.MC_PUTRID_CRAFTING_TABLE), List.of(DefaultResourceConditions.allModsLoaded("minecells"))));
withConditions(DefaultResourceConditions.allModsLoaded("minecells")).addDrop(MineCells.MC_PUTRID_CRAFTING_TABLE);

// Natures Spirit
for (Block table : NaturesSpirit.NS_TABLES.values()) {
addDrop(table, (Block block) -> this.addConditions(drops(block), List.of(DefaultResourceConditions.allModsLoaded("natures_spirit"))));
withConditions(DefaultResourceConditions.allModsLoaded("natures_spirit")).addDrop(table, this::drops);
}

// Promenade
for (Block table : Promenade.PROM_TABLES.values()) {
addDrop(table, (Block block) -> this.addConditions(drops(block), List.of(DefaultResourceConditions.allModsLoaded("promenade"))));
withConditions(DefaultResourceConditions.allModsLoaded("promenade")).addDrop(table, this::drops);
}

// Regions Unexplored
for (Block table : RegionsUnexplored.RU_TABLES.values()) {
addDrop(table, (Block block) -> this.addConditions(drops(block), List.of(DefaultResourceConditions.allModsLoaded("regions_unexplored"))));
withConditions(DefaultResourceConditions.allModsLoaded("regions_unexplored")).addDrop(table, this::drops);
}

// SnifferPlus
addDrop(SnifferPlus.SP_STONE_PINE_CRAFTING_TABLE, addConditions(drops(SnifferPlus.SP_STONE_PINE_CRAFTING_TABLE), List.of(DefaultResourceConditions.allModsLoaded("snifferplus"))));
withConditions(DefaultResourceConditions.allModsLoaded("snifferplus")).addDrop(SnifferPlus.SP_STONE_PINE_CRAFTING_TABLE);

// Tech reborn
addDrop(TechReborn.TR_RUBBER_CRAFTING_TABLE, addConditions(drops(TechReborn.TR_RUBBER_CRAFTING_TABLE), List.of(DefaultResourceConditions.allModsLoaded("techreborn"))));
withConditions(DefaultResourceConditions.allModsLoaded("techreborn")).addDrop(TechReborn.TR_RUBBER_CRAFTING_TABLE);

// Vinery (Lets Do)
addDrop(Vinery.LDV_CHERRY_CRAFTING_TABLE, addConditions(drops(Vinery.LDV_CHERRY_CRAFTING_TABLE), List.of(DefaultResourceConditions.allModsLoaded("vinery"))));
withConditions(DefaultResourceConditions.allModsLoaded("vinery")).addDrop(Vinery.LDV_CHERRY_CRAFTING_TABLE);

}
private LootTable.Builder addConditions(LootTable.Builder builder, List<ConditionJsonProvider> conditions) {
if (!conditions.isEmpty())
FabricDataGenHelper.addConditions(builder, conditions.toArray(ConditionJsonProvider[]::new));
return builder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
import net.xanthian.variantcraftingtables.block.compatability.*;
import net.xanthian.variantcraftingtables.util.ModItemTags;

import java.util.function.Consumer;

public class RecipeGenerator extends FabricRecipeProvider {
public RecipeGenerator(FabricDataOutput output) {
super(output);
}

@Override
public void generate(Consumer<RecipeJsonProvider> exporter) {
public void generate(RecipeExporter exporter) {

offer2x2CompactingRecipe(exporter, RecipeCategory.MISC, Vanilla.ACACIA_CRAFTING_TABLE, Items.ACACIA_PLANKS);
offer2x2CompactingRecipe(exporter, RecipeCategory.MISC, Vanilla.BAMBOO_CRAFTING_TABLE, Items.BAMBOO_PLANKS);
Expand Down

0 comments on commit e31baee

Please sign in to comment.