3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 00:22:51 +01:00

Fixed double break sound

Dieser Commit ist enthalten in:
HugoDaBosss 2016-03-03 10:06:24 +01:00
Ursprung e4346611c9
Commit afb96c4878
2 geänderte Dateien mit 13 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -252,11 +252,13 @@ public enum SoundEffect {
private String name; private String name;
private String newname; private String newname;
private SoundCategory cat; private SoundCategory cat;
private boolean breaksound;
SoundEffect(String name, String newname, SoundCategory cat) { SoundEffect(String name, String newname, SoundCategory cat) {
this.cat = cat; this.cat = cat;
this.newname = newname; this.newname = newname;
this.name = name; this.name = name;
this.breaksound = name.startsWith("dig.");
} }
public static SoundEffect getByName(String name) { public static SoundEffect getByName(String name) {
@ -280,4 +282,9 @@ public enum SoundEffect {
return cat; return cat;
} }
public boolean isBreakPlaceSound()
{
return breaksound;
}
} }

Datei anzeigen

@ -59,6 +59,12 @@ public class OutgoingTransformer {
int catid = 0; int catid = 0;
String newname = name; String newname = name;
if (effect != null) { if (effect != null) {
if(effect.isBreakPlaceSound())
{
input.readBytes(input.readableBytes());
output.clear();
return;
}
catid = effect.getCategory().getId(); catid = effect.getCategory().getId();
newname = effect.getNewName(); newname = effect.getNewName();
} }