Skip to content

Commit

Permalink
Hamster Sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
N1nn1 committed Sep 15, 2023
1 parent 1aed4d6 commit 990febf
Show file tree
Hide file tree
Showing 32 changed files with 66 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/ninni/spawn/entity/Ant.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public InteractionResult mobInteract(Player player, InteractionHand interactionH
if (!player.getAbilities().instabuild) {
itemStack.shrink(1);
}
this.heal(item.getFoodProperties().getNutrition());
this.heal(6);
return InteractionResult.SUCCESS;
} else if (item instanceof DyeItem) {
DyeColor dyeColor = ((DyeItem)item).getDyeColor();
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/ninni/spawn/entity/Hamster.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import net.minecraft.world.entity.npc.InventoryCarrier;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.level.Level;
Expand Down Expand Up @@ -294,7 +293,7 @@ protected SoundEvent getHurtSound(DamageSource damageSource) {
@Nullable
@Override
protected SoundEvent getAmbientSound() {
return this.getInventory().isEmpty() ? SpawnSoundEvents.HAMSTER_AMBIENT : SpawnSoundEvents.HAMSTER_AMBIENT_FULL;
return this.isStanding() ? SpawnSoundEvents.HAMSTER_AMBIENT_CALL : SpawnSoundEvents.HAMSTER_AMBIENT;
}

@Nullable
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/com/ninni/spawn/registry/SpawnSoundEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,11 @@ public interface SpawnSoundEvents {
SoundEvent SNAIL_LAY_EGGS = register("entity.snail.lay_eggs");
SoundEvent SNAIL_EGGS_HATCH = register("block.snail_eggs.hatch");

//TODO
SoundEvent HAMSTER_AMBIENT = register("entity.hamster.idle");
//TODO
SoundEvent HAMSTER_AMBIENT_FULL = register("entity.hamster.idle_full");
//TODO
SoundEvent HAMSTER_AMBIENT_CALL = register("entity.hamster.idle_call");
SoundEvent HAMSTER_STEP = register("entity.hamster.step");
//TODO
SoundEvent HAMSTER_HURT = register("entity.hamster.hurt");
//TODO
SoundEvent HAMSTER_EAT = register("entity.hamster.eat");
//TODO
SoundEvent HAMSTER_DEATH = register("entity.hamster.death");
//TODO
SoundEvent SUNFLOWER_SEED_PICKUP = register("block.sunflower.seed_pickup");
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/assets/spawn/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
"block.spawn.sunflower": "Sunflower",
"item.spawn.sunflower_seeds": "Sunflower Seeds",
"item.spawn.roasted_sunflower_seeds": "Roasted Sunflower Seeds",
"subtitles.entity.hamster.death": "Hamster dies",
"subtitles.entity.hamster.eat": "Hamster munches",
"subtitles.entity.hamster.hurt": "Hamster hurts",
"subtitles.entity.hamster.step": "Hamster scurries",
"subtitles.entity.hamster.idle": "Hamster chatters",
"subtitles.entity.hamster.idle_call": "Hamster calls",

"entity.spawn.ant": "Ant",
"item.spawn.ant_spawn_egg": "Ant Spawn Egg",
Expand Down
57 changes: 57 additions & 0 deletions src/main/resources/assets/spawn/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,62 @@
"spawn:block/mucus/light2"
],
"subtitle": "subtitles.block.generic.footsteps"
},
"entity.hamster.idle": {
"sounds": [
"spawn:entity/hamster/idle1",
"spawn:entity/hamster/idle2",
"spawn:entity/hamster/idle3",
"spawn:entity/hamster/idle4",
"spawn:entity/hamster/idle5",
"spawn:entity/hamster/idle6"
],
"subtitle": "subtitles.entity.hamster.idle"
},
"entity.hamster.idle_call": {
"sounds": [
"spawn:entity/hamster/call1",
"spawn:entity/hamster/call2",
"spawn:entity/hamster/call3",
"spawn:entity/hamster/call4",
"spawn:entity/hamster/call5"
],
"subtitle": "subtitles.entity.hamster.idle_call"
},
"entity.hamster.step": {
"sounds": [
"spawn:entity/hamster/step1",
"spawn:entity/hamster/step2",
"spawn:entity/hamster/step3",
"spawn:entity/hamster/step4",
"spawn:entity/hamster/step5",
"spawn:entity/hamster/step6",
"spawn:entity/hamster/step7",
"spawn:entity/hamster/step8"
],
"subtitle": "subtitles.entity.hamster.step"
},
"entity.hamster.hurt": {
"sounds": [
"spawn:entity/hamster/hurt1",
"spawn:entity/hamster/hurt2",
"spawn:entity/hamster/hurt3"
],
"subtitle": "subtitles.entity.hamster.hurt"
},
"entity.hamster.death": {
"sounds": [
"spawn:entity/hamster/death"
],
"subtitle": "subtitles.entity.hamster.death"
},
"entity.hamster.eat": {
"sounds": [
"spawn:entity/hamster/eat1",
"spawn:entity/hamster/eat2",
"spawn:entity/hamster/eat3",
"spawn:entity/hamster/eat4"
],
"subtitle": "subtitles.entity.hamster.eat"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 990febf

Please sign in to comment.