use of net.minecraft.world.level.block.state.properties.AttachFace in project MinecraftForge by MinecraftForge.
the class BlockStateProvider method buttonBlock.
public void buttonBlock(ButtonBlock block, ModelFile button, ModelFile buttonPressed) {
getVariantBuilder(block).forAllStates(state -> {
Direction facing = state.getValue(ButtonBlock.FACING);
AttachFace face = state.getValue(ButtonBlock.FACE);
boolean powered = state.getValue(ButtonBlock.POWERED);
return ConfiguredModel.builder().modelFile(powered ? buttonPressed : button).rotationX(face == AttachFace.FLOOR ? 0 : (face == AttachFace.WALL ? 90 : 180)).rotationY((int) (face == AttachFace.CEILING ? facing : facing.getOpposite()).toYRot()).uvLock(face == AttachFace.WALL).build();
});
}
Aggregations