Skip to content

Commit

Permalink
feat: update Bio-Lantern model and add variants
Browse files Browse the repository at this point in the history
Co-authored-by: RhinoW <RhinoWarlord@users.noreply.github.com>
  • Loading branch information
Elenterius and RhinoWarlord committed Jun 16, 2023
1 parent 689a2c1 commit 384b9cd
Show file tree
Hide file tree
Showing 17 changed files with 426 additions and 289 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ private void addBlockTranslations() {
addBlock(ModBlocks.FLESH_SPIKE, "Flesh Spike", "A dangerous spike made of reinforced bone and flesh, colliding with it will hurt. Several spikes can be placed in one spot.");
addBlock(ModBlocks.FLESH_LADDER, "Flesh Ladder", "Ladder mainly made of bones and a little bit of flesh...");
addBlock(ModBlocks.FLESH_PILLAR, "Flesh Pillar", "A Pillar made of bones and flesh.");
addBlock(ModBlocks.BIO_LANTERN, "Bioluminescent Lantern", "Biological light source.");
addBlock(ModBlocks.YELLOW_BIO_LANTERN, "Yellow Bio-Lantern", "Bioluminescent light source.");
addBlock(ModBlocks.BLUE_BIO_LANTERN, "Blue Bio-Lantern", "Bioluminescent light source.");
addBlock(ModBlocks.TENDON_CHAIN, "Tendon Chain", "Chain made of tendons.");

addBlock(ModBlocks.PRIMAL_FLESH, "Primal Flesh Block", "Primitive and pure, you better not touch this with your dirty paws.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ protected void addTables() {
dropSelf(ModBlocks.FLESH_FENCE_GATE.get());
dropSelf(ModBlocks.FLESH_LADDER.get());
dropSelf(ModBlocks.FLESH_PILLAR.get());
dropSelf(ModBlocks.BIO_LANTERN.get());
dropSelf(ModBlocks.YELLOW_BIO_LANTERN.get());
dropSelf(ModBlocks.BLUE_BIO_LANTERN.get());
dropSelf(ModBlocks.TENDON_CHAIN.get());

addCustom(ModBlocks.FLESH_DOOR.get(), ModBlockLoot::createFleshDoorTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ protected void registerStatesAndModels() {

fleshSpikes(ModBlocks.FLESH_SPIKE.get());

bioLantern(ModBlocks.BIO_LANTERN.get());
bioLantern(ModBlocks.YELLOW_BIO_LANTERN.get());
bioLantern(ModBlocks.BLUE_BIO_LANTERN.get());
tendonChain(ModBlocks.TENDON_CHAIN.get());

geckolibModel(ModBlocks.PRIMORDIAL_CRADLE.get(), PRIMAL_PARTICLE_TEXTURE);
Expand Down Expand Up @@ -263,9 +264,12 @@ public void tendonChain(FleshChainBlock block) {
}

public void bioLantern(FleshLanternBlock block) {
ResourceLocation file = blockModel(block);
ModelFile.ExistingModelFile model = models().getExistingFile(file);
ModelFile.ExistingModelFile hangingModel = models().getExistingFile(new ResourceLocation(file.getNamespace(), file.getPath() + "_hanging"));
String path = path(block);
ResourceLocation texture = blockTexture(block);
ResourceLocation template = BiomancyMod.createRL("block/template_bio_lantern");

ModelFile model = models().singleTexture(path, template, texture);
ModelFile hangingModel = models().singleTexture(path + "_hanging", extend(template, "_hanging"), texture);

getVariantBuilder(block)
.forAllStatesExcept(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,15 @@ private void registerBioForgeRecipes(Consumer<FinishedRecipe> consumer) {
.setCategory(ModBioForgeTabs.BLOCKS)
.unlockedBy(ModItems.ELASTIC_FIBERS.get()).save(consumer);

BioForgeRecipeBuilder.create(ModItems.BIO_LANTERN.get())
BioForgeRecipeBuilder.create(ModItems.YELLOW_BIO_LANTERN.get())
.addIngredient(ModItems.BIO_LUMENS.get(), 10)
.addIngredient(Items.YELLOW_DYE, 1)
.addIngredient(ModItems.FLESH_BITS.get(), 2)
.addIngredient(ModItems.ELASTIC_FIBERS.get(), 4)
.setCategory(ModBioForgeTabs.BLOCKS)
.unlockedBy(ModItems.BIO_LUMENS.get()).save(consumer);

BioForgeRecipeBuilder.create(ModItems.BLUE_BIO_LANTERN.get())
.addIngredient(ModItems.BIO_LUMENS.get(), 10)
.addIngredient(ModItems.FLESH_BITS.get(), 2)
.addIngredient(ModItems.ELASTIC_FIBERS.get(), 4)
Expand All @@ -921,6 +929,7 @@ private void registerBioForgeRecipes(Consumer<FinishedRecipe> consumer) {

BioForgeRecipeBuilder.create(Items.SHROOMLIGHT)
.addIngredient(ModItems.BIO_LUMENS.get(), 10)
.addIngredient(Items.YELLOW_DYE, 2)
.addIngredient(ModItems.ORGANIC_MATTER.get(), 4)
.setCategory(ModBioForgeTabs.BLOCKS)
.unlockedBy(Items.SHROOMLIGHT).save(consumer);
Expand Down
6 changes: 4 additions & 2 deletions src/generated/resources/assets/biomancy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@
"block.biomancy.flesh_ladder.tooltip": "Ladder mainly made of bones and a little bit of flesh...",
"block.biomancy.flesh_pillar": "Flesh Pillar",
"block.biomancy.flesh_pillar.tooltip": "A Pillar made of bones and flesh.",
"block.biomancy.bio_lantern": "Bioluminescent Lantern",
"block.biomancy.bio_lantern.tooltip": "Biological light source.",
"block.biomancy.bio_lantern_yellow": "Yellow Bio-Lantern",
"block.biomancy.bio_lantern_yellow.tooltip": "Bioluminescent light source.",
"block.biomancy.bio_lantern_blue": "Blue Bio-Lantern",
"block.biomancy.bio_lantern_blue.tooltip": "Bioluminescent light source.",
"block.biomancy.tendon_chain": "Tendon Chain",
"block.biomancy.tendon_chain.tooltip": "Chain made of tendons.",
"block.biomancy.primal_flesh": "Primal Flesh Block",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static void handleMissingBlocks(List<Mapping<Block>> mappings) {
for (Mapping<Block> mapping : mappings) {
String path = mapping.getKey().getPath();
switch (path) {
case "bio_lantern" -> mapping.remap(ModBlocks.YELLOW_BIO_LANTERN.get());
case "bone_spike" -> mapping.remap(ModBlocks.FLESH_SPIKE.get());
case "creator" -> mapping.remap(ModBlocks.PRIMORDIAL_CRADLE.get());
case "flesh_block" -> mapping.remap(ModBlocks.FLESH.get());
Expand Down Expand Up @@ -92,6 +93,7 @@ public static void handleMissingItems(List<Mapping<Item>> mappings) {
switch (path) {
case "mascot_pattern", "mascot_outline_pattern", "mascot_accent_pattern" -> mapping.remap(ModItems.MASCOT_BANNER_PATTERNS.get());

case "bio_lantern" -> mapping.remap(ModItems.YELLOW_BIO_LANTERN.get());
case "glass_vial" -> mapping.remap(ModItems.VIAL.get());

case "creator" -> mapping.remap(ModItems.PRIMORDIAL_CRADLE.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public final class ModBlocks {
public static final RegistryObject<FleshDoorBlock> FLESH_DOOR = register("flesh_door", FleshDoorBlock::new);
public static final RegistryObject<FullFleshDoorBlock> FULL_FLESH_DOOR = register("full_flesh_door", FullFleshDoorBlock::new);
public static final RegistryObject<FleshSpikeBlock> FLESH_SPIKE = register("flesh_spike", () -> new FleshSpikeBlock(createFleshyBoneProperties().noOcclusion()));
public static final RegistryObject<FleshLanternBlock> BIO_LANTERN = register("bio_lantern", properties -> new FleshLanternBlock(properties.sound(SoundType.SHROOMLIGHT).lightLevel(x -> 15).noOcclusion()));
public static final RegistryObject<FleshLanternBlock> YELLOW_BIO_LANTERN = register("bio_lantern_yellow", properties -> new FleshLanternBlock(properties.sound(SoundType.SHROOMLIGHT).lightLevel(x -> 15).noOcclusion()));
public static final RegistryObject<FleshLanternBlock> BLUE_BIO_LANTERN = register("bio_lantern_blue", properties -> new FleshLanternBlock(properties.sound(SoundType.SHROOMLIGHT).lightLevel(x -> 15).noOcclusion()));
public static final RegistryObject<FleshChainBlock> TENDON_CHAIN = register("tendon_chain", properties -> new FleshChainBlock(properties.noOcclusion()));

private ModBlocks() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public final class ModItems {
public static final RegistryObject<SimpleBlockItem> FLESH_DOOR = registerSimpleBlockItem(ModBlocks.FLESH_DOOR);
public static final RegistryObject<SimpleBlockItem> FULL_FLESH_DOOR = registerSimpleBlockItem(ModBlocks.FULL_FLESH_DOOR);
public static final RegistryObject<SimpleBlockItem> FLESH_SPIKE = registerSimpleBlockItem(ModBlocks.FLESH_SPIKE);
public static final RegistryObject<SimpleBlockItem> BIO_LANTERN = registerSimpleBlockItem(ModBlocks.BIO_LANTERN);
public static final RegistryObject<SimpleBlockItem> YELLOW_BIO_LANTERN = registerSimpleBlockItem(ModBlocks.YELLOW_BIO_LANTERN);
public static final RegistryObject<SimpleBlockItem> BLUE_BIO_LANTERN = registerSimpleBlockItem(ModBlocks.BLUE_BIO_LANTERN);
public static final RegistryObject<FleshChainBlockItem> TENDON_CHAIN = registerBlockItem(ModBlocks.TENDON_CHAIN, FleshChainBlockItem::new);

//# Spawn Eggs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ private static void setBlockRenderLayers() {
ItemBlockRenderTypes.setRenderLayer(ModBlocks.FULL_FLESH_DOOR.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.FLESH_LADDER.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.MALIGNANT_FLESH_VEINS.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.BIO_LANTERN.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.YELLOW_BIO_LANTERN.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.BLUE_BIO_LANTERN.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.TENDON_CHAIN.get(), RenderType.cutout());

//block with "glowing" overlay texture, also needs a overlay model see onModelBakeEvent() in ClientSetupHandler
Expand Down
122 changes: 0 additions & 122 deletions src/main/resources/assets/biomancy/models/block/bio_lantern.json

This file was deleted.

0 comments on commit 384b9cd

Please sign in to comment.