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

Merge pull request #64 from HugoDaBosss/master

Fixed double placing sound and small packet finding optimization. (I suck at github)
Dieser Commit ist enthalten in:
Myles 2016-03-03 10:04:33 +00:00
Commit 8f132fed14
3 geänderte Dateien mit 13 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -170,7 +170,7 @@ public enum PacketType {
if(id == -1) if(id == -1)
return null; return null;
for (PacketType pt : values()) { for (PacketType pt : values()) {
if (pt.getNewPacketID() == id && id != -1 if (pt.getNewPacketID() == id
&& pt.getState() == state && pt.getState() == state
&& pt.getDirection() == direction) && pt.getDirection() == direction)
return pt; return pt;
@ -182,7 +182,7 @@ public enum PacketType {
if(id == -1) if(id == -1)
return null; return null;
for (PacketType pt : values()) { for (PacketType pt : values()) {
if (pt.getPacketID() == id && id != -1 if (pt.getPacketID() == id
&& pt.getState() == state && pt.getState() == state
&& pt.getDirection() == direction) && pt.getDirection() == direction)
return pt; return pt;

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,8 @@ public enum SoundEffect {
return cat; return cat;
} }
public boolean isBreakPlaceSound() {
return breaksound;
}
} }

Datei anzeigen

@ -59,6 +59,11 @@ 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();
} }