Skip to content

Commit

Permalink
Reapply @IThundxr obj model changes to NewModelLoaderTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ApexModder committed Dec 11, 2024
1 parent 9adbf49 commit 0e4ac40
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,16 @@ public ModelGen(PackOutput output) {

@Override
protected void registerModels(BlockModelGenerators blockModels, ItemModelGenerators itemModels) {
createModelAndBlockState(obj_block, "sugar_glider", blockModels);
createModelAndBlockState(obj_block_same_part_names, "sugar_glider_same_part_names", blockModels);
}

private void createModelAndBlockState(DeferredBlock<Block> block, String objModel, BlockModelGenerators blockModels) {
var qrTexture = TextureSlot.create("qr");

blockModels.createHorizontallyRotatedBlock(obj_block.value(), TexturedModel.ORIENTABLE.updateTemplate(template -> template.extend()
blockModels.createHorizontallyRotatedBlock(block.value(), TexturedModel.ORIENTABLE.updateTemplate(template -> template.extend()
.customLoader(ObjModelBuilder::new, loader -> loader
.modelLocation(ResourceLocation.fromNamespaceAndPath("new_model_loader_test", "models/item/sugar_glider.obj"))
.modelLocation(ResourceLocation.fromNamespaceAndPath("new_model_loader_test", "models/item/" + objModel + ".obj"))
.flipV(true))
.requiredTextureSlot(qrTexture)
.build())
Expand All @@ -200,12 +205,12 @@ protected void registerModels(BlockModelGenerators blockModels, ItemModelGenerat

@Override
protected Stream<? extends Holder<Block>> getKnownBlocks() {
return Stream.of(obj_block);
return Stream.of(obj_block, obj_block_same_part_names);
}

@Override
protected Stream<? extends Holder<Item>> getKnownItems() {
return Stream.empty();
return Stream.of(obj_item, obj_item_same_part_names);
}
}
}

0 comments on commit 0e4ac40

Please sign in to comment.