Compare commits
7 Commits
a9851e08b3
...
94601478bb
Author | SHA1 | Date | |
---|---|---|---|
94601478bb | |||
dec8aab382 | |||
2f1b698810 | |||
aedd545a39 | |||
62c05b3c3f | |||
7f362a95a2 | |||
5b68a6c7ba |
@ -134,7 +134,7 @@ object DataGen {
|
||||
blockStateProvider.simplePillar(block)
|
||||
}
|
||||
|
||||
fun decorativeLadder(block: Block){
|
||||
fun decorativeLadder(block: Block) {
|
||||
blockModelProvider.decorativeLadder(block)
|
||||
blockStateProvider.simpleLadder(block)
|
||||
}
|
||||
|
@ -265,7 +265,6 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
|
||||
|
||||
itemModelProvider.generatedBlockDecorative(MItems.INDUSTRIAL_LADDER)
|
||||
|
||||
|
||||
itemModelProvider.block(MItems.TIRE_BLOCK)
|
||||
|
||||
blockStateProvider.block(MBlocks.METAL_BEAM_CENTER)
|
||||
|
@ -124,19 +124,30 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
|
||||
fun simpleLadder(vararg blocks: Block): MatteryBlockStateProvider {
|
||||
for (block in blocks) {
|
||||
exec {
|
||||
|
||||
val mdl = models().getExistingFile(modLocation("block/${block.registryName!!.path}"))
|
||||
getVariantBuilder(block)
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.NORTH)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).addModel()
|
||||
.modelForState()
|
||||
.modelFile(mdl)
|
||||
.addModel()
|
||||
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.SOUTH)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).rotationY(180).addModel()
|
||||
.modelForState()
|
||||
.modelFile(mdl)
|
||||
.rotationY(180)
|
||||
.addModel()
|
||||
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.WEST)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).rotationY(270).addModel()
|
||||
.modelForState()
|
||||
.modelFile(mdl)
|
||||
.rotationY(270)
|
||||
.addModel()
|
||||
|
||||
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.EAST)
|
||||
.modelForState().modelFile(models().getExistingFile(modLocation("block/decorative/${block.registryName!!.path}"))).rotationY(90).addModel()
|
||||
.modelForState()
|
||||
.modelFile(mdl)
|
||||
.rotationY(90)
|
||||
.addModel()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,9 +53,11 @@ 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")
|
||||
exec {
|
||||
withExistingParent(block.registryName!!.path, ResourceLocation("minecraft", "block/ladder"))
|
||||
.texture("texture", modLocation("block/decorative/${block.registryName!!.path}"))
|
||||
.renderType("cutout")
|
||||
}
|
||||
}
|
||||
|
||||
fun decorativeGlassAll(blocks: Collection<Block>) {
|
||||
|
@ -5,7 +5,7 @@ import ru.dbotthepony.mc.otm.client.render.sprites.MatteryAtlas
|
||||
import ru.dbotthepony.mc.otm.core.ResourceLocation
|
||||
|
||||
object WidgetLocation {
|
||||
val STORAGE_CONTROLS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/storage_controls.png"), 90f, 72f)
|
||||
val STORAGE_CONTROLS = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/storage_controls.png"), 90f, 90f)
|
||||
val WIDGET_18 = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/widget_18.png"), 72f, 72f)
|
||||
val WIDGET_15 = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/widget_15.png"), 60f, 60f)
|
||||
val WIDGET_8 = MatteryAtlas(ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/widgets/widget_8.png"), 64f, 32f)
|
||||
|
@ -6,7 +6,7 @@ import ru.dbotthepony.mc.otm.core.immutableMap
|
||||
import ru.dbotthepony.mc.otm.core.math.RelativeSide
|
||||
|
||||
object Widgets18 {
|
||||
private val storageGrid = WidgetLocation.STORAGE_CONTROLS.grid(rows = 4, columns = 5)
|
||||
private val storageGrid = WidgetLocation.STORAGE_CONTROLS.grid(rows = 5, columns = 5)
|
||||
|
||||
val SORT_DESCENDING = storageGrid.next()
|
||||
val SORT_ASCENDING = storageGrid.next()
|
||||
@ -24,6 +24,12 @@ object Widgets18 {
|
||||
val PLAY = storageGrid.next()
|
||||
val STOP = storageGrid.next()
|
||||
val SORT_NOW = storageGrid.next()
|
||||
val MOVE_EVERYTHING_TO_STORAGE = storageGrid.next()
|
||||
val MOVE_EVERYTHING_FROM_STORAGE = storageGrid.next()
|
||||
val RESTOCK_TO_STORAGE = storageGrid.next()
|
||||
val RESTOCK_FROM_STORAGE = storageGrid.next()
|
||||
val RESTOCK_WITH_MOVE_TO_STORAGE = storageGrid.next()
|
||||
val RESTOCK_WITH_MOVE_FROM_STORAGE = storageGrid.next()
|
||||
|
||||
private val miscGrid = WidgetLocation.WIDGET_18.grid(4, 4)
|
||||
|
||||
|
@ -56,6 +56,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
.add(Attributes.KNOCKBACK_RESISTANCE, 1.0)
|
||||
.add(Attributes.FOLLOW_RANGE, 32.0)
|
||||
}
|
||||
|
||||
private val IS_CHARGING: EntityDataAccessor<Boolean> =
|
||||
SynchedEntityData.defineId(Enforcer::class.java, EntityDataSerializers.BOOLEAN)
|
||||
}
|
||||
@ -65,13 +66,11 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
builder.define(IS_CHARGING, false)
|
||||
}
|
||||
|
||||
fun setCharging(value: Boolean) {
|
||||
entityData.set(IS_CHARGING, value)
|
||||
}
|
||||
|
||||
fun isCharging(): Boolean {
|
||||
return entityData.get(IS_CHARGING)
|
||||
}
|
||||
var isCharging: Boolean
|
||||
get() = entityData.get(IS_CHARGING)
|
||||
set(value) {
|
||||
entityData.set(IS_CHARGING, value)
|
||||
}
|
||||
|
||||
override fun registerGoals() {
|
||||
goalSelector.addGoal(7, LookAtPlayerGoal(this, Player::class.java, 8f))
|
||||
@ -200,7 +199,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
private var target: LivingEntity? = null
|
||||
|
||||
init {
|
||||
setFlags(EnumSet.of(Goal.Flag.MOVE))
|
||||
setFlags(EnumSet.of(Flag.MOVE))
|
||||
}
|
||||
|
||||
private var chargeTime = 0
|
||||
@ -208,8 +207,6 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
private val maxChargeTime = 40
|
||||
private var chargeDir: Vec3? = null
|
||||
private var cooldown = 0
|
||||
private val minCooldown = 35
|
||||
private val maxCooldown = 60
|
||||
private var isCharging = false
|
||||
|
||||
override fun canUse(): Boolean {
|
||||
@ -227,7 +224,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
mob.setCharging(true)
|
||||
mob.isCharging = true
|
||||
mob.playSound(MSoundEvents.ENFORCER_ALERT, 1.0f, 1.0f)
|
||||
chargeTime = 0
|
||||
mob.navigation.stop()
|
||||
@ -315,13 +312,18 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
}
|
||||
|
||||
override fun stop() {
|
||||
mob.setCharging(false)
|
||||
mob.setDeltaMovement(Vec3.ZERO)
|
||||
mob.isCharging = false
|
||||
mob.deltaMovement = Vec3.ZERO
|
||||
chargeTime = 0
|
||||
chargeDir = null
|
||||
isCharging = false
|
||||
mob.chargeState.stop()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val minCooldown = 35
|
||||
private const val maxCooldown = 60
|
||||
}
|
||||
}
|
||||
|
||||
class StayNearGoal(private val mob: Enforcer) : Goal() {
|
||||
@ -330,7 +332,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
private var movePos: Vec3? = null
|
||||
|
||||
override fun canUse(): Boolean {
|
||||
return mob.target != null && !mob.isCharging()
|
||||
return mob.target != null && !mob.isCharging
|
||||
}
|
||||
|
||||
override fun canContinueToUse(): Boolean {
|
||||
@ -373,11 +375,11 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
|
||||
private var fireTick = 0
|
||||
|
||||
init {
|
||||
setFlags(EnumSet.of(Goal.Flag.LOOK))
|
||||
setFlags(EnumSet.of(Flag.LOOK))
|
||||
}
|
||||
|
||||
override fun canUse(): Boolean {
|
||||
return mob.target != null && !mob.isCharging()
|
||||
return mob.target != null && !mob.isCharging
|
||||
}
|
||||
|
||||
override fun canContinueToUse(): Boolean {
|
||||
|
@ -326,10 +326,6 @@ private fun addDecorativeTabItems(consumer: CreativeModeTab.Output) {
|
||||
accept(MItems.METAL_BEAM_CENTER)
|
||||
accept(MItems.ENGINE)
|
||||
|
||||
accept(MItems.TRITANIUM_STRIPED_BLOCK.values)
|
||||
accept(MItems.TRITANIUM_STRIPED_STAIRS.values)
|
||||
accept(MItems.TRITANIUM_STRIPED_SLAB.values)
|
||||
accept(MItems.TRITANIUM_STRIPED_WALL.values)
|
||||
accept(MItems.CARBON_FIBRE_BLOCK)
|
||||
accept(MItems.METAL_JUNK)
|
||||
accept(MItems.METAL_MESH)
|
||||
@ -338,6 +334,13 @@ private fun addDecorativeTabItems(consumer: CreativeModeTab.Output) {
|
||||
accept(MItems.TRITANIUM_BARS)
|
||||
accept(MItems.METAL_RAILING)
|
||||
|
||||
accept(MItems.INDUSTRIAL_LADDER)
|
||||
|
||||
accept(MItems.TRITANIUM_STRIPED_BLOCK.values)
|
||||
accept(MItems.TRITANIUM_STRIPED_STAIRS.values)
|
||||
accept(MItems.TRITANIUM_STRIPED_SLAB.values)
|
||||
accept(MItems.TRITANIUM_STRIPED_WALL.values)
|
||||
|
||||
colored(MItems.TRITANIUM_DOOR)
|
||||
colored(MItems.TRITANIUM_TRAPDOOR)
|
||||
accept(MRegistry.TRITANIUM_PRESSURE_PLATE.items.values)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
Loading…
Reference in New Issue
Block a user