Skip to content

Commit

Permalink
Add missing soundevent
Browse files Browse the repository at this point in the history
  • Loading branch information
ManaStar committed Nov 14, 2023
1 parent e0557c8 commit 12f6009
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/generated/resources/assets/sullysmod/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"subtitles.entity.tortoise.hurt_baby": "Tortoise baby hurts",
"subtitles.entity.tortoise_shell.place": "Tortoise Shell placed",
"subtitles.entity.zombie.destroy_egg": "Egg stomped",
"subtitles.item.vial.harvest": "Vial fills",
"subtitles.item.vial.fill": "Vial fills",
"subtitles.item.vial.shatter": "Vial shatters",
"sullysmod.jei.grindstone_polishing": "Polishing",
"sullysmod.jei.grindstone_polishing.info": "Right click to polish",
Expand Down
36 changes: 33 additions & 3 deletions src/generated/resources/assets/sullysmod/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,41 @@
],
"subtitle": "subtitles.entity.tortoise_shell.place"
},
"item.vial.fill": {
"sounds": [
{
"name": "item/bottle/fill1",
"pitch": 1.3
},
{
"name": "item/bottle/fill2",
"pitch": 1.3
},
{
"name": "item/bottle/fill3",
"pitch": 1.3
},
{
"name": "item/bottle/fill4",
"pitch": 1.3
}
],
"subtitle": "subtitles.item.vial.fill"
},
"item.vial.shatter": {
"sounds": [
"random/glass1",
"random/glass2",
"random/glass3"
{
"name": "random/glass1",
"pitch": 1.3
},
{
"name": "random/glass2",
"pitch": 1.3
},
{
"name": "random/glass3",
"pitch": 1.3
}
],
"subtitle": "subtitles.item.vial.shatter"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livi
player.awardStat(Stats.ITEM_USED.get(this));
if (!player.getAbilities().instabuild) {
stack.shrink(1);
level.playSound(null, livingEntity.getOnPos(), SMSounds.VIAL_SHATTERS.get(), SoundSource.NEUTRAL, 1.0F, 1.3F);
level.playSound(null, livingEntity.getOnPos(), SMSounds.VIAL_SHATTERS.get(), SoundSource.NEUTRAL, 1.0F, 1.0F);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.uraneptus.sullysmod.common.entities.JungleSpider;
import com.uraneptus.sullysmod.core.registry.SMItems;
import com.uraneptus.sullysmod.core.registry.SMSounds;
import net.minecraft.sounds.SoundSource;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
Expand All @@ -22,6 +24,8 @@ public InteractionResult interactLivingEntity(ItemStack stack, Player player, Li
vialStack.getOrCreateTag().putString("beneficialEffect", ForgeRegistries.MOB_EFFECTS.getKey(jungleSpider.getBeneficialVenomEffect()).toString());
vialStack.getOrCreateTag().putString("harmfulEffect", ForgeRegistries.MOB_EFFECTS.getKey(jungleSpider.getHarmfulVenomEffect()).toString());


player.level().playSound(target, target.getOnPos(), SMSounds.VIAL_FILLS.get(), SoundSource.NEUTRAL, 1.0F, 1.0F);
this.turnVialIntoItem(stack, player, vialStack);
return InteractionResult.sidedSuccess(player.level().isClientSide);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected void addTranslations() {

//Subtitles
add("subtitles.item.vial.shatter", "Vial shatters");
add("subtitles.item.vial.harvest", "Vial fills");
add("subtitles.item.vial.fill", "Vial fills");

add("subtitles.block.grindstone.polish_jade", "Grindstone polishes");
add("subtitles.block.jade.ricochet", "Projectile ricochets");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ public void registerSounds() {

//Item Sounds
addbasicSound(SMSounds.VIAL_SHATTERS,
sound("random/glass1"),
sound("random/glass2"),
sound("random/glass3")
sound("random/glass1").pitch(1.3F),
sound("random/glass2").pitch(1.3F),
sound("random/glass3").pitch(1.3F)
);
addbasicSound(SMSounds.VIAL_FILLS,
sound("item/bottle/fill1").pitch(1.3F),
sound("item/bottle/fill2").pitch(1.3F),
sound("item/bottle/fill3").pitch(1.3F),
sound("item/bottle/fill4").pitch(1.3F)
);

//Block Sounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class SMSounds {
//Item Sounds
public static final RegistryObject<SoundEvent> POLISH_JADE = HELPER.createSoundEvent("block.grindstone.polish_jade");
public static final RegistryObject<SoundEvent> VIAL_SHATTERS = HELPER.createSoundEvent("item.vial.shatter");
public static final RegistryObject<SoundEvent> VIAL_FILLS = HELPER.createSoundEvent("item.vial.fill");

//Block Sounds
public static final RegistryObject<SoundEvent> JADE_RICOCHET = HELPER.createSoundEvent("block.jade.ricochet");
Expand Down

0 comments on commit 12f6009

Please sign in to comment.