use of net.minecraftforge.client.model.generators.BlockModelBuilder in project Tropicraft by Tropicraft.
the class TropicraftBlockstateProvider method hugePlant.
private void hugePlant(Supplier<? extends HugePlantBlock> block, ResourceLocation texture, ResourceLocation particle) {
BlockModelBuilder cross = models().withExistingParent(name(block), modBlockLoc("huge_cross")).texture("cross", texture).texture("particle", particle);
getMultipartBuilder(block.get()).part().modelFile(cross).addModel().condition(HugePlantBlock.TYPE, HugePlantBlock.Type.CENTER);
}
use of net.minecraftforge.client.model.generators.BlockModelBuilder in project Tropicraft by Tropicraft.
the class TropicraftBlockstateProvider method propagule.
private void propagule(Supplier<? extends PropaguleBlock> block) {
String name = name(block);
BlockModelBuilder planted = models().cross(name + "_planted", modBlockLoc(name + "_planted"));
BlockModelBuilder hanging = models().cross(name + "_hanging", modBlockLoc(name));
getVariantBuilder(block.get()).partialState().with(PropaguleBlock.PLANTED, false).addModels(new ConfiguredModel(hanging)).partialState().with(PropaguleBlock.PLANTED, true).addModels(new ConfiguredModel(planted));
}
use of net.minecraftforge.client.model.generators.BlockModelBuilder in project Tropicraft by Tropicraft.
the class TropicraftBlockstateProvider method flowerPot.
private void flowerPot(Supplier<? extends FlowerPotBlock> full, Supplier<? extends Block> empty, ResourceLocation particle) {
Block flower = full.get().getContent();
boolean isVanilla = flower.getRegistryName().getNamespace().equals("minecraft");
String parent = flower == Blocks.AIR ? "flower_pot" : !isVanilla ? "flower_pot_cross" : ModelProvider.BLOCK_FOLDER + "/potted_" + name(flower.delegate);
BlockModelBuilder model = models().withExistingParent(name(full), parent).texture("flowerpot", blockTexture(empty)).texture("dirt", mcLoc("block/dirt")).texture("particle", modBlockLoc("bamboo_side"));
if (!isVanilla) {
if (flower instanceof TropicsFlowerBlock) {
model.texture("plant", modLoc(ModelProvider.BLOCK_FOLDER + "/flower/" + name(flower.delegate)));
} else if (flower instanceof TallFlowerBlock) {
model.texture("plant", modLoc(ModelProvider.BLOCK_FOLDER + "/" + name(flower.delegate) + "_top"));
} else {
model.texture("plant", blockTexture(flower));
}
}
simpleBlock(full, model);
}
use of net.minecraftforge.client.model.generators.BlockModelBuilder in project Tropicraft by Tropicraft.
the class TropicraftBlockstateProvider method jigarbovTorch.
private void jigarbovTorch(Supplier<? extends RedstoneTorchBlock> block, JigarbovTorchType type) {
ResourceLocation parent = modBlockLoc("jigarbov_wall_torch");
ResourceLocation etchTexture = modBlockLoc("jigarbov/" + type.getName());
BlockModelBuilder modelLit = models().withExistingParent(name(block), parent).texture("torch", mcLoc("block/redstone_torch")).texture("jigarbov", etchTexture);
BlockModelBuilder modelOff = models().withExistingParent(name(block) + "_off", parent).texture("torch", mcLoc("block/redstone_torch_off")).texture("jigarbov", etchTexture);
getVariantBuilder(block.get()).forAllStates(state -> {
boolean lit = state.getValue(RedstoneTorchBlock.LIT);
Direction facing = state.getValue(RedstoneWallTorchBlock.FACING);
int angle = ((int) facing.toYRot() + 90) % 360;
return ConfiguredModel.builder().modelFile(lit ? modelLit : modelOff).rotationY(angle).build();
});
}
Aggregations