Skip to content

Commit

Permalink
Using datagenerator for block and item models & blockstates as well a…
Browse files Browse the repository at this point in the history
…s starting ItemTags
  • Loading branch information
Leronus committed Jan 29, 2024
1 parent 7dbbf04 commit 8c80428
Show file tree
Hide file tree
Showing 2,983 changed files with 7,599 additions and 31,169 deletions.
39 changes: 31 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ base {
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven {
url = 'https://maven.minecraftforge.net/'
}
maven {
url = "https://api.modrinth.com/maven"
}
maven {
url = "https://maven.kyrptonaught.dev"
}
}

loom {
Expand All @@ -40,11 +44,30 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"



// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

modImplementation "maven.modrinth:sodium:mc1.20.1-0.5.3"
modImplementation "maven.modrinth:lithium:mc1.20.1-0.11.2"

//Iris
modImplementation "maven.modrinth:YL57xq9U:ogjxrwGQ"
//Indium
modImplementation "maven.modrinth:Orvt0mRa:Lue6O9z9"
//EntityCulling
modImplementation "maven.modrinth:NNAgCjsB:BDwHAdWc"
//Continuity
modImplementation "maven.modrinth:1IjD5062:Z9FJWLMt"
// //Bobby
// modImplementation "maven.modrinth:M08ruV16:2cuVyTav"
//Nvidium
modImplementation "maven.modrinth:SfMw2IZN:UO1crPGk"

//CustomPortalAPI
modImplementation 'net.kyrptonaught:customportalapi:0.0.1-beta64-1.20'
include 'net.kyrptonaught:customportalapi:0.0.1-beta64-1.20'

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
}
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ maven_group=mod.leronus.mores
archives_base_name=mores

# Dependencies
fabric_version=0.91.0+1.20.1
fabric_version=0.91.0+1.20.1
sodium_version=mc1.20.1-0.5.3
17 changes: 10 additions & 7 deletions src/main/java/mod/leronus/mores/Mores.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import mod.leronus.mores.blocks.ModBlocks;
import mod.leronus.mores.item.ModItems;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.kyrptonaught.customportalapi.api.CustomPortalBuilder;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -28,16 +31,16 @@ public void onInitialize() {
// ModRecipes.registerRecipes();
// ModTrunkPlacerTypes.register();

// FuelRegistry.INSTANCE.add(ModItems.ANTHRACITE, 200);
FuelRegistry.INSTANCE.add(ModItems.ANTHRACITE, 4000);
// FabricDefaultAttributeRegistry.register(ModEntities.ALLOY_BLOCK, AlloyBlockEntity.createAlloyAttributes());

// ModWorldGeneration.generateModWorldGen();

// CustomPortalBuilder.beginPortal()
// .frameBlock(ModBlocks.RUBY_BLOCK)
// .lightWithItem(ModItems.ANTHRACITE)
// .destDimID(new Identifier(Mores.MOD_ID, "moresdim"))
// .tintColor(0xc76efa)
// .registerPortal();
CustomPortalBuilder.beginPortal()
.frameBlock(ModBlocks.RUBY_BLOCK)
.lightWithItem(ModItems.ANTHRACITE)
.destDimID(new Identifier(Mores.MOD_ID, "reloaded"))
.tintColor(0xc76efa)
.registerPortal();
}
}
12 changes: 12 additions & 0 deletions src/main/java/mod/leronus/mores/MoresClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mod.leronus.mores;

import net.fabricmc.api.ClientModInitializer;

public class MoresClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
// HandledScreens.register(ModScreenHandlers.ALLOY_FURNACE_SCREEN_HANDLER, AlloyFurnaceScreen::new);

// BlockEntityRendererFactories.register(ModBlockEntities.ALLOY_FURNACE_BLOCK_ENTITY, AlloyFurnaceBlockEntityRenderer::new);
}
}
21 changes: 20 additions & 1 deletion src/main/java/mod/leronus/mores/MoresDataGenerator.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
package mod.leronus.mores;

import mod.leronus.mores.datagen.ModItemTagProvider;
import mod.leronus.mores.datagen.ModModelProvider;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
import net.minecraft.registry.RegistryBuilder;
import net.minecraft.registry.RegistryKeys;

public class MoresDataGenerator implements DataGeneratorEntrypoint {
@Override
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();

// pack.addProvider(ModBlockTagProvider::new);
pack.addProvider(ModItemTagProvider::new);
// pack.addProvider(ModBlockLootTableGenerator::new);
pack.addProvider(ModModelProvider::new);
// pack.addProvider(ModRecipeGenerator::new);
// pack.addProvider(ModPaintingVariantTagProvider::new);
// pack.addProvider(ModAdvancementProvider::new);
// pack.addProvider(ModWorldGenerator::new);
}
}

