Skip to content

Commit

Permalink
feat: Wood set progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed May 24, 2024
1 parent 8496211 commit bfa35a4
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 36 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ aether_version=1.20.4-1.4.1-neoforge
nitrogen_version=1.20.4-1.1.4-neoforge
cumulus_version=1.20.4-1.0.1-neoforge
curios_version=7.3.4
zenith_version=1.20.4-1.0.6-neoforge
zenith_version=1.20.4-1.0.9-neoforge
aeroblender_version=5271794
terrablender_version=1.20.4-3.3.0.12
terrablender_version_minimum=1.20.4-3.3.0.0
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/zepalesque/redux/Redux.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package net.zepalesque.redux;

import com.aetherteam.aether.data.generators.AetherBlockStateData;
import com.aetherteam.aether.data.generators.AetherItemModelData;
import com.aetherteam.aether.data.generators.AetherLanguageData;
import com.mojang.logging.LogUtils;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
Expand All @@ -16,6 +18,8 @@
import net.zepalesque.redux.block.ReduxBlocks;
import net.zepalesque.redux.config.ReduxConfig;
import net.zepalesque.redux.data.gen.ReduxBlockStateGen;
import net.zepalesque.redux.data.gen.ReduxItemModelGen;
import net.zepalesque.redux.data.gen.ReduxLanguageGen;
import net.zepalesque.redux.entity.ReduxEntities;
import net.zepalesque.redux.item.ReduxItems;
import net.zepalesque.redux.tile.ReduxTiles;
Expand Down Expand Up @@ -55,6 +59,8 @@ private void dataSetup(GatherDataEvent event) {

// Client Data
generator.addProvider(event.includeClient(), new ReduxBlockStateGen(packOutput, fileHelper));
generator.addProvider(event.includeClient(), new ReduxItemModelGen(packOutput, fileHelper));
generator.addProvider(event.includeClient(), new ReduxLanguageGen(packOutput));
}

public static ResourceLocation loc(String path) {
Expand Down

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelGen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package net.zepalesque.redux.data.gen;

import net.minecraft.data.PackOutput;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.block.ReduxBlocks;
import net.zepalesque.redux.data.prov.ReduxItemModelProvider;

public class ReduxItemModelGen extends ReduxItemModelProvider {

public ReduxItemModelGen(PackOutput output, ExistingFileHelper helper) {
super(output, Redux.MODID, helper);
}

@Override
protected void registerModels() {
itemBlockFlatCustomTexture(ReduxBlocks.SHORT_AETHER_GRASS, "natural/aether_medium_grass");
}
}
17 changes: 17 additions & 0 deletions src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageGen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package net.zepalesque.redux.data.gen;

import net.minecraft.data.PackOutput;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.data.prov.ReduxLanguageProvider;

public class ReduxLanguageGen extends ReduxLanguageProvider {

public ReduxLanguageGen(PackOutput output) {
super(output, Redux.MODID);
}

@Override
protected void addTranslations() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.zepalesque.redux.block.state.ReduxStates;

public abstract class ReduxBlockStateProvider extends AetherBlockStateProvider {

public ReduxBlockStateProvider(PackOutput output, String id, ExistingFileHelper helper) {
super(output, id, helper);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package net.zepalesque.redux.data.prov;

import com.aetherteam.aether.data.providers.AetherItemModelProvider;
import net.minecraft.data.PackOutput;
import net.minecraft.world.level.block.Block;
import net.neoforged.neoforge.client.model.generators.ItemModelBuilder;
import net.neoforged.neoforge.common.data.ExistingFileHelper;

import java.util.function.Supplier;

public abstract class ReduxItemModelProvider extends AetherItemModelProvider {

public ReduxItemModelProvider(PackOutput output, String id, ExistingFileHelper helper) {
super(output, id, helper);
}

public ItemModelBuilder itemBlockFlat(Supplier<? extends Block> block, String location) {
return withExistingParent(blockName(block.get()), mcLoc("item/generated"))
.texture("layer0", texture(blockName(block.get()), location));
}

public ItemModelBuilder itemBlockFlatCustomTexture(Supplier<? extends Block> block, String locationPlusName) {
return withExistingParent(blockName(block.get()), mcLoc("item/generated"))
.texture("layer0", texture(locationPlusName));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package net.zepalesque.redux.data.prov;

import com.aetherteam.aether.data.providers.AetherLanguageProvider;
import net.minecraft.data.PackOutput;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredItem;
import net.zepalesque.zenith.util.DatagenUtil;

public abstract class ReduxLanguageProvider extends AetherLanguageProvider {
public ReduxLanguageProvider(PackOutput output, String id) {
super(output, id);
}

public void add(DeferredItem<? extends Item> key) {
this.addItem(key, DatagenUtil.getNameLocalized(key));
}

public void add(DeferredBlock<? extends Block> key) {
this.addBlock(key, DatagenUtil.getNameLocalized(key));
}

public void add(DeferredHolder<EntityType<?>, ? extends EntityType<?>> key) {
this.addEntityType(key, DatagenUtil.getNameLocalized(key));
}
}

0 comments on commit bfa35a4

Please sign in to comment.