Skip to content

Commit

Permalink
Envoy sound definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXBlade committed Nov 2, 2024
1 parent 09fdc9a commit 56438bc
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.nbt.NbtCompound;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.LocalDifficulty;
import net.minecraft.world.World;
Expand Down Expand Up @@ -56,14 +57,29 @@ public void tick() {
}

protected SoundEvent getHurtSound(DamageSource source) {
return this.getEnlightened() ? ParadiseLostSoundEvents.ENTITY_ENVOY_DAMAGE : super.getHurtSound(source);
return this.getEnlightened() ? ParadiseLostSoundEvents.ENTITY_ENVOY_ENLIGHTENED_HURT : ParadiseLostSoundEvents.ENTITY_ENVOY_HURT;
}

protected SoundEvent getDeathSound() {
return this.getEnlightened() ? ParadiseLostSoundEvents.ENTITY_ENVOY_ENLIGHTENED_DEATH : ParadiseLostSoundEvents.ENTITY_ENVOY_DEATH;
}

protected SoundEvent getStepSound() {
return this.getEnlightened() ? ParadiseLostSoundEvents.ENTITY_ENVOY_ENLIGHTENED_STEP : ParadiseLostSoundEvents.ENTITY_ENVOY_STEP;
}

protected SoundEvent getAmbientSound() {
return this.getEnlightened() ? ParadiseLostSoundEvents.ENTITY_ENVOY_ENLIGHTENED_AMBIENT : ParadiseLostSoundEvents.ENTITY_ENVOY_AMBIENT;
}

public boolean damage(DamageSource source, float amount) {
float dmg = amount;
if (this.getEnlightened()) {
dmg /= 2;
}
if (this.isAffectedByDaylight()) {
dmg *= 3f;
}
return super.damage(source, dmg);
}

