From 949521a4296bce28dde28e18dd206fab4891f30c Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Wed, 21 Aug 2024 22:51:07 +0200 Subject: [PATCH] Rip out even more stuff --- .../configuration/configs/ConfigEntities.java | 2 +- .../configuration/configs/ConfigSounds.java | 2 -- .../core/handlers/ServerEventHandler.java | 32 +++---------------- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigEntities.java b/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigEntities.java index 9f76ecbb6..5aa55c6ba 100644 --- a/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigEntities.java +++ b/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigEntities.java @@ -47,7 +47,6 @@ protected void syncConfigOptions() { //passive enableRabbit = getBoolean("enableRabbits", catPassive, true, ""); enableBrownMooshroom = getBoolean("enableBrownMooshroom", catPassive, true, "Brown mooshroom variant, the red mooshrooms turn into then when they are hit by lightning."); - enableSquidInk = getBoolean("enableSquidInk", catPassive, true, "Squid now produce a cloud of floating black ink particles when attacked."); //neutral enableBees = getBoolean("enableBees", catNeutral, true, ""); @@ -65,6 +64,7 @@ protected void syncConfigOptions() { enableVillagerTurnsIntoWitch = getBoolean("enableVillagerTurnsIntoWitch", catMisc, true, "Villagers turn into Witches when struck by lightning"); enableDragonRespawn = getBoolean("enableDragonRespawn", catMisc, true, "Crude implementation of respawning the dragon using four End crystals."); enableNetherEndermen = getBoolean("enableNetherEndermen", catMisc, true, "Allow endermen to rarely spawn in the Nether"); + enableSquidInk = getBoolean("enableSquidInk", catMisc, true, "Squid now produce a cloud of floating black ink particles when attacked."); } } diff --git a/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigSounds.java b/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigSounds.java index 1fe5f9bd2..1e60b77bf 100644 --- a/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigSounds.java +++ b/src/main/java/ganymedes01/etfuturum/configuration/configs/ConfigSounds.java @@ -99,7 +99,6 @@ public class ConfigSounds extends ConfigBase { public static boolean furnaceCrackling; public static boolean bonemealing; public static boolean heavyWaterSplashing; - public static boolean squidSounds; public static float combatSoundStrongThreshold; @@ -151,7 +150,6 @@ protected void syncConfigOptions() { thornsSounds = getBoolean("thornsSounds", catEntity, true, "New sounds for being hurt by the Thorns enchantment."); horseEatCowMilk = getBoolean("horseEatCowMilk", catEntity, true, "Sounds for horses eating food and cows being milked."); heavyWaterSplashing = getBoolean("heavyWaterSplashing", catEntity, true, "Play a more intense splash when the player lands in water at high speeds."); - squidSounds = getBoolean("squidSounds", catEntity, true, "Add squid sounds introduced in 1.9+."); bookPageTurn = getBoolean("bookPageTurn", catMisc, true, "Changes the click in the book GUI to have a page turn sound instead of the menu click."); diff --git a/src/main/java/ganymedes01/etfuturum/core/handlers/ServerEventHandler.java b/src/main/java/ganymedes01/etfuturum/core/handlers/ServerEventHandler.java index c6db7dd2d..df9ac4d66 100644 --- a/src/main/java/ganymedes01/etfuturum/core/handlers/ServerEventHandler.java +++ b/src/main/java/ganymedes01/etfuturum/core/handlers/ServerEventHandler.java @@ -168,10 +168,6 @@ public void livingUpdate(LivingUpdateEvent event) { sq.motionY = 0.08; sq.velocityChanged = true; } - - if (ConfigSounds.squidSounds && sq.livingSoundTime == 0 && sq.isInWater() && entity.worldObj.rand.nextDouble() < 0.05) { - playSoundAtEntityRng("entity.squid.say", sq); - } } @@ -238,22 +234,6 @@ public void livingUpdate(LivingUpdateEvent event) { } } } - - @SubscribeEvent - public void onLivingDeathEvent(LivingDeathEvent event) { - EntityLivingBase entity = event.entityLiving; - if (!entity.worldObj.isRemote && ConfigSounds.squidSounds && EntitySquid.class.equals(entity.getClass())) { - playSoundAtEntityRng("entity.squid.death", entity); - } - } - - private static void playSoundAtEntityRng(String soundName, EntityLivingBase e) { - Random r = e.worldObj.rand; - float v = e.isChild() ? 1.5F : 1.0F; - float pitch = (r.nextFloat() - r.nextFloat()) * 0.2F + v; - - e.worldObj.playSoundAtEntity(e, soundName, 0.4F, pitch); - } @SubscribeEvent public void onAttackEntityEvent(AttackEntityEvent event) { //Fires when a player presses the attack button on an entity @@ -1693,9 +1673,6 @@ public void livingHurtEvent(LivingHurtEvent event) { } if (EntitySquid.class.equals(targetEntity.getClass())) { - if (ConfigSounds.squidSounds) { - playSoundAtEntityRng("entity.squid.hurt", targetEntity); - } World w = targetEntity.worldObj; Random r = w.rand; doInk: if (ConfigEntities.enableSquidInk && r.nextDouble() < 0.15 && w instanceof WorldServer serverWorld && targetEntity.isInWater()) { @@ -1713,11 +1690,10 @@ public void livingHurtEvent(LivingHurtEvent event) { EntityLivingBase target = around.get(r.nextInt(around.size())); if (target != null && target != targetEntity) { - if (w instanceof WorldServer) { - ((WorldServer) w).func_147487_a("largesmoke", cx, cy, cz, 5, 0.0, 0.0, 0.0, 0.08); - } - if (ConfigSounds.squidSounds) { - playSoundAtEntityRng("entity.squid.squirt", target); + serverWorld.func_147487_a("largesmoke", cx, cy, cz, 5, 0.0, 0.0, 0.0, 0.08); + if (ConfigMixins.newMobSounds) { + float pitch = (r.nextFloat() - r.nextFloat()) * 0.2F + (target.isChild() ? 1.5F : 1.0F); + w.playSoundAtEntity(target, Reference.MCAssetVer + ":entity.squid.squirt", 0.4F, pitch); } if (target.isInWater()) { PotionEffect activeEff = target.getActivePotionEffect(Potion.blindness);