Skip to content

Commit

Permalink
1. New Datagen System using DataSettings
Browse files Browse the repository at this point in the history
2. Homes* -> SoH*
3. Recipe Fixes
  • Loading branch information
rotgruengelb committed Jul 3, 2024
1 parent 59df8eb commit 6f52613
Show file tree
Hide file tree
Showing 29 changed files with 823 additions and 434 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ base {
}

repositories {
maven {
url "https://maven.rotgruengelb.net/releases"
}
maven { url "https://maven.rotgruengelb.net/releases" }
maven { url "https://maven.terraformersmc.com/" }
mavenCentral()
}

Expand All @@ -28,6 +27,8 @@ dependencies {

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation(annotationProcessor("net.rotgruengelb:nixienaut:${project.nixienaut_version}"))

modRuntimeOnly "dev.emi:emi-fabric:1.1.8+1.20.4"
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package net.rotgruengelb.sweetofhomes;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.client.render.RenderLayer;
import net.rotgruengelb.sweetofhomes.block.SHomesBlocksCollections;
import net.rotgruengelb.sweetofhomes.client.render.entity.ChairEntityRenderer;
import net.rotgruengelb.sweetofhomes.entity.HomesEntities;
import net.rotgruengelb.sweetofhomes.client.render.RenderLayerHandler;
import net.rotgruengelb.sweetofhomes.client.render.entity.SeatEntityRenderer;
import net.rotgruengelb.sweetofhomes.entity.SoHEntities;

public class SweetOfHomesClient implements ClientModInitializer {
@Override
public void onInitializeClient() {

SHomesBlocksCollections.CHAIR_BOCKS.forEach((block) -> BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutout()));
EntityRendererRegistry.register(HomesEntities.CHAIR_ENTITY, ChairEntityRenderer::new); }
EntityRendererRegistry.register(SoHEntities.CHAIR_ENTITY, SeatEntityRenderer::new);
RenderLayerHandler.handelRenderLayers();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package net.rotgruengelb.sweetofhomes.client.render;

import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.minecraft.client.render.RenderLayer;
import net.rotgruengelb.sweetofhomes.datagen.SoHDataGenerator;
import net.rotgruengelb.sweetofhomes.datagen.settings.BlockDataSettings;
import net.rotgruengelb.sweetofhomes.datagen.settings.DataSettings;

public class RenderLayerHandler {

public static void handelRenderLayers() {
for (DataSettings<?> dataSettings : SoHDataGenerator.dataSettings) {
if (dataSettings instanceof BlockDataSettings<?> blockDataSettings) {
switch (blockDataSettings.getRenderLayer()) {
case CUTOUT ->
BlockRenderLayerMap.INSTANCE.putBlock(blockDataSettings.getBlock(), RenderLayer.getCutout());
case TRANSLUCENT ->
BlockRenderLayerMap.INSTANCE.putBlock(blockDataSettings.getBlock(), RenderLayer.getTranslucent());
}
}
}
}
}
23 changes: 15 additions & 8 deletions src/main/java/net/rotgruengelb/sweetofhomes/SweetOfHomes.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package net.rotgruengelb.sweetofhomes;

import net.fabricmc.api.ModInitializer;
import net.rotgruengelb.sweetofhomes.block.HomesBlocks;
import net.rotgruengelb.sweetofhomes.entity.HomesEntities;
import net.rotgruengelb.sweetofhomes.item.HomesItems;
import net.rotgruengelb.sweetofhomes.world.HomesGameRules;
import net.minecraft.util.Identifier;
import net.rotgruengelb.sweetofhomes.block.SoHBlocks;
import net.rotgruengelb.sweetofhomes.entity.SoHEntities;
import net.rotgruengelb.sweetofhomes.item.SoHItems;
import net.rotgruengelb.sweetofhomes.registry.tag.SoHTags;
import net.rotgruengelb.sweetofhomes.world.SoHGameRules;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -15,9 +17,14 @@ public class SweetOfHomes implements ModInitializer {

@Override
public void onInitialize() {
HomesBlocks.registerModBlocks();
HomesItems.registerModItems();
HomesGameRules.registerModGameRules();
HomesEntities.registerModEntities();
SoHBlocks.registerModBlocks();
SoHItems.registerModItems();
SoHGameRules.registerModGameRules();
SoHEntities.registerModEntities();
SoHTags.registerModTags();
}

public static Identifier id(String path) {
return new Identifier(MOD_ID, path);
}
}
134 changes: 0 additions & 134 deletions src/main/java/net/rotgruengelb/sweetofhomes/block/HomesBlocks.java

This file was deleted.

Loading

0 comments on commit 6f52613

Please sign in to comment.