Fixed double break sound

This commit is contained in:
HugoDaBosss 2016-03-03 10:06:24 +01:00
parent e4346611c9
commit afb96c4878
2 changed files with 13 additions and 0 deletions

View File

@ -252,11 +252,13 @@ public enum SoundEffect {
private String name;
private String newname;
private SoundCategory cat;
private boolean breaksound;
SoundEffect(String name, String newname, SoundCategory cat) {
this.cat = cat;
this.newname = newname;
this.name = name;
this.breaksound = name.startsWith("dig.");
}
public static SoundEffect getByName(String name) {
@ -279,5 +281,10 @@ public enum SoundEffect {
public SoundCategory getCategory() {
return cat;
}
public boolean isBreakPlaceSound()
{
return breaksound;
}
}

View File

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