@Override
public void buildRegistry(RegistryBuilder registryBuilder) {
// registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap);
// registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, ModPlacedFeatures::bootstrap);
}
}
49 changes: 49 additions & 0 deletions src/main/java/mod/leronus/mores/datagen/ModItemTagProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package mod.leronus.mores.datagen;

import mod.leronus.mores.item.ModItems;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.ItemTags;

import java.util.concurrent.CompletableFuture;

public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
public ModItemTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
super(output, completableFuture);
}

@Override
protected void configure(RegistryWrapper.WrapperLookup arg) {
getOrCreateTagBuilder(ItemTags.TRIMMABLE_ARMOR)
.add(
ModItems.SILVER_HELMET, ModItems.SILVER_CHESTPLATE, ModItems.SILVER_LEGGINGS, ModItems.SILVER_BOOTS,
ModItems.COPPER_HELMET, ModItems.COPPER_CHESTPLATE, ModItems.COPPER_LEGGINGS, ModItems.COPPER_BOOTS,
ModItems.BRONZE_HELMET, ModItems.BRONZE_CHESTPLATE, ModItems.BRONZE_LEGGINGS, ModItems.BRONZE_BOOTS,
ModItems.TIN_HELMET, ModItems.TIN_CHESTPLATE, ModItems.TIN_LEGGINGS, ModItems.TIN_BOOTS,
ModItems.STERLING_HELMET, ModItems.STERLING_CHESTPLATE, ModItems.STERLING_LEGGINGS, ModItems.STERLING_BOOTS,
ModItems.STEEL_HELMET, ModItems.STEEL_CHESTPLATE, ModItems.STEEL_LEGGINGS, ModItems.STEEL_BOOTS,
ModItems.AMETHYST_HELMET, ModItems.AMETHYST_CHESTPLATE, ModItems.AMETHYST_LEGGINGS, ModItems.AMETHYST_BOOTS,
ModItems.EMERALD_HELMET, ModItems.EMERALD_CHESTPLATE, ModItems.EMERALD_LEGGINGS, ModItems.EMERALD_BOOTS,
ModItems.TOURMALINE_HELMET, ModItems.TOURMALINE_CHESTPLATE, ModItems.TOURMALINE_LEGGINGS, ModItems.TOURMALINE_BOOTS,
ModItems.TOPAZ_HELMET, ModItems.TOPAZ_CHESTPLATE, ModItems.TOPAZ_LEGGINGS, ModItems.TOPAZ_BOOTS,
ModItems.RUBY_HELMET, ModItems.RUBY_CHESTPLATE, ModItems.RUBY_LEGGINGS, ModItems.RUBY_BOOTS,
ModItems.SAPPHIRE_HELMET, ModItems.SAPPHIRE_CHESTPLATE, ModItems.SAPPHIRE_LEGGINGS, ModItems.SAPPHIRE_BOOTS,
ModItems.TANZANITE_HELMET, ModItems.TANZANITE_CHESTPLATE, ModItems.TANZANITE_LEGGINGS, ModItems.TANZANITE_BOOTS,
ModItems.TURQUOISE_HELMET, ModItems.TURQUOISE_CHESTPLATE, ModItems.TURQUOISE_LEGGINGS, ModItems.TURQUOISE_BOOTS,
ModItems.MOISSANITE_HELMET, ModItems.MOISSANITE_CHESTPLATE, ModItems.MOISSANITE_LEGGINGS, ModItems.MOISSANITE_BOOTS,
ModItems.ONYX_HELMET, ModItems.ONYX_CHESTPLATE, ModItems.ONYX_LEGGINGS, ModItems.ONYX_BOOTS,
ModItems.GRAPHENE_HELMET, ModItems.GRAPHENE_CHESTPLATE, ModItems.GRAPHENE_LEGGINGS, ModItems.GRAPHENE_BOOTS
);

// getOrCreateTagBuilder(ItemTags.MUSIC_DISCS)
// .add(ModItems.SWEET_CAROLINE_MUSIC_DISC);

// getOrCreateTagBuilder(ItemTags.IRON_ORES)
// .add(ModBlocks.SILVER_ORE.asItem());
//
// getOrCreateTagBuilder(ItemTags.DIAMOND_ORES)
// .add(ModBlocks.TURQUOISE_ORE.asItem());
//
}
}
Loading

0 comments on commit 8c80428

Please sign in to comment.