diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootModifiersData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootModifiersData.kt index 3a74146bc..3305a8958 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootModifiersData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootModifiersData.kt @@ -210,8 +210,8 @@ fun addLootModifiers(it: LootModifiers) { KilledByRealPlayerOrIndirectly ), - ItemStack(MItems.WITHERED_STEEL, 1) to 0.24, - ItemStack(MItems.WITHERED_STEEL, 2) to 0.11 + ItemStack(MItems.WITHERED_STEEL, 1) to 0.15, + ItemStack(MItems.WITHERED_STEEL, 2) to 0.1 )) it.add("wither_exosuit_upgrades", BasicLootAppender( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/OverdriveThatMatters.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/OverdriveThatMatters.kt index a0e42bdfc..c9d4377f1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/OverdriveThatMatters.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/OverdriveThatMatters.kt @@ -6,6 +6,7 @@ import net.neoforged.bus.api.EventPriority import net.neoforged.fml.common.Mod import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent +import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent import ru.dbotthepony.mc.otm.android.AndroidResearchDescription import ru.dbotthepony.mc.otm.android.AndroidResearchDescriptions import ru.dbotthepony.mc.otm.android.AndroidResearchManager @@ -53,6 +54,7 @@ import ru.dbotthepony.mc.otm.config.ServerConfig import ru.dbotthepony.mc.otm.config.ToolsConfig import ru.dbotthepony.mc.otm.data.FlywheelMaterials import ru.dbotthepony.mc.otm.data.world.DecimalProvider +import ru.dbotthepony.mc.otm.entity.WitheredSkeletonSpawnHandler import ru.dbotthepony.mc.otm.item.ChestUpgraderItem import ru.dbotthepony.mc.otm.item.tool.ExplosiveHammerItem import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem @@ -221,6 +223,9 @@ object OverdriveThatMatters { FORGE_BUS.addListener(EventPriority.LOWEST, KillAsAndroidTrigger::onKill) + //fuck if I know + FORGE_BUS.addListener(EventPriority.NORMAL, WitheredSkeletonSpawnHandler::onEntityJoin) + FORGE_BUS.addListener(EventPriority.NORMAL, EnderTeleporterFeature.Companion::onEntityDeath) FORGE_BUS.addListener(EventPriority.HIGH, TritaniumArmorItem.Companion::onHurt) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/SpawnModifiers.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/SpawnModifiers.kt new file mode 100644 index 000000000..6ceaea61b --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/SpawnModifiers.kt @@ -0,0 +1,30 @@ +package ru.dbotthepony.mc.otm.entity + +import net.minecraft.world.entity.EquipmentSlot +import net.minecraft.world.entity.monster.WitherSkeleton +import net.minecraft.world.item.ItemStack +import net.minecraft.world.item.Items +import net.neoforged.bus.api.SubscribeEvent +import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent +import ru.dbotthepony.mc.otm.registry.game.MItems + + +object WitheredSkeletonSpawnHandler { + + @SubscribeEvent + fun onEntityJoin(event: EntityJoinLevelEvent) { + val entity = event.entity + if (entity is WitherSkeleton){ + + val giveHelmet = entity.random.nextFloat() < 0.1f + val giveSword = entity.random.nextFloat() < 0.24f + + if (giveHelmet) { + entity.setItemSlot(EquipmentSlot.HEAD, ItemStack(Items.NETHERITE_HELMET)) + entity.setItemSlot(EquipmentSlot.MAINHAND, ItemStack(MItems.WITHERED_STEEL_SWORD)) + } else if (giveSword) { + entity.setItemSlot(EquipmentSlot.MAINHAND, ItemStack(MItems.WITHERED_STEEL_SWORD)) + } + } + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/WitheredSteelSwordItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/WitheredSteelSwordItem.kt index 4c78415e1..8960a05fb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/WitheredSteelSwordItem.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/WitheredSteelSwordItem.kt @@ -41,7 +41,7 @@ class WitheredSteelSwordItem(properties: Item.Properties) : SwordItem(Tiers.IRON } override fun hurtEnemy(stack: ItemStack, target: LivingEntity, attacker: LivingEntity): Boolean { - target.addEffect(MobEffectInstance(MobEffects.WITHER, 100, 0)) // 5s Wither II + target.addEffect(MobEffectInstance(MobEffects.WITHER, 100, 0)) return super.hurtEnemy(stack, target, attacker) } diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/matter_entangler_error.json b/src/main/resources/assets/overdrive_that_matters/models/block/matter_entangler_error.json index fd3dc6733..135ce5bbb 100644 --- a/src/main/resources/assets/overdrive_that_matters/models/block/matter_entangler_error.json +++ b/src/main/resources/assets/overdrive_that_matters/models/block/matter_entangler_error.json @@ -1,5 +1,5 @@ { - "parent": "overdrive_that_matters:block/matter_entangler, + "parent": "overdrive_that_matters:block/matter_entangler", "texture_size": [32, 32], "textures": { "status": "overdrive_that_matters:block/screen_status_error"