From 49ee0a6a5f65d3149dcf1bc0677a4a51833d4e03 Mon Sep 17 00:00:00 2001 From: GearShocky Date: Sat, 1 Mar 2025 16:47:42 +0500 Subject: [PATCH 1/2] eh? --- .../mc/otm/datagen/loot/LootModifiersData.kt | 4 +-- .../mc/otm/OverdriveThatMatters.kt | 5 ++++ .../mc/otm/entity/SpawnModifiers.kt | 30 +++++++++++++++++++ .../otm/item/weapon/WitheredSteelSwordItem.kt | 2 +- 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/entity/SpawnModifiers.kt 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) } From f655405d4b6f921a80315637e5ec7e4351f77f81 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 1 Mar 2025 19:17:12 +0700 Subject: [PATCH 2/2] [19:15:16] [Worker-Main-10/ERROR] [minecraft/ModelManager]: Failed to load model overdrive_that_matters:models/block/matter_entangler_error.json com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 3 column 4 path $.parent --- .../models/block/matter_entangler_error.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"