mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Merge pull request #64 from HugoDaBosss/master
Fixed double placing sound and small packet finding optimization. (I suck at github)
This commit is contained in:
commit
8f132fed14
@ -170,7 +170,7 @@ public enum PacketType {
|
||||
if(id == -1)
|
||||
return null;
|
||||
for (PacketType pt : values()) {
|
||||
if (pt.getNewPacketID() == id && id != -1
|
||||
if (pt.getNewPacketID() == id
|
||||
&& pt.getState() == state
|
||||
&& pt.getDirection() == direction)
|
||||
return pt;
|
||||
@ -182,7 +182,7 @@ public enum PacketType {
|
||||
if(id == -1)
|
||||
return null;
|
||||
for (PacketType pt : values()) {
|
||||
if (pt.getPacketID() == id && id != -1
|
||||
if (pt.getPacketID() == id
|
||||
&& pt.getState() == state
|
||||
&& pt.getDirection() == direction)
|
||||
return pt;
|
||||
|
@ -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,9 @@ public enum SoundEffect {
|
||||
public SoundCategory getCategory() {
|
||||
return cat;
|
||||
}
|
||||
|
||||
public boolean isBreakPlaceSound() {
|
||||
return breaksound;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -59,6 +59,11 @@ 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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user