Skip to content

Commit d0ac296

Browse files
committed
fix #476 (bug introduced in ba90280), add a sound effect for when you clear it too, and swing arm
1 parent 27c1c6e commit d0ac296

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/impetuses/BlockRedstoneImpetus.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Pla
4949
if (usedStack.isEmpty() && pPlayer.isDiscrete()) {
5050
tile.clearPlayer();
5151
tile.sync();
52+
pLevel.playSound(null, pPos, HexSounds.IMPETUS_REDSTONE_CLEAR, SoundSource.BLOCKS, 1f, 1f);
53+
return InteractionResult.sidedSuccess(pLevel.isClientSide);
5254
} else {
5355
var datumContainer = IXplatAbstractions.INSTANCE.findDataHolder(usedStack);
5456
if (datumContainer != null) {
@@ -60,8 +62,9 @@ public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Pla
6062
tile.setPlayer(player.getGameProfile(), entity.getUUID());
6163
tile.sync();
6264

63-
pLevel.playSound(pPlayer, pPos, HexSounds.IMPETUS_REDSTONE_DING,
65+
pLevel.playSound(null, pPos, HexSounds.IMPETUS_REDSTONE_DING,
6466
SoundSource.BLOCKS, 1f, 1f);
67+
return InteractionResult.sidedSuccess(pLevel.isClientSide);
6568
}
6669
}
6770
}

Common/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public static void registerSounds(BiConsumer<SoundEvent, ResourceLocation> r) {
4242

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

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

Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@
606606
"scroll.scribble": "Scroll is scribbled",
607607
"impetus.fletcher.tick": "Fletcher Impetus ticks",
608608
"impetus.redstone.register": "Cleric Impetus dings",
609+
"impetus.redstone.clear": "Cleric Impetus clears",
609610
"lore_fragment.read": "Read lore fragment",
610611
"flight.ambience": "Player flies",
611612
"flight.finish": "Flight ends",

Common/src/main/resources/assets/hexcasting/sounds.json5

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@
132132
],
133133
"subtitle": "hexcasting.subtitles.impetus.redstone.register"
134134
},
135+
"impetus.redstone.clear": {
136+
"sounds": [
137+
"hexcasting:cast/fail"
138+
],
139+
"subtitle": "hexcasting.subtitles.impetus.redstone.clear"
140+
},
135141

136142
"lore_fragment.read": {
137143
"sounds": [

0 commit comments

Comments
 (0)