Fixed sound3 being used in places where it shouldn't and tweaked a bit minecart's sounds

master
Wynd 2023-04-03 01:26:58 +03:00
parent 69c104a994
commit 3ba4f0ea12
4 changed files with 9 additions and 6 deletions

View File

@ -102,7 +102,7 @@ After:<br>
</details> </details>
<details><summary>Fixed leg armor not being updated while riding</summary> <details><summary>Fixes leg armor not being updated while riding</summary>
Before:<br> Before:<br>
<video controls src="https://i.imgur.com/UX9nfs8.mp4" /> <video controls src="https://i.imgur.com/UX9nfs8.mp4" />

View File

@ -5,7 +5,7 @@ import java.util.Random;
import net.minecraft.entity.player.Player; import net.minecraft.entity.player.Player;
import net.minecraft.item.ItemInstance; import net.minecraft.item.ItemInstance;
import net.minecraft.item.ItemType; import net.minecraft.tile.Tile;
public class WyHelper { public class WyHelper {
@ -31,8 +31,10 @@ public class WyHelper {
// player.level.playLevelEvent((Player)null, 1005, (int)player.x, (int)player.y, (int)player.z, 0); // player.level.playLevelEvent((Player)null, 1005, (int)player.x, (int)player.y, (int)player.z, 0);
player.dropItem(new ItemInstance(ItemType.boat, 1), false); player.dropItem(new ItemInstance(Tile.REDSTONE_TORCH_LIT, 64), false);
player.dropItem(new ItemInstance(Tile.RAIL, 64), false);
player.dropItem(new ItemInstance(Tile.GOLDEN_RAIL, 64), false);
// Skeleton enemy = new Skeleton(player.level); // Skeleton enemy = new Skeleton(player.level);
// enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f); // enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f);
// player.level.spawnEntity(enemy); // player.level.spawnEntity(enemy);

View File

@ -34,7 +34,7 @@ public class MinecartMixin {
} }
if (speed >= 0.01D) { if (speed >= 0.01D) {
if (minecart.field_1645 % 25 == 1) { if (minecart.field_1645 % 34 == 1) {
minecart.level.playSound(x, y, z, "minecart.base", volume, pitch); minecart.level.playSound(x, y, z, "minecart.base", volume, pitch);
} }
} }

View File

@ -17,7 +17,8 @@ public class MinecraftMixin {
int split = string.indexOf("/"); int split = string.indexOf("/");
String type = string.substring(0, split); String type = string.substring(0, split);
String newSound = string.substring(split + 1); String newSound = string.substring(split + 1);
if (type.equalsIgnoreCase("sound3")) { // For now only allow the minecart sounds, allowing all of them causes weird effects with same name sounds when the game decides which one to use
if (type.equalsIgnoreCase("sound3") && newSound.startsWith("minecart/")) {
mc.soundHelper.method_2011(newSound, file); mc.soundHelper.method_2011(newSound, file);
} }
} }