Expand All @@ -79,7 +95,10 @@ public boolean tryAttack(Entity target) {
}
public static DefaultAttributeContainer.Builder createEnvoyAttributes() {
return createHostileAttributes()
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.2D);
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.2D)
.add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, -1)
.add(EntityAttributes.GENERIC_SCALE, 1.1f);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ public boolean canJump() {

@Override
public void startJumping(int height) {
if (!isGliding()){
if (!isGliding()) {
this.getWorld().playSound(null, this.getX(), this.getY(), this.getZ(), ParadiseLostSoundEvents.ENTITY_MOA_GLIDING, SoundCategory.NEUTRAL, 0.25F, getRandomFloat(0.64f,0.69f));
}
this.jumping = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@ public final class ParadiseLostSoundEvents {
public static final SoundEvent ENTITY_MOA_EGG_HATCH = register("entity.moa.egg_hatch");
public static final SoundEvent ENTITY_MOA_STEP = register("entity.moa.step");

public static final SoundEvent ENTITY_ENVOY_AMBIENT = register(("entity.envoy.ambient"));
public static final SoundEvent ENTITY_ENVOY_HURT = register(("entity.envoy.hurt"));
public static final SoundEvent ENTITY_ENVOY_DEATH = register(("entity.envoy.death"));
public static final SoundEvent ENTITY_ENVOY_STEP = register(("entity.envoy.step"));
public static final SoundEvent ENTITY_ENVOY_GETS_ENLIGHTENED = register(("entity.envoy.gets_enlightened"));
public static final SoundEvent ENTITY_ENVOY_ENLIGHTENED_AMBIENT = register(("entity.envoy.enlightened.ambient"));
public static final SoundEvent ENTITY_ENVOY_ENLIGHTENED_HURT = register(("entity.envoy.enlightened.hurt"));
public static final SoundEvent ENTITY_ENVOY_ENLIGHTENED_DEATH = register(("entity.envoy.enlightened.death"));
public static final SoundEvent ENTITY_ENVOY_ENLIGHTENED_STEP = register(("entity.envoy.enlightened.step"));

public static final SoundEvent ENTITY_NITRA_THROW = register("entity.nitra.throw");
public static final SoundEvent ENTITY_ENVOY_DAMAGE = register("entity.envoy.damage");

public static final SoundEvent MUSIC_PARADISE_LOST = register("music.paradise");

Expand Down
18 changes: 15 additions & 3 deletions src/main/resources/assets/paradise_lost/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,17 +399,29 @@
"subtitles.paradise_lost.block.orange_leaves.break_differently": "Orange leaves broken",

"subtitles.paradise_lost.entity.moa.ambient": "Moa chirps",
"subtitles.paradise_lost.entity.moa.ambient.sing": "Moa sings",
"subtitles.paradise_lost.entity.moa.gliding": "Moa glides",
"subtitles.paradise_lost.entity.moa.death": "Moa dies",
"subtitles.paradise_lost.entity.moa.hurt": "Moa hurts",
"subtitles.paradise_lost.entity.moa.eat": "Moa eats",
"subtitles.paradise_lost.entity.moa.lay_egg": "Moa lays egg",
"subtitles.paradise_lost.entity.moa.egg_hatch": "Moa egg hatches",
"subtitles.paradise_lost.entity.moa.step": "Moa walks",



"subtitles.paradise_lost.entity.envoy.ambient": "Envoy rattles",
"subtitles.paradise_lost.entity.envoy.step": "Envoy walks",
"subtitles.paradise_lost.entity.envoy.hurt": "Envoy hurts",
"subtitles.paradise_lost.entity.envoy.death": "Envoy dies",
"subtitles.paradise_lost.entity.envoy.gets_enlightened": "Envoy becomes Enlightened",
"subtitles.paradise_lost.entity.envoy.enlightened.ambient": "Enlightened chimes",
"subtitles.paradise_lost.entity.envoy.enlightened.step": "Enlightened walks",
"subtitles.paradise_lost.entity.envoy.enlightened.hurt": "Enlightened hurts",
"subtitles.paradise_lost.entity.envoy.enlightened.death": "Enlightened dies",



"subtitles.paradise_lost.entity.nitra.throw": "Nitra Flies",

"subtitles.paradise_lost.entity.moa.step": "Moa walks",

"subtitles.paradise_lost.item.armor.equip.olvite": "Olvite armor clanks",
"subtitles.paradise_lost.item.armor.equip.glazed_gold": "Glazed Gold armor clinks",
Expand Down
77 changes: 75 additions & 2 deletions src/main/resources/assets/paradise_lost/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,91 @@
],
"subtitle": "subtitles.paradise_lost.entity.nitra.throw"
},
"entity.envoy.damage": {
"entity.envoy.ambient": {
"sounds": [
{
"name": "entity.skeleton.ambient",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.ambient"
},
"entity.envoy.step": {
"sounds": [
{
"name": "entity.skeleton.step",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.step"
},
"entity.envoy.hurt": {
"sounds": [
{
"name": "entity.skeleton.hurt",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.hurt"
},
"entity.envoy.death": {
"sounds": [
{
"name": "entity.wither_skeleton.death",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.death"
},
"entity.envoy.gets_enlightened": {
"sounds": [
{
"name": "entity.zombie_villager.converted",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.enlightened.ambient"
},
"entity.envoy.enlightened.ambient": {
"sounds": [
{
"name": "block.amethyst_block.chime",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.enlightened.ambient"
},
"entity.envoy.enlightened.step": {
"sounds": [
{
"name": "block.amethyst_block.step",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.enlightened.step"
},
"entity.envoy.enlightened.hurt": {
"sounds": [
{
"name": "block.amethyst_block.hit",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.enlightened.hurt"
},
"entity.envoy.enlightened.death": {
"sounds": [
{
"name": "block.amethyst_block.break",
"type": "event"
}
],
"subtitle": "subtitles.paradise_lost.entity.envoy.damage"
"subtitle": "subtitles.paradise_lost.entity.envoy.enlightened.death"
},




"music.paradise": {
"sounds": [
{
Expand Down

0 comments on commit 56438bc

Please sign in to comment.