From 18252cf800dc2c267f3f0c7834d2a96009c7fa39 Mon Sep 17 00:00:00 2001 From: GearShocky Date: Fri, 28 Feb 2025 17:03:05 +0500 Subject: [PATCH] bread --- .../mc/otm/datagen/items/ItemModels.kt | 2 ++ .../ru/dbotthepony/mc/otm/datagen/lang/English.kt | 2 ++ .../client/model/entity/BreadMonsterModel.java | 2 +- .../client/render/entity/BreadMonsterRenderer.kt | 2 +- .../ru/dbotthepony/mc/otm/entity/BreadMonster.kt | 14 +++++++++++--- .../ru/dbotthepony/mc/otm/registry/MNames.kt | 3 +++ .../ru/dbotthepony/mc/otm/registry/game/MItems.kt | 3 +++ .../textures/item/egg/bread_monster.png | Bin 0 -> 533 bytes 8 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/egg/bread_monster.png diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt index 87984511b..089bcda2c 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt @@ -108,6 +108,8 @@ fun addItemModels(provider: MatteryItemModelProvider) { provider.handheld(MItems.CHEST_UPGRADER) + provider.generated(MItems.BREAD_MONSTER_SPAWN_EGG, modLocation("item/egg/bread_monster")) + provider.generatedTiered(MItems.BATTERIES, "battery_tier") provider.generated(MItems.BATTERY_CREATIVE) provider.generated(MItems.PROCEDURAL_BATTERY, modLocation("item/battery_procedural")) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index b60fdaff0..822fefc35 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -909,6 +909,8 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.CHEST_UPGRADER, "Crate-r") add(MItems.CHEST_UPGRADER, "desc", "Replaces placed chests and barrels with cargo crates while keeping storage contents") add(MItems.CHEST_UPGRADER, "desc2", "Hold desired crates in the opposite hand") + + add(MItems.BREAD_MONSTER_SPAWN_EGG, "Bread Monster Spawn Egg") } } diff --git a/src/main/java/ru/dbotthepony/mc/otm/client/model/entity/BreadMonsterModel.java b/src/main/java/ru/dbotthepony/mc/otm/client/model/entity/BreadMonsterModel.java index 8eadd78ed..e16be2838 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/client/model/entity/BreadMonsterModel.java +++ b/src/main/java/ru/dbotthepony/mc/otm/client/model/entity/BreadMonsterModel.java @@ -58,7 +58,7 @@ public class BreadMonsterModel { // this.applyStatic(BreadMonsterAnimation.IDLE); this.animate(entity.getIdleState(), BreadMonsterAnimation.IDLE, ageInTicks, 1.0F); - this.animateWalk(BreadMonsterAnimation.MOVE, limbSwing, limbSwingAmount, 1.0F, 2.5F); + this.animateWalk(BreadMonsterAnimation.MOVE, limbSwing, limbSwingAmount, 1.0F, 5.5F); } @Override diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/entity/BreadMonsterRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/entity/BreadMonsterRenderer.kt index 595be5f82..ce3692a67 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/entity/BreadMonsterRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/entity/BreadMonsterRenderer.kt @@ -9,7 +9,7 @@ import ru.dbotthepony.mc.otm.client.model.entity.BreadMonsterModel import ru.dbotthepony.mc.otm.entity.BreadMonster class BreadMonsterRenderer(context: EntityRendererProvider.Context) - : MobRenderer>(context, BreadMonsterModel.getModel(), 0.9f) { + : MobRenderer>(context, BreadMonsterModel.getModel(), 0.4f) { override fun getTextureLocation(entity: BreadMonster): ResourceLocation = TEXTURE_LOCATION companion object { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/BreadMonster.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/BreadMonster.kt index 5a3515e64..f13fd15dc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/BreadMonster.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/BreadMonster.kt @@ -2,13 +2,16 @@ package ru.dbotthepony.mc.otm.entity import net.minecraft.world.entity.AnimationState import net.minecraft.world.entity.EntityType +import net.minecraft.world.entity.LivingEntity import net.minecraft.world.entity.ai.attributes.AttributeSupplier import net.minecraft.world.entity.ai.attributes.Attributes import net.minecraft.world.entity.ai.goal.LeapAtTargetGoal import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal +import net.minecraft.world.entity.ai.goal.MeleeAttackGoal import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal +import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal import net.minecraft.world.entity.ai.navigation.GroundPathNavigation import net.minecraft.world.entity.ai.navigation.PathNavigation import net.minecraft.world.entity.monster.Monster @@ -23,10 +26,14 @@ class BreadMonster(type: EntityType, level: Level) : Monster(type, } override fun registerGoals() { + goalSelector.addGoal(8, RandomLookAroundGoal(this)) + goalSelector.addGoal(7, WaterAvoidingRandomStrollGoal(this, 0.8)) + goalSelector.addGoal(8, LookAtPlayerGoal(this, Player::class.java, 8f)) + goalSelector.addGoal(3, NearestAttackableTargetGoal(this, LivingEntity::class.java , true, true)) + goalSelector.addGoal(3, NearestAttackableTargetGoal(this, Player::class.java , true, true)) + goalSelector.addGoal(1, LeapAtTargetGoal(this, 0.4f)) - goalSelector.addGoal(2, WaterAvoidingRandomStrollGoal(this, 0.8)) - goalSelector.addGoal(3, LookAtPlayerGoal(this, Player::class.java, 8f)) - goalSelector.addGoal(4, RandomLookAroundGoal(this)) + goalSelector.addGoal(2, MeleeAttackGoal(this, 1.3, true)) targetSelector.addGoal(1, HurtByTargetGoal(this)) } @@ -38,6 +45,7 @@ class BreadMonster(type: EntityType, level: Level) : Monster(type, return createMonsterAttributes() .add(Attributes.MAX_HEALTH, 16.0) .add(Attributes.MOVEMENT_SPEED, 0.3) + .add(Attributes.ATTACK_DAMAGE, 3.0) } } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt index a4c9f0f97..c873ba1a5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt @@ -191,6 +191,9 @@ object MNames { const val CHEST_UPGRADER = "chest_upgrader" + // eg + const val BREAD_MONSTER_SPAWN_EGG = "bead_monster_spawn_egg" + // items: crafting components const val TRITANIUM_DUST = "tritanium_dust" const val TRITANIUM_NUGGET = "tritanium_nugget" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt index b200f0536..55ba8d92c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt @@ -20,6 +20,7 @@ import net.minecraft.world.item.Rarity import net.minecraft.world.item.ShearsItem import net.minecraft.world.item.ShieldItem import net.minecraft.world.item.ShovelItem +import net.minecraft.world.item.SpawnEggItem import net.minecraft.world.item.SwordItem import net.minecraft.world.item.Tiers import net.minecraft.world.item.crafting.Ingredient @@ -656,6 +657,8 @@ object MItems { val CHEST_UPGRADER: Item by registry.register(MNames.CHEST_UPGRADER) { ChestUpgraderItem() } + val BREAD_MONSTER_SPAWN_EGG: Item by registry.register(MNames.BREAD_MONSTER_SPAWN_EGG){ SpawnEggItem(MEntityTypes.BREAD_MONSTER, 0xFFFFFF, 0xFFFFFF, Item.Properties())} + init { MRegistry.registerItems(registry) } diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/egg/bread_monster.png b/src/main/resources/assets/overdrive_that_matters/textures/item/egg/bread_monster.png new file mode 100644 index 0000000000000000000000000000000000000000..ad057ecdac6b90f6ebaf56d4d5097bedb85ba38e GIT binary patch literal 533 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}50G|+78-3x%KCSQs**%@=ryn@?q{%I+R9Sb>BG^u3(fso0NQd1!CZ&3d z1C>udFS!^<@s$Mm1^-6|46X<6oB+yj7I;J!0~H(uVa6R3v)=**B}!Z)N`mv#O3D+9 zQW*jgGxJLH{9Hp6O!W-)jDGK7-Ud{&Ej7Y3&C^qhfdj~4WsqWIWncudynt95$_DvP zgOM35&IDu|GBSaE8wF%%wzGi6vw&<6xLL-?@B$bJFdEHL2B6dgb_N!pN&_Qf1I7gq zQ$aSeE`XRc1;_>gCZM@YV3k3Z7C;tMm!W|HNOrl#zIDGv55561OFUg1Lo|Y8`vduo zC~&Yka*Jwy-=8O+u%a3QyEsy$@Ip#=rRr*|Do4dZ7^~H}Px?C>d-49l7yBlJ> z;6sDt&e@znowIq4V3EuOA^F6*2UngGVxmp=di literal 0 HcmV?d00001