-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added version support from 1.13.* to 1.19.*.
- Loading branch information
Showing
12 changed files
with
437 additions
and
143 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
83 changes: 83 additions & 0 deletions
83
api/src/main/java/ru/xezard/glow/packets/AbstractWrapperPlayServerScoreboardTeam.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,83 @@ | ||
package ru.xezard.glow.packets; | ||
|
||
import com.comphenix.protocol.PacketType; | ||
import com.comphenix.protocol.events.PacketContainer; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public abstract class AbstractWrapperPlayServerScoreboardTeam | ||
extends AbstractPacket | ||
implements IWrapperPlayServerScoreboardTeam { | ||
public static final PacketType TYPE = PacketType.Play.Server.SCOREBOARD_TEAM; | ||
|
||
public AbstractWrapperPlayServerScoreboardTeam() { | ||
super(new PacketContainer(TYPE), TYPE); | ||
|
||
this.handle.getModifier().writeDefaults(); | ||
} | ||
|
||
public AbstractWrapperPlayServerScoreboardTeam(PacketContainer packet) { | ||
super(packet, TYPE); | ||
} | ||
|
||
@Override | ||
public AbstractPacket getPacket() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public String getTeamName() { | ||
return this.handle.getStrings().read(0); | ||
} | ||
|
||
@Override | ||
public void setTeamName(String value) { | ||
this.handle.getStrings().write(0, value); | ||
} | ||
|
||
@Override | ||
public Mode getMode() { | ||
return Mode.values()[this.handle.getIntegers().read(0)]; | ||
} | ||
|
||
@Override | ||
public void setMode(Mode value) { | ||
this.handle.getIntegers().write(0, value.ordinal()); | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
public List<String> getPlayers() { | ||
return (List<String>) this.handle.getSpecificModifier(Collection.class) | ||
.read(0); | ||
} | ||
|
||
@Override | ||
public void setPlayers(List<String> value) { | ||
this.handle.getSpecificModifier(Collection.class) | ||
.write(0, value); | ||
} | ||
|
||
public enum Mode { | ||
TEAM_CREATED, | ||
TEAM_REMOVED, | ||
TEAM_UPDATED, | ||
PLAYERS_ADDED, | ||
PLAYERS_REMOVED | ||
} | ||
|
||
public enum NameTagVisibility { | ||
ALWAYS, | ||
HIDE_FOR_OTHER_TEAMS, | ||
HIDE_FOR_OWN_TEAM, | ||
NEVER | ||
} | ||
|
||
public enum CollisionRule { | ||
ALWAYS, | ||
PUSH_OTHER_TEAMS, | ||
PUSH_OWN_TEAM, | ||
NEVER | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
api/src/main/java/ru/xezard/glow/packets/IWrapperPlayServerScoreboardTeam.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,47 @@ | ||
package ru.xezard.glow.packets; | ||
|
||
import com.comphenix.protocol.wrappers.WrappedChatComponent; | ||
import org.bukkit.ChatColor; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface IWrapperPlayServerScoreboardTeam { | ||
AbstractPacket getPacket(); | ||
|
||
String getTeamName(); | ||
|
||
void setTeamName(String value); | ||
|
||
AbstractWrapperPlayServerScoreboardTeam.Mode getMode(); | ||
|
||
void setMode(AbstractWrapperPlayServerScoreboardTeam.Mode value); | ||
|
||
Optional<WrappedChatComponent> getDisplayName(); | ||
|
||
void setDisplayName(WrappedChatComponent value); | ||
|
||
Optional<WrappedChatComponent> getPrefix(); | ||
|
||
void setPrefix(WrappedChatComponent value); | ||
|
||
Optional<WrappedChatComponent> getSuffix(); | ||
|
||
void setSuffix(WrappedChatComponent value); | ||
|
||
AbstractWrapperPlayServerScoreboardTeam.NameTagVisibility getNameTagVisibility(); | ||
|
||
void setNameTagVisibility(AbstractWrapperPlayServerScoreboardTeam.NameTagVisibility value); | ||
|
||
Optional<ChatColor> getColor(); | ||
|
||
void setColor(ChatColor value); | ||
|
||
AbstractWrapperPlayServerScoreboardTeam.CollisionRule getCollisionRule(); | ||
|
||
void setCollisionRule(AbstractWrapperPlayServerScoreboardTeam.CollisionRule value); | ||
|
||
List<String> getPlayers(); | ||
|
||
void setPlayers(List<String> value); | ||
} |
Oops, something went wrong.