-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Unfinished WoodSet implementation
- Loading branch information
1 parent
b902e96
commit 4b5b07a
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.zepalesque.zenith.api; | ||
|
||
import net.neoforged.neoforge.client.model.generators.BlockStateProvider; | ||
import net.neoforged.neoforge.client.model.generators.ItemModelProvider; | ||
import net.neoforged.neoforge.common.data.LanguageProvider; | ||
|
||
/** | ||
* A set of auto-datagenned blocks. Not to be confused with {@link net.minecraft.world.level.block.state.properties.BlockSetType}! | ||
*/ | ||
public interface BlockSet { | ||
|
||
/** | ||
* Generate blockstate files and block models for this BlockSet | ||
* @param data the {@link BlockStateProvider} used | ||
*/ | ||
void blockGen(BlockStateProvider data); | ||
|
||
/** | ||
* Generate item models for this BlockSet | ||
* @param data the {@link ItemModelProvider} used | ||
*/ | ||
void itemGen(ItemModelProvider data); | ||
|
||
/** | ||
* Generate language data for this BlockSet | ||
* @param data the {@link LanguageProvider} used | ||
*/ | ||
void langGen(LanguageProvider data); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package net.zepalesque.zenith.api; | ||
|
||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.SoundType; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties; | ||
import net.minecraft.world.level.block.RotatedPillarBlock; | ||
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; | ||
import net.minecraft.world.level.material.MapColor; | ||
import net.neoforged.neoforge.client.model.generators.BlockStateProvider; | ||
import net.neoforged.neoforge.client.model.generators.ItemModelProvider; | ||
import net.neoforged.neoforge.common.data.LanguageProvider; | ||
import net.neoforged.neoforge.registries.DeferredBlock; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
public class WoodSet implements BlockSet { | ||
|
||
public final DeferredBlock<Block> log; | ||
|
||
public WoodSet(DeferredRegister.Blocks registry, String id, MapColor barkColor, MapColor woodColor, SoundType soundType) { | ||
|
||
this.log = generateLog(registry, id, barkColor, woodColor, soundType); | ||
|
||
} | ||
|
||
protected DeferredBlock<Block> generateLog(DeferredRegister.Blocks registry, String id, MapColor barkColor, MapColor woodColor, SoundType soundType) { | ||
return registry.register(id, () -> new RotatedPillarBlock(Properties.of() | ||
.mapColor(p_152624_ -> p_152624_.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y ? woodColor : barkColor) | ||
.instrument(NoteBlockInstrument.BASS) | ||
.strength(2.0F) | ||
.sound(soundType) | ||
.ignitedByLava() | ||
)); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
@Override | ||
public void blockGen(BlockStateProvider data) { | ||
|
||
} | ||
|
||
@Override | ||
public void itemGen(ItemModelProvider data) { | ||
|
||
} | ||
|
||
@Override | ||
public void langGen(LanguageProvider data) { | ||
|
||
} | ||
} |