idiot
This commit is contained in:
parent
2d5858bd29
commit
ae840736c7
@ -134,6 +134,11 @@ object DataGen {
|
||||
blockStateProvider.simplePillar(block)
|
||||
}
|
||||
|
||||
fun decorativeLadder(block: Block){
|
||||
blockModelProvider.decorativeLadder(block)
|
||||
blockStateProvider.simpleLadder(block)
|
||||
}
|
||||
|
||||
fun stairs(block: StairBlock, side: String, top: String) {
|
||||
blockStateProvider.exec {
|
||||
blockStateProvider.stairsBlock(block, modLocation(side), modLocation(top), modLocation(top))
|
||||
|
@ -38,6 +38,8 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
|
||||
DataGen.decorativeCubeAllCutout(MBlocks.METAL_MESH)
|
||||
DataGen.decorativePillar(MBlocks.TIRE_BLOCK, "carbon_fibre_block", "tire")
|
||||
|
||||
DataGen.decorativeLadder(MBlocks.INDUSTRIAL_LADDER)
|
||||
|
||||
DataGen.decoratives(MRegistry.TRITANIUM_BLOCK)
|
||||
|
||||
for (color in DyeColor.entries) {
|
||||
@ -260,6 +262,10 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
|
||||
itemModelProvider.block(MItems.LABORATORY_LAMP_INVERTED, MItems.LABORATORY_LAMP.registryName!!.path + "_unlit")
|
||||
itemModelProvider.block(MItems.DANGER_STRIPE_BLOCK, MItems.DANGER_STRIPE_BLOCK.registryName!!.path + "_0")
|
||||
itemModelProvider.block(MItems.METAL_BEAM)
|
||||
|
||||
itemModelProvider.generatedBlockDecorative(MItems.INDUSTRIAL_LADDER)
|
||||
|
||||
|
||||
itemModelProvider.block(MItems.TIRE_BLOCK)
|
||||
|
||||
blockStateProvider.block(MBlocks.METAL_BEAM_CENTER)
|
||||
|
@ -3,11 +3,13 @@ package ru.dbotthepony.mc.otm.datagen.blocks
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.HorizontalDirectionalBlock
|
||||
import net.minecraft.world.level.block.RotatedPillarBlock
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.neoforged.neoforge.client.model.generators.BlockStateProvider
|
||||
import net.neoforged.neoforge.client.model.generators.ConfiguredModel
|
||||
import net.neoforged.neoforge.data.event.GatherDataEvent
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.block.entity.WorkerState
|
||||
import ru.dbotthepony.mc.otm.core.getValueNullable
|
||||
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
|
||||
@ -119,6 +121,28 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
|
||||
return this
|
||||
}
|
||||
|
||||
fun simpleLadder(vararg blocks: Block): MatteryBlockStateProvider {
|
||||
for (block in blocks) {
|
||||
exec {
|
||||
|
||||
getVariantBuilder(block)
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.NORTH)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).addModel()
|
||||
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.SOUTH)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).rotationY(180).addModel()
|
||||
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.WEST)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).rotationY(270).addModel()
|
||||
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.EAST)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).rotationY(90).addModel()
|
||||
}
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
fun simpleBlockM(blocks: Collection<Block>): MatteryBlockStateProvider {
|
||||
blocks.forEach(this::simpleBlockM)
|
||||
return this
|
||||
|
@ -5,6 +5,7 @@ import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.WaterloggedTransparentBlock
|
||||
import net.neoforged.neoforge.client.model.generators.BlockModelProvider
|
||||
import net.neoforged.neoforge.data.event.GatherDataEvent
|
||||
import ru.dbotthepony.mc.otm.core.ResourceLocation
|
||||
import ru.dbotthepony.mc.otm.datagen.DataGen
|
||||
import ru.dbotthepony.mc.otm.core.registryName
|
||||
import ru.dbotthepony.mc.otm.datagen.modLocation
|
||||
@ -51,6 +52,12 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
|
||||
}
|
||||
}
|
||||
|
||||
fun decorativeLadder(block: Block) {
|
||||
withExistingParent(block.registryName!!.path, ResourceLocation("minecraft", "block/ladder"))
|
||||
.texture("texture", modLocation("block/decorative/${block.registryName!!.path}"))
|
||||
.renderType("cutout")
|
||||
}
|
||||
|
||||
fun decorativeGlassAll(blocks: Collection<Block>) {
|
||||
for (block in blocks) {
|
||||
exec {
|
||||
|
@ -82,6 +82,8 @@ fun addTags(tagsProvider: TagsProvider) {
|
||||
|
||||
tagsProvider.impermeable.add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
|
||||
|
||||
tagsProvider.blocks.Appender(BlockTags.CLIMBABLE).add(MBlocks.INDUSTRIAL_LADDER)
|
||||
|
||||
tagsProvider.androidImmuneEffects.add(
|
||||
MobEffects.CONDUIT_POWER,
|
||||
MobEffects.HEAL,
|
||||
|
@ -343,7 +343,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
}
|
||||
|
||||
override fun tick() {
|
||||
mob.lookControl.setLookAt(target, 30.0f, 30.0f)
|
||||
target?.let { mob.lookControl.setLookAt(it, 30.0f, 30.0f) }
|
||||
val target = mob.target ?: return
|
||||
|
||||
if (moveCD > 0) {
|
||||
|
@ -122,6 +122,8 @@ object MNames {
|
||||
const val TRITANIUM_BARS = "tritanium_bars"
|
||||
const val METAL_RAILING = "metal_railing"
|
||||
|
||||
const val INDUSTRIAL_LADDER = "industrial_ladder"
|
||||
|
||||
// items
|
||||
const val GRAVITATIONAL_DISRUPTOR = "gravitational_disruptor"
|
||||
const val MATTER_DUST = "matter_dust"
|
||||
|
@ -10,6 +10,7 @@ import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.Blocks
|
||||
import net.minecraft.world.level.block.DropExperienceBlock
|
||||
import net.minecraft.world.level.block.IronBarsBlock
|
||||
import net.minecraft.world.level.block.LadderBlock
|
||||
import net.minecraft.world.level.block.LiquidBlock
|
||||
import net.minecraft.world.level.block.RedstoneLampBlock
|
||||
import net.minecraft.world.level.block.RotatedPillarBlock
|
||||
@ -295,6 +296,17 @@ object MBlocks {
|
||||
.requiresCorrectToolForDrops())
|
||||
}
|
||||
|
||||
val INDUSTRIAL_LADDER: LadderBlock by registry.register(MNames.INDUSTRIAL_LADDER){
|
||||
LadderBlock(BlockBehaviour.Properties.of()
|
||||
.mapColor(MapColor.COLOR_GRAY)
|
||||
.sound(SoundType.COPPER_GRATE)
|
||||
.explosionResistance(30f)
|
||||
.noOcclusion()
|
||||
.destroyTime(2f)
|
||||
.requiresCorrectToolForDrops()
|
||||
)
|
||||
}
|
||||
|
||||
val DEEPSLATE_TRITANIUM_ORE: Block by registry.register(MNames.DEEPSLATE_TRITANIUM_ORE) { DropExperienceBlock(
|
||||
UniformInt.of(0, 3),
|
||||
BlockBehaviour.Properties.of()
|
||||
|
@ -516,6 +516,7 @@ object MItems {
|
||||
val METAL_BEAM_CENTER: Item by registry.register(MNames.METAL_BEAM_CENTER) { BlockItem(MBlocks.METAL_BEAM_CENTER, DEFAULT_PROPERTIES) }
|
||||
val ENGINE: Item by registry.register(MNames.ENGINE) { BlockItem(MBlocks.ENGINE, DEFAULT_PROPERTIES) }
|
||||
val HOLO_SIGN: Item by registry.register(MNames.HOLO_SIGN) { BlockItem(MBlocks.HOLO_SIGN, DEFAULT_PROPERTIES) }
|
||||
val INDUSTRIAL_LADDER: Item by registry.register(MNames.INDUSTRIAL_LADDER) { BlockItem(MBlocks.INDUSTRIAL_LADDER, DEFAULT_PROPERTIES) }
|
||||
|
||||
val TRITANIUM_DOOR = register(MNames.TRITANIUM_DOOR, MBlocks.TRITANIUM_DOOR)
|
||||
val TRITANIUM_TRAPDOOR = register(MNames.TRITANIUM_TRAPDOOR, MBlocks.TRITANIUM_TRAPDOOR)
|
||||
|
Loading…
Reference in New Issue
Block a user