-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
15 changed files
with
577 additions
and
33 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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/me/catcoder/sidebar/protocol/ScoreNumberFormat.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,32 @@ | ||
package me.catcoder.sidebar.protocol; | ||
|
||
import com.google.common.base.Preconditions; | ||
import me.catcoder.sidebar.util.buffer.NetOutput; | ||
|
||
import java.util.function.BiConsumer; | ||
|
||
public enum ScoreNumberFormat implements BiConsumer<NetOutput, String> { | ||
|
||
BLANK { | ||
@Override | ||
public void accept(NetOutput out, String value) { | ||
out.writeVarInt(0); | ||
} | ||
}, | ||
STYLED { | ||
@Override | ||
public void accept(NetOutput netOutput, String value) { | ||
netOutput.writeVarInt(1); | ||
Preconditions.checkArgument(value != null, "Value cannot be null for STYLED format"); | ||
netOutput.writeComponent(value); | ||
} | ||
}, | ||
FIXED { | ||
@Override | ||
public void accept(NetOutput out, String value) { | ||
out.writeVarInt(2); | ||
Preconditions.checkArgument(value != null, "Value cannot be null for FIXED format"); | ||
out.writeComponent(value); | ||
} | ||
} | ||
} |
Oops, something went wrong.