Skip to content

Commit

Permalink
Rework fish sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
IcarussOne committed May 1, 2024
1 parent c3e0271 commit 85f314a
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import drzhark.mocreatures.MoCreatures;
import drzhark.mocreatures.init.MoCLootTables;
import drzhark.mocreatures.init.MoCSoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;

import javax.annotation.Nullable;
Expand All @@ -26,4 +28,8 @@ public ResourceLocation getTexture() {
protected ResourceLocation getLootTable() {
return MoCLootTables.ANGLERFISH;
}

protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_DEATH_VICIOUS;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ protected SoundEvent getAmbientSound() {
protected SoundEvent getAngrySound() {
return MoCSoundEvents.ENTITY_DOLPHIN_ANGRY;
}

@Override
protected SoundEvent getSwimSound() {
return MoCSoundEvents.ENTITY_FISH_SWIM;
}

@Nullable
protected ResourceLocation getLootTable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import drzhark.mocreatures.entity.tameable.MoCEntityTameableAquatic;
import drzhark.mocreatures.init.MoCItems;
import drzhark.mocreatures.init.MoCLootTables;
import drzhark.mocreatures.init.MoCSoundEvents;
import drzhark.mocreatures.network.MoCMessageHandler;
import drzhark.mocreatures.network.message.MoCMessageHeart;
import net.minecraft.block.material.Material;
Expand All @@ -22,7 +23,9 @@
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;

Expand Down Expand Up @@ -269,4 +272,19 @@ public float getAdjustedYOffset() {
public float getEyeHeight() {
return this.height * 0.65F;
}

@Override
protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_FLOP;
}

@Override
protected SoundEvent getHurtSound(DamageSource source) {
return MoCSoundEvents.ENTITY_FISH_HURT;
}

@Override
protected SoundEvent getSwimSound() {
return MoCSoundEvents.ENTITY_FISH_SWIM;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
import drzhark.mocreatures.entity.ai.EntityAIFleeFromEntityMoC;
import drzhark.mocreatures.entity.ai.EntityAIWanderMoC2;
import drzhark.mocreatures.entity.tameable.MoCEntityTameableAquatic;
import drzhark.mocreatures.init.MoCSoundEvents;
import net.minecraft.block.material.Material;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -164,4 +167,19 @@ public boolean isNotScared() {
public float getEyeHeight() {
return this.height * 0.775F;
}

@Override
protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_FLOP;
}

@Override
protected SoundEvent getHurtSound(DamageSource source) {
return MoCSoundEvents.ENTITY_FISH_HURT;
}

@Override
protected SoundEvent getSwimSound() {
return MoCSoundEvents.ENTITY_FISH_SWIM;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import drzhark.mocreatures.MoCreatures;
import drzhark.mocreatures.entity.ai.EntityAIFollowHerd;
import drzhark.mocreatures.init.MoCLootTables;
import drzhark.mocreatures.init.MoCSoundEvents;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
Expand All @@ -15,6 +16,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -93,4 +95,9 @@ public boolean isNotScared() {
protected ResourceLocation getLootTable() {
return MoCLootTables.PIRANHA;
}

@Override
protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_DEATH_VICIOUS;
}
}
18 changes: 18 additions & 0 deletions src/main/java/drzhark/mocreatures/entity/aquatic/MoCEntityRay.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@

import drzhark.mocreatures.entity.ai.EntityAIWanderMoC2;
import drzhark.mocreatures.entity.tameable.MoCEntityTameableAquatic;
import drzhark.mocreatures.init.MoCSoundEvents;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;

public class MoCEntityRay extends MoCEntityTameableAquatic {
Expand Down Expand Up @@ -109,4 +112,19 @@ public int getMaxAge() {
public boolean isMantaRay() {
return false;
}

@Override
protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_FLOP;
}

@Override
protected SoundEvent getHurtSound(DamageSource source) {
return MoCSoundEvents.ENTITY_FISH_HURT;
}

@Override
protected SoundEvent getSwimSound() {
return MoCSoundEvents.ENTITY_FISH_SWIM;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import drzhark.mocreatures.entity.passive.MoCEntityHorse;
import drzhark.mocreatures.entity.tameable.MoCEntityTameableAquatic;
import drzhark.mocreatures.init.MoCLootTables;
import drzhark.mocreatures.init.MoCSoundEvents;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
Expand All @@ -20,9 +21,11 @@
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -200,4 +203,19 @@ public boolean isNotScared() {
public float getEyeHeight() {
return this.height * 0.61F;
}

@Override
protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_FLOP;
}

@Override
protected SoundEvent getHurtSound(DamageSource source) {
return SoundEvents.ENTITY_GUARDIAN_HURT_LAND;
}

@Override
protected SoundEvent getSwimSound() {
return MoCSoundEvents.ENTITY_FISH_SWIM;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import drzhark.mocreatures.entity.ai.EntityAIPanicMoC;
import drzhark.mocreatures.entity.ai.EntityAIWanderMoC2;
import drzhark.mocreatures.entity.tameable.MoCEntityTameableAquatic;
import drzhark.mocreatures.init.MoCSoundEvents;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -197,4 +200,19 @@ public float getAdjustedZOffset() {
public float getEyeHeight() {
return this.height * 0.45F;
}

@Override
protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_FLOP;
}

@Override
protected SoundEvent getHurtSound(DamageSource source) {
return MoCSoundEvents.ENTITY_FISH_HURT;
}

@Override
protected SoundEvent getSwimSound() {
return MoCSoundEvents.ENTITY_FISH_SWIM;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import drzhark.mocreatures.MoCTools;
import drzhark.mocreatures.MoCreatures;
import drzhark.mocreatures.init.MoCLootTables;
import drzhark.mocreatures.init.MoCSoundEvents;
import drzhark.mocreatures.network.MoCMessageHandler;
import drzhark.mocreatures.network.message.MoCMessageAnimation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;

Expand Down Expand Up @@ -99,4 +101,8 @@ public boolean attackEntityFrom(DamageSource damagesource, float i) {
public float getEyeHeight() {
return this.height * 0.86F;
}

protected SoundEvent getDeathSound() {
return MoCSoundEvents.ENTITY_FISH_DEATH_VICIOUS;
}
}
54 changes: 39 additions & 15 deletions src/main/java/drzhark/mocreatures/init/MoCSoundEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ public class MoCSoundEvents {
public static final SoundEvent ENTITY_BIRD_AMBIENT_WHITE;
public static final SoundEvent ENTITY_BIRD_AMBIENT_YELLOW;
//
public static final SoundEvent ENTITY_BUNNY_DEATH;
public static final SoundEvent ENTITY_BUNNY_HURT;
public static final SoundEvent ENTITY_BUNNY_LAND;
public static final SoundEvent ENTITY_BUNNY_LIFT;
//
public static final SoundEvent ENTITY_DEER_AMBIENT_BABY;
public static final SoundEvent ENTITY_DEER_AMBIENT;
public static final SoundEvent ENTITY_DEER_DEATH;
Expand All @@ -173,6 +178,14 @@ public class MoCSoundEvents {
public static final SoundEvent ENTITY_DUCK_AMBIENT;
public static final SoundEvent ENTITY_DUCK_HURT;
//
public static final SoundEvent ENTITY_FILCH_LIZARD_HISS;
public static final SoundEvent ENTITY_FILCH_LIZARD_DEATH;
//
public static final SoundEvent ENTITY_FISH_DEATH_VICIOUS;
public static final SoundEvent ENTITY_FISH_FLOP;
public static final SoundEvent ENTITY_FISH_HURT;
public static final SoundEvent ENTITY_FISH_SWIM;
//
public static final SoundEvent ENTITY_HORSE_ANGRY;
public static final SoundEvent ENTITY_HORSE_AMBIENT;
public static final SoundEvent ENTITY_HORSE_AMBIENT_GHOST;
Expand All @@ -192,11 +205,6 @@ public class MoCSoundEvents {
public static final SoundEvent ENTITY_MOUSE_DEATH;
public static final SoundEvent ENTITY_MOUSE_HURT;
//
public static final SoundEvent ENTITY_BUNNY_DEATH;
public static final SoundEvent ENTITY_BUNNY_HURT;
public static final SoundEvent ENTITY_BUNNY_LAND;
public static final SoundEvent ENTITY_BUNNY_LIFT;
//
public static final SoundEvent ENTITY_TURKEY_AMBIENT;
public static final SoundEvent ENTITY_TURKEY_HURT;
//
Expand Down Expand Up @@ -396,6 +404,11 @@ public class MoCSoundEvents {
ENTITY_BIRD_AMBIENT_YELLOW = createSoundEvent("entity.bird.ambient_yellow");
ENTITY_BIRD_AMBIENT_WHITE = createSoundEvent("entity.bird.ambient_white");
//
ENTITY_BUNNY_DEATH = createSoundEvent("entity.bunny.death");
ENTITY_BUNNY_HURT = createSoundEvent("entity.bunny.hurt");
ENTITY_BUNNY_LAND = createSoundEvent("entity.bunny.land");
ENTITY_BUNNY_LIFT = createSoundEvent("entity.bunny.lift");
//
ENTITY_DEER_AMBIENT_BABY = createSoundEvent("entity.deer.ambient_baby");
ENTITY_DEER_AMBIENT = createSoundEvent("entity.deer.ambient");
ENTITY_DEER_DEATH = createSoundEvent("entity.deer.death");
Expand All @@ -404,6 +417,14 @@ public class MoCSoundEvents {
ENTITY_DUCK_AMBIENT = createSoundEvent("entity.duck.ambient");
ENTITY_DUCK_HURT = createSoundEvent("entity.duck.hurt");
//
ENTITY_FILCH_LIZARD_HISS = createSoundEvent("entity.filch_lizard.hiss");
ENTITY_FILCH_LIZARD_DEATH = createSoundEvent("entity.filch_lizard.death");
//
ENTITY_FISH_DEATH_VICIOUS = createSoundEvent("entity.fish.death_vicious");
ENTITY_FISH_FLOP = createSoundEvent("entity.fish.flop");
ENTITY_FISH_HURT = createSoundEvent("entity.fish.hurt");
ENTITY_FISH_SWIM = createSoundEvent("entity.fish.swim");
//
ENTITY_HORSE_ANGRY = createSoundEvent("entity.horse.angry");
ENTITY_HORSE_AMBIENT = createSoundEvent("entity.horse.ambient");
ENTITY_HORSE_AMBIENT_GHOST = createSoundEvent("entity.horse.ambient_ghost");
Expand All @@ -423,11 +444,6 @@ public class MoCSoundEvents {
ENTITY_MOUSE_DEATH = createSoundEvent("entity.mouse.death");
ENTITY_MOUSE_HURT = createSoundEvent("entity.mouse.hurt");
//
ENTITY_BUNNY_DEATH = createSoundEvent("entity.bunny.death");
ENTITY_BUNNY_HURT = createSoundEvent("entity.bunny.hurt");
ENTITY_BUNNY_LAND = createSoundEvent("entity.bunny.land");
ENTITY_BUNNY_LIFT = createSoundEvent("entity.bunny.lift");
//
ENTITY_TURKEY_AMBIENT = createSoundEvent("entity.turkey.ambient");
ENTITY_TURKEY_HURT = createSoundEvent("entity.turkey.hurt");
//
Expand Down Expand Up @@ -641,6 +657,11 @@ public static void registerSoundEvents(final RegistryEvent.Register<SoundEvent>
ENTITY_BIRD_AMBIENT_YELLOW,
ENTITY_BIRD_AMBIENT_WHITE,
//
ENTITY_BUNNY_DEATH,
ENTITY_BUNNY_HURT,
ENTITY_BUNNY_LAND,
ENTITY_BUNNY_LIFT,
//
ENTITY_DEER_AMBIENT_BABY,
ENTITY_DEER_AMBIENT,
ENTITY_DEER_DEATH,
Expand All @@ -649,6 +670,14 @@ public static void registerSoundEvents(final RegistryEvent.Register<SoundEvent>
ENTITY_DUCK_AMBIENT,
ENTITY_DUCK_HURT,
//
ENTITY_FILCH_LIZARD_HISS,
ENTITY_FILCH_LIZARD_DEATH,
//
ENTITY_FISH_DEATH_VICIOUS,
ENTITY_FISH_FLOP,
ENTITY_FISH_HURT,
ENTITY_FISH_SWIM,
//
ENTITY_HORSE_ANGRY,
ENTITY_HORSE_AMBIENT,
ENTITY_HORSE_AMBIENT_GHOST,
Expand All @@ -668,11 +697,6 @@ public static void registerSoundEvents(final RegistryEvent.Register<SoundEvent>
ENTITY_MOUSE_DEATH,
ENTITY_MOUSE_HURT,
//
ENTITY_BUNNY_DEATH,
ENTITY_BUNNY_HURT,
ENTITY_BUNNY_LAND,
ENTITY_BUNNY_LIFT,
//
ENTITY_TURKEY_AMBIENT,
ENTITY_TURKEY_HURT,
//
Expand Down
Loading

0 comments on commit 85f314a

Please sign in to comment.