-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏷 4.0.0: Remove logs and selectable ToggleSaraShow/Hide
Packets are backwards-compatible, but APIs are not.
- Loading branch information
1 parent
28a287f
commit 60cbce0
Showing
13 changed files
with
176 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
.../net/azisaba/azipluginmessaging/api/protocol/message/ProxyboundToggleSaraHideMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package net.azisaba.azipluginmessaging.api.protocol.message; | ||
|
||
import net.azisaba.azipluginmessaging.api.entity.Player; | ||
import net.azisaba.azipluginmessaging.api.entity.SimplePlayer; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.io.DataInputStream; | ||
import java.io.DataOutputStream; | ||
import java.io.IOException; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class ProxyboundToggleSaraHideMessage extends PlayerMessage { | ||
private final Set<Long> groups; | ||
|
||
public ProxyboundToggleSaraHideMessage(@NotNull Player player, @NotNull Set<Long> groups) { | ||
super(player); | ||
this.groups = groups; | ||
} | ||
|
||
@NotNull | ||
public Set<Long> getGroups() { | ||
return groups; | ||
} | ||
|
||
@Override | ||
public void write(@NotNull DataOutputStream out) throws IOException { | ||
super.write(out); | ||
out.writeInt(groups.size()); | ||
for (long group : groups) { | ||
out.writeLong(group); | ||
} | ||
} | ||
|
||
public static @NotNull ProxyboundToggleSaraHideMessage read(@NotNull DataInputStream in) throws IOException { | ||
Player player = SimplePlayer.read(in); | ||
if (in.available() == 0) { | ||
// backward compatibility | ||
return new ProxyboundToggleSaraHideMessage(player, Collections.emptySet()); | ||
} | ||
int size = in.readInt(); | ||
Set<Long> groups = new HashSet<>(size); | ||
for (int i = 0; i < size; i++) { | ||
groups.add(in.readLong()); | ||
} | ||
return new ProxyboundToggleSaraHideMessage(player, groups); | ||
} | ||
} |
Oops, something went wrong.