Generate red string blocks' models

This commit is contained in:
Vincent Lee committed 2020-06-29 22:33:10 -05:00
1 parent 967e88e160
commit 78317f6c2a
20 files changed
+66 -62

No files matched your search

@@ -167,7 +167,10 @@ public class BlockstateProvider extends BlockStateProvider {
}
private void redStringBlock(Block b) {
ModelFile file = models().getExistingFile(prefix("block/" + Registry.BLOCK.getKey(b).getPath()));
String name = Registry.BLOCK.getKey(b).getPath();
ResourceLocation selfName = prefix("block/" + name);
ResourceLocation front = prefix("block/red_string_sender");
ModelFile file = models().orientable(name, selfName, front, selfName);
getVariantBuilder(b)
.partialState().with(BlockStateProperties.FACING, Direction.NORTH).setModels(new ConfiguredModel(file))
.partialState().with(BlockStateProperties.FACING, Direction.SOUTH).setModels(new ConfiguredModel(file, 0, 180, false))
@@ -16,6 +16,7 @@ import net.minecraftforge.client.model.generators.ExistingFileHelper;
import vazkii.botania.common.block.BlockSpecialFlower;
import vazkii.botania.common.block.decor.BlockFloatingFlower;
import vazkii.botania.common.block.string.BlockRedString;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
@@ -37,7 +38,7 @@ public class ItemModelProvider extends net.minecraftforge.client.model.generator
String name = Registry.ITEM.getKey(i).getPath();
if (b instanceof BlockSpecialFlower) {
withExistingParent(name, "item/generated").texture("layer0", prefix("block/" + name));
} else if (b instanceof BlockFloatingFlower) {
} else if (b instanceof BlockFloatingFlower || b instanceof BlockRedString) {
withExistingParent(name, prefix("block/" + name));
}
}