Skip to content

Commit

Permalink
feat(deco): sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeEchoCodes committed Nov 2, 2024
1 parent 3bda3b2 commit d001b0f
Show file tree
Hide file tree
Showing 17 changed files with 92 additions and 10 deletions.
31 changes: 31 additions & 0 deletions src/generated/resources/assets/armistice/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,37 @@
],
"subtitle": "sound.armistice.ambient.mecha2"
},
"block.armisteel.break": {
"sounds": [
"armistice:block/armisteel/break"
]
},
"block.armisteel.fall": {
"sounds": [
"armistice:block/armisteel/fall"
]
},
"block.armisteel.hit": {
"sounds": [
"armistice:block/armisteel/hit1",
"armistice:block/armisteel/hit2",
"armistice:block/armisteel/hit3",
"armistice:block/armisteel/hit4"
]
},
"block.armisteel.place": {
"sounds": [
"armistice:block/armisteel/place"
]
},
"block.armisteel.step": {
"sounds": [
"armistice:block/armisteel/step1",
"armistice:block/armisteel/step2",
"armistice:block/armisteel/step3",
"armistice:block/armisteel/step4"
]
},
"entity.mecha.boot": {
"sounds": [
"armistice:entity/mecha/boot"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,30 @@ public void registerSounds() {
add(ArmisticeSoundEventRegistrar.MUSIC$RECALLED, SoundDefinition.definition()
.with(sound(Armistice.id("music/recalled")))
.subtitle("sound.armistice.music.recalled"));

add(ArmisticeSoundEventRegistrar.BLOCK$ARMISTEEL$PLACE, SoundDefinition.definition()
.with(sound(Armistice.id("block/armisteel/place"))));

add(ArmisticeSoundEventRegistrar.BLOCK$ARMISTEEL$BREAK, SoundDefinition.definition()
.with(sound(Armistice.id("block/armisteel/break"))));

add(ArmisticeSoundEventRegistrar.BLOCK$ARMISTEEL$FALL, SoundDefinition.definition()
.with(sound(Armistice.id("block/armisteel/fall"))));

add(ArmisticeSoundEventRegistrar.BLOCK$ARMISTEEL$HIT, SoundDefinition.definition()
.with(
sound(Armistice.id("block/armisteel/hit1")),
sound(Armistice.id("block/armisteel/hit2")),
sound(Armistice.id("block/armisteel/hit3")),
sound(Armistice.id("block/armisteel/hit4"))
));

add(ArmisticeSoundEventRegistrar.BLOCK$ARMISTEEL$STEP, SoundDefinition.definition()
.with(
sound(Armistice.id("block/armisteel/step1")),
sound(Armistice.id("block/armisteel/step2")),
sound(Armistice.id("block/armisteel/step3")),
sound(Armistice.id("block/armisteel/step4"))
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,63 +26,63 @@ public final class ArmisticeBlockRegistrar implements BlockRegistrar {
public static final Block ARMISTEEL_PLATING = new Block(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
);

public static final Block CORRUGATED_ARMISTEEL = new Block(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
);

public static final Block ARMISTEEL_PIPING = new Block(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
);

public static final Block ARMISTEEL_VENT = new Block(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
);

public static final Block ARMISTEEL_MESH = new Block(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
);

public static final Block RIGIDIZED_ARMISTEEL = new Block(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
);

public static final Block ARMISTEEL_BLOCK = new Block(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
);

public static final Block ARMISTEEL_BULB = new CopperBulbBlock(
BlockBehaviour.Properties.of()
.strength(3.0F, 6.0F)
.sound(SoundType.NETHERITE_BLOCK)
.sound(ArmisticeSoundEventRegistrar.Types.ARMISTEEL)
.mapColor(MapColor.METAL)
.requiresCorrectToolForDrops()
.isRedstoneConductor((state, level, pos) -> false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public final class ArmisticeOrdnanceRegistrar implements OrdnanceRegistrar {
(core, pos) -> core.level().playSound(
null,
pos.x(), pos.y(), pos.z(),
SoundEvents.SNOWBALL_THROW,
ArmisticeSoundEventRegistrar.ENTITY$MECHA$WEAPON$HIGH_CAL,
SoundSource.HOSTILE
)
)
Expand Down Expand Up @@ -71,7 +71,7 @@ public final class ArmisticeOrdnanceRegistrar implements OrdnanceRegistrar {
core.level().playSound(
null,
pos.x(), pos.y(), pos.z(),
SoundEvents.WITHER_SHOOT,
ArmisticeSoundEventRegistrar.ENTITY$MECHA$WEAPON$LOW_CAL,
SoundSource.HOSTILE
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package symbolics.division.armistice.registry;

import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.level.block.SoundType;
import symbolics.division.armistice.Armistice;
import symbolics.division.armistice.util.registrar.SoundEventRegistrar;

Expand All @@ -22,4 +23,29 @@ public final class ArmisticeSoundEventRegistrar implements SoundEventRegistrar {

public static final SoundEvent MUSIC$RECALLED = SoundEvent.createVariableRangeEvent(Armistice.id("music.recalled"));

public static final SoundEvent BLOCK$ARMISTEEL$PLACE = SoundEvent.createVariableRangeEvent(Armistice.id("block.armisteel.place"));

public static final SoundEvent BLOCK$ARMISTEEL$BREAK = SoundEvent.createVariableRangeEvent(Armistice.id("block.armisteel.break"));

public static final SoundEvent BLOCK$ARMISTEEL$FALL = SoundEvent.createVariableRangeEvent(Armistice.id("block.armisteel.fall"));

public static final SoundEvent BLOCK$ARMISTEEL$HIT = SoundEvent.createVariableRangeEvent(Armistice.id("block.armisteel.hit"));

public static final SoundEvent BLOCK$ARMISTEEL$STEP = SoundEvent.createVariableRangeEvent(Armistice.id("block.armisteel.step"));


@SuppressWarnings("deprecation")
public static class Types {
public static final SoundType ARMISTEEL = new SoundType(
1.0F,
1.0F,
BLOCK$ARMISTEEL$BREAK,
BLOCK$ARMISTEEL$STEP,
BLOCK$ARMISTEEL$PLACE,
BLOCK$ARMISTEEL$HIT,
BLOCK$ARMISTEEL$FALL
);
}


}
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 d001b0f

Please sign in to comment.