Compare commits

..

No commits in common. "a9851e08b3b75a21ce75a5378a83cb38f8ef6266" and "7a7139c48c64129737ecae2de9f4d3883bddad35" have entirely different histories.

13 changed files with 20 additions and 84 deletions

View File

@ -134,11 +134,6 @@ object DataGen {
blockStateProvider.simplePillar(block) blockStateProvider.simplePillar(block)
} }
fun decorativeLadder(block: Block){
blockModelProvider.decorativeLadder(block)
blockStateProvider.simpleLadder(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))

View File

@ -38,8 +38,6 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
DataGen.decorativeCubeAllCutout(MBlocks.METAL_MESH) DataGen.decorativeCubeAllCutout(MBlocks.METAL_MESH)
DataGen.decorativePillar(MBlocks.TIRE_BLOCK, "carbon_fibre_block", "tire") DataGen.decorativePillar(MBlocks.TIRE_BLOCK, "carbon_fibre_block", "tire")
DataGen.decorativeLadder(MBlocks.INDUSTRIAL_LADDER)
DataGen.decoratives(MRegistry.TRITANIUM_BLOCK) DataGen.decoratives(MRegistry.TRITANIUM_BLOCK)
for (color in DyeColor.entries) { for (color in DyeColor.entries) {
@ -262,10 +260,6 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
itemModelProvider.block(MItems.LABORATORY_LAMP_INVERTED, MItems.LABORATORY_LAMP.registryName!!.path + "_unlit") 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.DANGER_STRIPE_BLOCK, MItems.DANGER_STRIPE_BLOCK.registryName!!.path + "_0")
itemModelProvider.block(MItems.METAL_BEAM) itemModelProvider.block(MItems.METAL_BEAM)
itemModelProvider.generatedBlockDecorative(MItems.INDUSTRIAL_LADDER)
itemModelProvider.block(MItems.TIRE_BLOCK) itemModelProvider.block(MItems.TIRE_BLOCK)
blockStateProvider.block(MBlocks.METAL_BEAM_CENTER) blockStateProvider.block(MBlocks.METAL_BEAM_CENTER)

View File

@ -3,13 +3,11 @@ package ru.dbotthepony.mc.otm.datagen.blocks
import net.minecraft.core.Direction import net.minecraft.core.Direction
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.world.level.block.Block 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.RotatedPillarBlock
import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.BlockState
import net.neoforged.neoforge.client.model.generators.BlockStateProvider import net.neoforged.neoforge.client.model.generators.BlockStateProvider
import net.neoforged.neoforge.client.model.generators.ConfiguredModel import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import net.neoforged.neoforge.data.event.GatherDataEvent 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.block.entity.WorkerState
import ru.dbotthepony.mc.otm.core.getValueNullable import ru.dbotthepony.mc.otm.core.getValueNullable
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
@ -121,28 +119,6 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
return this 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 { fun simpleBlockM(blocks: Collection<Block>): MatteryBlockStateProvider {
blocks.forEach(this::simpleBlockM) blocks.forEach(this::simpleBlockM)
return this return this

View File

@ -5,7 +5,6 @@ import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.WaterloggedTransparentBlock import net.minecraft.world.level.block.WaterloggedTransparentBlock
import net.neoforged.neoforge.client.model.generators.BlockModelProvider import net.neoforged.neoforge.client.model.generators.BlockModelProvider
import net.neoforged.neoforge.data.event.GatherDataEvent 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.datagen.DataGen
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
@ -52,12 +51,6 @@ 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>) { fun decorativeGlassAll(blocks: Collection<Block>) {
for (block in blocks) { for (block in blocks) {
exec { exec {

View File

@ -82,8 +82,6 @@ fun addTags(tagsProvider: TagsProvider) {
tagsProvider.impermeable.add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) tagsProvider.impermeable.add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
tagsProvider.blocks.Appender(BlockTags.CLIMBABLE).add(MBlocks.INDUSTRIAL_LADDER)
tagsProvider.androidImmuneEffects.add( tagsProvider.androidImmuneEffects.add(
MobEffects.CONDUIT_POWER, MobEffects.CONDUIT_POWER,
MobEffects.HEAL, MobEffects.HEAL,

View File

@ -6,7 +6,6 @@ import net.minecraft.network.syncher.EntityDataSerializers
import net.minecraft.network.syncher.SynchedEntityData import net.minecraft.network.syncher.SynchedEntityData
import net.minecraft.server.level.ServerBossEvent import net.minecraft.server.level.ServerBossEvent
import net.minecraft.server.level.ServerLevel import net.minecraft.server.level.ServerLevel
import net.minecraft.server.level.ServerPlayer
import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundEvents import net.minecraft.sounds.SoundEvents
import net.minecraft.sounds.SoundSource import net.minecraft.sounds.SoundSource
@ -34,9 +33,12 @@ import net.minecraft.world.entity.projectile.SmallFireball
import net.minecraft.world.level.Level import net.minecraft.world.level.Level
import net.minecraft.world.phys.Vec3 import net.minecraft.world.phys.Vec3
import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.isFire
import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MNames
import ru.dbotthepony.mc.otm.registry.game.MSoundEvents import ru.dbotthepony.mc.otm.registry.game.MSoundEvents
import java.util.* import java.util.*
import kotlin.math.cos
import kotlin.math.sin
class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) { class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
val idleState = AnimationState() val idleState = AnimationState()
@ -73,6 +75,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
return entityData.get(IS_CHARGING) return entityData.get(IS_CHARGING)
} }
override fun registerGoals() { override fun registerGoals() {
goalSelector.addGoal(7, LookAtPlayerGoal(this, Player::class.java, 8f)) goalSelector.addGoal(7, LookAtPlayerGoal(this, Player::class.java, 8f))
goalSelector.addGoal(3, NearestAttackableTargetGoal(this, LivingEntity::class.java, 10, true, true) { entity -> goalSelector.addGoal(3, NearestAttackableTargetGoal(this, LivingEntity::class.java, 10, true, true) { entity ->
@ -86,7 +89,6 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
goalSelector.addGoal(2, RammingGoal(this)) goalSelector.addGoal(2, RammingGoal(this))
goalSelector.addGoal(2, StayNearGoal(this)) goalSelector.addGoal(2, StayNearGoal(this))
goalSelector.addGoal(2, BlazeFireballGoal(this)) goalSelector.addGoal(2, BlazeFireballGoal(this))
targetSelector.addGoal(1, HurtByTargetGoal(this)) targetSelector.addGoal(1, HurtByTargetGoal(this))
} }
@ -96,7 +98,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
return false return false
} }
override fun getHurtSound(damageSource: DamageSource): SoundEvent { override fun getHurtSound(damageSource: net.minecraft.world.damagesource.DamageSource): SoundEvent {
return SoundEvents.HEAVY_CORE_BREAK return SoundEvents.HEAVY_CORE_BREAK
} }
@ -106,20 +108,25 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
//fire inv //fire inv
//there should be a better way //there should be a better way
override fun fireImmune(): Boolean { override fun isInvulnerableTo(source: DamageSource): Boolean {
return true return source.isFire || super.isInvulnerableTo(source)
}
override fun hurt(source: DamageSource, amount: Float): Boolean {
if (source.isFire) return false
return super.hurt(source, amount)
} }
///boss healthbar ///boss healthbar
private val bossEvent: ServerBossEvent = private val bossEvent: ServerBossEvent =
ServerBossEvent(TranslatableComponent(MNames.ENFORCER), BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.PROGRESS) ServerBossEvent(TranslatableComponent(MNames.ENFORCER), BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.PROGRESS)
override fun startSeenByPlayer(player: ServerPlayer) { override fun startSeenByPlayer(player: net.minecraft.server.level.ServerPlayer) {
super.startSeenByPlayer(player) super.startSeenByPlayer(player)
bossEvent.addPlayer(player) bossEvent.addPlayer(player)
} }
override fun stopSeenByPlayer(player: ServerPlayer) { override fun stopSeenByPlayer(player: net.minecraft.server.level.ServerPlayer) {
super.stopSeenByPlayer(player) super.stopSeenByPlayer(player)
bossEvent.removePlayer(player) bossEvent.removePlayer(player)
} }
@ -127,13 +134,9 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
override fun aiStep() { override fun aiStep() {
super.aiStep() super.aiStep()
bossEvent.progress = this.health / this.maxHealth bossEvent.progress = this.health / this.maxHealth
if (!this.isOnFire) {
this.clearFire()
}
} }
override fun die(cause: DamageSource) { override fun die(cause: net.minecraft.world.damagesource.DamageSource) {
super.die(cause) super.die(cause)
bossEvent.removeAllPlayers() bossEvent.removeAllPlayers()
} }
@ -195,7 +198,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
level().addFreshEntity(fireball) level().addFreshEntity(fireball)
} }
//charge attack //charge attack, could possibly leave a smoke trail too idk
class RammingGoal(private val mob: Enforcer) : Goal() { class RammingGoal(private val mob: Enforcer) : Goal() {
private var target: LivingEntity? = null private var target: LivingEntity? = null
@ -208,7 +211,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
private val maxChargeTime = 40 private val maxChargeTime = 40
private var chargeDir: Vec3? = null private var chargeDir: Vec3? = null
private var cooldown = 0 private var cooldown = 0
private val minCooldown = 35 private val minCooldown = 20
private val maxCooldown = 60 private val maxCooldown = 60
private var isCharging = false private var isCharging = false
@ -278,7 +281,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
stop() stop()
return return
} }
mob.playSound(MSoundEvents.ENFORCER_CHARGE, 1.0f, 1.0f) mob.playSound(MSoundEvents.ANDROID_JUMP_BOOST, 1.0f, 1.0f)
} }
val dir = chargeDir ?: return val dir = chargeDir ?: return
@ -307,7 +310,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
target.push(knockback.x, 0.5, knockback.z) target.push(knockback.x, 0.5, knockback.z)
val damageAmount = 14.0f val damageAmount = 10.0f
target.hurt(mob.damageSources().mobAttack(mob), damageAmount) target.hurt(mob.damageSources().mobAttack(mob), damageAmount)
stop() stop()
@ -343,7 +346,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
} }
override fun tick() { override fun tick() {
target?.let { mob.lookControl.setLookAt(it, 30.0f, 30.0f) } mob.lookControl.setLookAt(target, 30.0f, 30.0f)
val target = mob.target ?: return val target = mob.target ?: return
if (moveCD > 0) { if (moveCD > 0) {
@ -397,12 +400,6 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
if (fireTick > 0){ if (fireTick > 0){
fireTick -- fireTick --
if (fireTick >= 19){
mob.playSound(MSoundEvents.ENFORCER_BEEP, 1.0f, 1.0f)
}
if (fireTick == 15){ if (fireTick == 15){
mob.shootFireball(0.5f) mob.shootFireball(0.5f)
//could have a better firing sound //could have a better firing sound

View File

@ -122,8 +122,6 @@ object MNames {
const val TRITANIUM_BARS = "tritanium_bars" const val TRITANIUM_BARS = "tritanium_bars"
const val METAL_RAILING = "metal_railing" const val METAL_RAILING = "metal_railing"
const val INDUSTRIAL_LADDER = "industrial_ladder"
// items // items
const val GRAVITATIONAL_DISRUPTOR = "gravitational_disruptor" const val GRAVITATIONAL_DISRUPTOR = "gravitational_disruptor"
const val MATTER_DUST = "matter_dust" const val MATTER_DUST = "matter_dust"

View File

@ -10,7 +10,6 @@ import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.DropExperienceBlock import net.minecraft.world.level.block.DropExperienceBlock
import net.minecraft.world.level.block.IronBarsBlock 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.LiquidBlock
import net.minecraft.world.level.block.RedstoneLampBlock import net.minecraft.world.level.block.RedstoneLampBlock
import net.minecraft.world.level.block.RotatedPillarBlock import net.minecraft.world.level.block.RotatedPillarBlock
@ -296,17 +295,6 @@ object MBlocks {
.requiresCorrectToolForDrops()) .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( val DEEPSLATE_TRITANIUM_ORE: Block by registry.register(MNames.DEEPSLATE_TRITANIUM_ORE) { DropExperienceBlock(
UniformInt.of(0, 3), UniformInt.of(0, 3),
BlockBehaviour.Properties.of() BlockBehaviour.Properties.of()

View File

@ -516,7 +516,6 @@ object MItems {
val METAL_BEAM_CENTER: Item by registry.register(MNames.METAL_BEAM_CENTER) { BlockItem(MBlocks.METAL_BEAM_CENTER, DEFAULT_PROPERTIES) } 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 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 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_DOOR = register(MNames.TRITANIUM_DOOR, MBlocks.TRITANIUM_DOOR)
val TRITANIUM_TRAPDOOR = register(MNames.TRITANIUM_TRAPDOOR, MBlocks.TRITANIUM_TRAPDOOR) val TRITANIUM_TRAPDOOR = register(MNames.TRITANIUM_TRAPDOOR, MBlocks.TRITANIUM_TRAPDOOR)

View File

@ -28,8 +28,6 @@ object MSoundEvents {
val LOADER_AMBIENT by make("loader_ambient") val LOADER_AMBIENT by make("loader_ambient")
val ENFORCER_ALERT by make("enforcer_alert") val ENFORCER_ALERT by make("enforcer_alert")
val ENFORCER_CHARGE by make("enforcer_charge")
val ENFORCER_BEEP by make("enforcer_beep")
fun register(bus: IEventBus) { fun register(bus: IEventBus) {
registry.register(bus) registry.register(bus)