Skip to content

Commit

Permalink
fix(1.20.6): Fix toaster model
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed May 25, 2024
1 parent f8a5848 commit e92e60f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
{
"variants": {
"facing=east": {
"active=false,facing=east": {
"model": "cookingforblockheads:block/toaster",
"y": 90
},
"facing=north": {
"active=false,facing=north": {
"model": "cookingforblockheads:block/toaster"
},
"facing=south": {
"active=false,facing=south": {
"model": "cookingforblockheads:block/toaster",
"y": 180
},
"facing=west": {
"active=false,facing=west": {
"model": "cookingforblockheads:block/toaster",
"y": 270
},
"active=true,facing=east": {
"model": "cookingforblockheads:block/toaster_active",
"y": 90
},
"active=true,facing=north": {
"model": "cookingforblockheads:block/toaster_active"
},
"active=true,facing=south": {
"model": "cookingforblockheads:block/toaster_active",
"y": 180
},
"active=true,facing=west": {
"model": "cookingforblockheads:block/toaster_active",
"y": 270
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ public static void initialize(BalmModels models) {
cabinetDoorsFlipped.add(color.getId() + 1, models.loadModel(id("block/" + colorPrefix + "cabinet_door_flipped")));
}

// ResourceLocation toasterModel = id("block/toaster");
// ResourceLocation toasterActiveModel = id("block/toaster_active");
// models.overrideModel(() -> ModBlocks.toaster,
// models.loadDynamicModel(id("block/toaster"),
// Set.of(toasterModel, toasterActiveModel),
// it -> it.getValue(ToasterBlock.ACTIVE) ? toasterActiveModel : toasterModel,
// null,
// ModModels::lowerableFacingTransforms)::get);

// ResourceLocation fridgeSmallModel = id("block/fridge");
// ResourceLocation fridgeLargeLowerModel = id("block/fridge_large_lower");
// ResourceLocation fridgeLargeUpperModel = id("block/fridge_large_upper");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package net.blay09.mods.cookingforblockheads.fabric.datagen;

import net.blay09.mods.cookingforblockheads.CookingForBlockheads;
import net.blay09.mods.cookingforblockheads.block.DyedConnectorBlock;
import net.blay09.mods.cookingforblockheads.block.ModBlocks;
import net.blay09.mods.cookingforblockheads.block.OvenBlock;
import net.blay09.mods.cookingforblockheads.block.SinkBlock;
import net.blay09.mods.cookingforblockheads.block.*;
import net.blay09.mods.cookingforblockheads.item.ModItems;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider;
Expand Down Expand Up @@ -98,7 +95,12 @@ public void generateBlockStateModels(BlockModelGenerators blockStateModelGenerat
for (final var oven : ModBlocks.ovens) {
createOvenBlock(blockStateModelGenerator, oven);
}
blockStateModelGenerator.createNonTemplateHorizontalBlock(ModBlocks.toaster); // TODO active state
final var toasterModel = new ResourceLocation(CookingForBlockheads.MOD_ID, "block/toaster");
final var toasterModelActive = new ResourceLocation(CookingForBlockheads.MOD_ID, "block/toaster_active");
blockStateModelGenerator.blockStateOutput.accept(MultiVariantGenerator.multiVariant(ModBlocks.toaster)
.with(createBooleanModelDispatch(ToasterBlock.ACTIVE, toasterModelActive, toasterModel))
.with(createHorizontalFacingDispatch()));

blockStateModelGenerator.createNonTemplateHorizontalBlock(ModBlocks.milkJar);
blockStateModelGenerator.createNonTemplateHorizontalBlock(ModBlocks.cowJar);
blockStateModelGenerator.createNonTemplateHorizontalBlock(ModBlocks.fruitBasket);
Expand Down

0 comments on commit e92e60f

Please sign in to comment.