Skip to content

Commit

Permalink
Fix fake wither sound not playing
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Cysteine committed Apr 9, 2024
1 parent 78a7cb8 commit ea2289d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ public enum WarpEventRegistry {
new PotionEffect(Potion.hunger.id, 30 * 20, 2),
new PotionEffect(Potion.moveSlowdown.id, 30 * 20, 2)),
"WitherPotion", "wither potion", true, 80, false, false),
FAKE_ENDERMAN(warp -> new WarpFakeSoundBehind("fakeenderman", warp, "mob.endermen.stare", 2, 1.5f, 0.1f),
"FakeEnderman", "fake enderman", true, 35, false, false),
FAKE_WITHER(warp -> new WarpFakeSoundBehind("fakewither", warp, "mob.wither.spawn", 2), "FakeWither", "fake wither",
true, 150, false, false),
FAKE_ENDERMAN(warp -> new WarpFakeSound("fakeenderman", warp, "mob.endermen.stare", 0, 1.5f, 0.1f), "FakeEnderman",
"fake enderman", true, 35, false, false),
FAKE_WITHER(warp -> new WarpFakeSound("fakewither", warp, "warptheory:fakewither", 0, 1.5f, 0.9f), "FakeWither",
"fake wither", true, 150, false, false),

// Requires GregTech
GREGTECH_FAKE_SOUND(WarpGregTechFakeSound::new, "GregTechFakeSound", "GregTech fake sound", true, 30, false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public void sendChatMessage(EntityPlayer player) {

@Override
public int triggerEvent(int eventAmount, World world, EntityPlayer player) {
if (distance == 0) {
world.playSoundEffect(player.posX, player.posY, player.posZ, sound, volume, pitch);
return 1;
}

// (-distance, distance) swing
// [0, 2*distance] - distance ~= [-distance, distance] more or less
int targetX = (int) player.posX + world.rand.nextInt(2 * distance) - (distance);
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/assets/warptheory/sounds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"fakewither": {
"category": "hostile",
"sounds": [
"WitherSpawn"
]
}
}
Binary file not shown.

0 comments on commit ea2289d

Please sign in to comment.