Actually make metal beams behave like pillars
This commit is contained in:
parent
e6203e11b5
commit
c5313d405b
@ -107,6 +107,11 @@ object DataGen {
|
|||||||
blockStateProvider.simpleBlockM(block)
|
blockStateProvider.simpleBlockM(block)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun decorativePillar(block: Block, side: String, top: String) {
|
||||||
|
blockModelProvider.decorativeColumn(block, side, top)
|
||||||
|
blockStateProvider.simplePillar(block)
|
||||||
|
}
|
||||||
|
|
||||||
fun stairs(block: StairBlock, side: String, top: String) {
|
fun stairs(block: StairBlock, side: String, top: String) {
|
||||||
blockStateProvider.exec {
|
blockStateProvider.exec {
|
||||||
blockStateProvider.stairsBlock(block, modLocation(side), modLocation(top), modLocation(top))
|
blockStateProvider.stairsBlock(block, modLocation(side), modLocation(top), modLocation(top))
|
||||||
|
@ -192,7 +192,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
|
|||||||
}
|
}
|
||||||
|
|
||||||
DataGen.decorativeCubeAll(MBlocks.DANGER_STRIPE_BLOCK)
|
DataGen.decorativeCubeAll(MBlocks.DANGER_STRIPE_BLOCK)
|
||||||
DataGen.decorativeColumn(MBlocks.METAL_BEAM, "metal_beam_side", "metal_beam_top")
|
DataGen.decorativePillar(MBlocks.METAL_BEAM, "metal_beam_side", "metal_beam_top")
|
||||||
|
|
||||||
var labLampOn: BlockModelBuilder? = null
|
var labLampOn: BlockModelBuilder? = null
|
||||||
var labLampOff: BlockModelBuilder? = null
|
var labLampOff: BlockModelBuilder? = null
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package ru.dbotthepony.mc.otm.datagen.blocks
|
package ru.dbotthepony.mc.otm.datagen.blocks
|
||||||
|
|
||||||
|
import net.minecraft.core.Direction
|
||||||
import net.minecraft.world.level.block.Block
|
import net.minecraft.world.level.block.Block
|
||||||
|
import net.minecraft.world.level.block.RotatedPillarBlock
|
||||||
import net.minecraft.world.level.block.state.BlockState
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
import net.minecraftforge.client.model.generators.BlockStateProvider
|
import net.minecraftforge.client.model.generators.BlockStateProvider
|
||||||
import net.minecraftforge.client.model.generators.ConfiguredModel
|
import net.minecraftforge.client.model.generators.ConfiguredModel
|
||||||
@ -10,10 +12,10 @@ import ru.dbotthepony.mc.otm.core.getValueNullable
|
|||||||
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
|
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
|
||||||
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth
|
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth
|
||||||
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
|
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
|
||||||
import ru.dbotthepony.mc.otm.datagen.DataGen
|
|
||||||
import ru.dbotthepony.mc.otm.core.registryName
|
import ru.dbotthepony.mc.otm.core.registryName
|
||||||
|
import ru.dbotthepony.mc.otm.datagen.DataGen
|
||||||
import ru.dbotthepony.mc.otm.datagen.modLocation
|
import ru.dbotthepony.mc.otm.datagen.modLocation
|
||||||
import java.util.LinkedList
|
import java.util.*
|
||||||
|
|
||||||
typealias BlockStateTransform = (state: BlockState, builder: ConfiguredModel.Builder<*>, path: String) -> String?
|
typealias BlockStateTransform = (state: BlockState, builder: ConfiguredModel.Builder<*>, path: String) -> String?
|
||||||
private val EMPTY: BlockStateTransform = { _, _, _ -> null }
|
private val EMPTY: BlockStateTransform = { _, _, _ -> null }
|
||||||
@ -95,6 +97,22 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun simplePillar(vararg blocks: Block): MatteryBlockStateProvider {
|
||||||
|
for (block in blocks) {
|
||||||
|
exec {
|
||||||
|
getVariantBuilder(block)
|
||||||
|
.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.Y)
|
||||||
|
.modelForState().modelFile(models().getExistingFile(block.registryName)).addModel()
|
||||||
|
.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.Z)
|
||||||
|
.modelForState().modelFile(models().getExistingFile(block.registryName)).rotationX(90).addModel()
|
||||||
|
.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.X)
|
||||||
|
.modelForState().modelFile(models().getExistingFile(block.registryName)).rotationX(90).rotationY(90).addModel()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
fun simpleBlockM(blocks: Collection<Block>): MatteryBlockStateProvider {
|
fun simpleBlockM(blocks: Collection<Block>): MatteryBlockStateProvider {
|
||||||
blocks.forEach(this::simpleBlockM)
|
blocks.forEach(this::simpleBlockM)
|
||||||
return this
|
return this
|
||||||
|
Loading…
Reference in New Issue
Block a user