Skip to content

Commit

Permalink
fix #476 (bug introduced in ba90280), add a sound effect for when you…
Browse files Browse the repository at this point in the history
… clear it too, and swing arm
  • Loading branch information
gamma-delta committed Nov 19, 2024
1 parent 27c1c6e commit d0ac296
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Pla
if (usedStack.isEmpty() && pPlayer.isDiscrete()) {
tile.clearPlayer();
tile.sync();
pLevel.playSound(null, pPos, HexSounds.IMPETUS_REDSTONE_CLEAR, SoundSource.BLOCKS, 1f, 1f);
return InteractionResult.sidedSuccess(pLevel.isClientSide);
} else {
var datumContainer = IXplatAbstractions.INSTANCE.findDataHolder(usedStack);
if (datumContainer != null) {
Expand All @@ -60,8 +62,9 @@ public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Pla
tile.setPlayer(player.getGameProfile(), entity.getUUID());
tile.sync();

pLevel.playSound(pPlayer, pPos, HexSounds.IMPETUS_REDSTONE_DING,
pLevel.playSound(null, pPos, HexSounds.IMPETUS_REDSTONE_DING,
SoundSource.BLOCKS, 1f, 1f);
return InteractionResult.sidedSuccess(pLevel.isClientSide);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static void registerSounds(BiConsumer<SoundEvent, ResourceLocation> r) {

public static final SoundEvent IMPETUS_LOOK_TICK = sound("impetus.fletcher.tick");
public static final SoundEvent IMPETUS_REDSTONE_DING = sound("impetus.redstone.register");
public static final SoundEvent IMPETUS_REDSTONE_CLEAR = sound("impetus.redstone.clear");

public static final SoundEvent READ_LORE_FRAGMENT = sound("lore_fragment.read");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@
"scroll.scribble": "Scroll is scribbled",
"impetus.fletcher.tick": "Fletcher Impetus ticks",
"impetus.redstone.register": "Cleric Impetus dings",
"impetus.redstone.clear": "Cleric Impetus clears",
"lore_fragment.read": "Read lore fragment",
"flight.ambience": "Player flies",
"flight.finish": "Flight ends",
Expand Down
6 changes: 6 additions & 0 deletions Common/src/main/resources/assets/hexcasting/sounds.json5
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
],
"subtitle": "hexcasting.subtitles.impetus.redstone.register"
},
"impetus.redstone.clear": {
"sounds": [
"hexcasting:cast/fail"
],
"subtitle": "hexcasting.subtitles.impetus.redstone.clear"
},

"lore_fragment.read": {
"sounds": [
Expand Down

0 comments on commit d0ac296

Please sign in to comment.