-
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.
- Loading branch information
1 parent
f48b243
commit e4e5bc1
Showing
12 changed files
with
893 additions
and
12 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
324 changes: 324 additions & 0 deletions
324
...c/main/java/de/oliver/fancysitula/api/packets/FS_ClientboundCreateOrUpdateTeamPacket.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,324 @@ | ||
package de.oliver.fancysitula.api.packets; | ||
|
||
import de.oliver.fancysitula.api.teams.FS_CollisionRule; | ||
import de.oliver.fancysitula.api.teams.FS_NameTagVisibility; | ||
import net.kyori.adventure.text.Component; | ||
|
||
import java.util.List; | ||
|
||
public abstract class FS_ClientboundCreateOrUpdateTeamPacket extends FS_ClientboundPacket { | ||
|
||
protected Method method; | ||
protected String teamName; | ||
|
||
protected CreateTeam createTeam; | ||
protected RemoveTeam removeTeam; | ||
protected UpdateTeam updateTeam; | ||
protected AddEntity addEntity; | ||
protected RemoveEntity removeEntity; | ||
|
||
public FS_ClientboundCreateOrUpdateTeamPacket(String teamName, CreateTeam createTeam) { | ||
this.method = Method.CREATE_TEAM; | ||
this.teamName = teamName; | ||
this.createTeam = createTeam; | ||
} | ||
|
||
public FS_ClientboundCreateOrUpdateTeamPacket(String teamName, RemoveTeam removeTeam) { | ||
this.method = Method.REMOVE_TEAM; | ||
this.teamName = teamName; | ||
this.removeTeam = removeTeam; | ||
} | ||
|
||
public FS_ClientboundCreateOrUpdateTeamPacket(String teamName, UpdateTeam updateTeam) { | ||
this.method = Method.UPDATE_TEAM; | ||
this.teamName = teamName; | ||
this.updateTeam = updateTeam; | ||
} | ||
|
||
public FS_ClientboundCreateOrUpdateTeamPacket(String teamName, AddEntity addEntity) { | ||
this.method = Method.ADD_ENTITY; | ||
this.teamName = teamName; | ||
this.addEntity = addEntity; | ||
} | ||
|
||
public FS_ClientboundCreateOrUpdateTeamPacket(String teamName, RemoveEntity removeEntity) { | ||
this.method = Method.REMOVE_ENTITY; | ||
this.teamName = teamName; | ||
this.removeEntity = removeEntity; | ||
} | ||
|
||
public Method getMethod() { | ||
return method; | ||
} | ||
|
||
public void setMethod(Method method) { | ||
this.method = method; | ||
} | ||
|
||
public String getTeamName() { | ||
return teamName; | ||
} | ||
|
||
public void setTeamName(String teamName) { | ||
this.teamName = teamName; | ||
} | ||
|
||
public CreateTeam getCreateTeam() { | ||
return createTeam; | ||
} | ||
|
||
public void setCreateTeam(CreateTeam createTeam) { | ||
this.createTeam = createTeam; | ||
} | ||
|
||
public UpdateTeam getUpdateTeam() { | ||
return updateTeam; | ||
} | ||
|
||
public void setUpdateTeam(UpdateTeam updateTeam) { | ||
this.updateTeam = updateTeam; | ||
} | ||
|
||
public AddEntity getAddEntity() { | ||
return addEntity; | ||
} | ||
|
||
public void setAddEntity(AddEntity addEntity) { | ||
this.addEntity = addEntity; | ||
} | ||
|
||
public RemoveEntity getRemoveEntity() { | ||
return removeEntity; | ||
} | ||
|
||
public void setRemoveEntity(RemoveEntity removeEntity) { | ||
this.removeEntity = removeEntity; | ||
} | ||
|
||
public enum Method { | ||
CREATE_TEAM, | ||
REMOVE_TEAM, | ||
UPDATE_TEAM, | ||
ADD_ENTITY, | ||
REMOVE_ENTITY; | ||
} | ||
|
||
public static class CreateTeam { | ||
private Component displayName; | ||
private boolean allowFriendlyFire; | ||
private boolean canSeeFriendlyInvisibles; | ||
private FS_NameTagVisibility nameTagVisibility; | ||
private FS_CollisionRule collisionRule; | ||
private FS_Color color; | ||
private Component prefix; | ||
private Component suffix; | ||
private List<String> entities; | ||
|
||
public CreateTeam(Component displayName, boolean allowFriendlyFire, boolean canSeeFriendlyInvisibles, FS_NameTagVisibility nameTagVisibility, FS_CollisionRule collisionRule, FS_Color color, Component prefix, Component suffix, List<String> entities) { | ||
this.displayName = displayName; | ||
this.allowFriendlyFire = allowFriendlyFire; | ||
this.canSeeFriendlyInvisibles = canSeeFriendlyInvisibles; | ||
this.nameTagVisibility = nameTagVisibility; | ||
this.collisionRule = collisionRule; | ||
this.color = color; | ||
this.prefix = prefix; | ||
this.suffix = suffix; | ||
this.entities = entities; | ||
} | ||
|
||
public Component getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
public void setDisplayName(Component displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
public boolean isAllowFriendlyFire() { | ||
return allowFriendlyFire; | ||
} | ||
|
||
public void setAllowFriendlyFire(boolean allowFriendlyFire) { | ||
this.allowFriendlyFire = allowFriendlyFire; | ||
} | ||
|
||
public boolean isCanSeeFriendlyInvisibles() { | ||
return canSeeFriendlyInvisibles; | ||
} | ||
|
||
public void setCanSeeFriendlyInvisibles(boolean canSeeFriendlyInvisibles) { | ||
this.canSeeFriendlyInvisibles = canSeeFriendlyInvisibles; | ||
} | ||
|
||
public FS_NameTagVisibility getNameTagVisibility() { | ||
return nameTagVisibility; | ||
} | ||
|
||
public void setNameTagVisibility(FS_NameTagVisibility nameTagVisibility) { | ||
this.nameTagVisibility = nameTagVisibility; | ||
} | ||
|
||
public FS_CollisionRule getCollisionRule() { | ||
return collisionRule; | ||
} | ||
|
||
public void setCollisionRule(FS_CollisionRule collisionRule) { | ||
this.collisionRule = collisionRule; | ||
} | ||
|
||
public FS_Color getColor() { | ||
return color; | ||
} | ||
|
||
public void setColor(FS_Color color) { | ||
this.color = color; | ||
} | ||
|
||
public Component getPrefix() { | ||
return prefix; | ||
} | ||
|
||
public void setPrefix(Component prefix) { | ||
this.prefix = prefix; | ||
} | ||
|
||
public Component getSuffix() { | ||
return suffix; | ||
} | ||
|
||
public void setSuffix(Component suffix) { | ||
this.suffix = suffix; | ||
} | ||
|
||
public List<String> getEntities() { | ||
return entities; | ||
} | ||
|
||
public void setEntities(List<String> entities) { | ||
this.entities = entities; | ||
} | ||
} | ||
|
||
public static class RemoveTeam { | ||
|
||
} | ||
|
||
public static class UpdateTeam { | ||
private Component displayName; | ||
private boolean allowFriendlyFire; | ||
private boolean canSeeFriendlyInvisibles; | ||
private FS_NameTagVisibility nameTagVisibility; | ||
private FS_CollisionRule collisionRule; | ||
private FS_Color color; | ||
private Component prefix; | ||
private Component suffix; | ||
|
||
public UpdateTeam(Component displayName, boolean allowFriendlyFire, boolean canSeeFriendlyInvisibles, FS_NameTagVisibility nameTagVisibility, FS_CollisionRule collisionRule, FS_Color color, Component prefix, Component suffix) { | ||
this.displayName = displayName; | ||
this.allowFriendlyFire = allowFriendlyFire; | ||
this.canSeeFriendlyInvisibles = canSeeFriendlyInvisibles; | ||
this.nameTagVisibility = nameTagVisibility; | ||
this.collisionRule = collisionRule; | ||
this.color = color; | ||
this.prefix = prefix; | ||
this.suffix = suffix; | ||
} | ||
|
||
public Component getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
public void setDisplayName(Component displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
public boolean isAllowFriendlyFire() { | ||
return allowFriendlyFire; | ||
} | ||
|
||
public void setAllowFriendlyFire(boolean allowFriendlyFire) { | ||
this.allowFriendlyFire = allowFriendlyFire; | ||
} | ||
|
||
public boolean isCanSeeFriendlyInvisibles() { | ||
return canSeeFriendlyInvisibles; | ||
} | ||
|
||
public void setCanSeeFriendlyInvisibles(boolean canSeeFriendlyInvisibles) { | ||
this.canSeeFriendlyInvisibles = canSeeFriendlyInvisibles; | ||
} | ||
|
||
public FS_NameTagVisibility getNameTagVisibility() { | ||
return nameTagVisibility; | ||
} | ||
|
||
public void setNameTagVisibility(FS_NameTagVisibility nameTagVisibility) { | ||
this.nameTagVisibility = nameTagVisibility; | ||
} | ||
|
||
public FS_CollisionRule getCollisionRule() { | ||
return collisionRule; | ||
} | ||
|
||
public void setCollisionRule(FS_CollisionRule collisionRule) { | ||
this.collisionRule = collisionRule; | ||
} | ||
|
||
public FS_Color getColor() { | ||
return color; | ||
} | ||
|
||
public void setColor(FS_Color color) { | ||
this.color = color; | ||
} | ||
|
||
public Component getPrefix() { | ||
return prefix; | ||
} | ||
|
||
public void setPrefix(Component prefix) { | ||
this.prefix = prefix; | ||
} | ||
|
||
public Component getSuffix() { | ||
return suffix; | ||
} | ||
|
||
public void setSuffix(Component suffix) { | ||
this.suffix = suffix; | ||
} | ||
} | ||
|
||
public static class AddEntity { | ||
private List<String> entities; | ||
|
||
public AddEntity(List<String> entities) { | ||
this.entities = entities; | ||
} | ||
|
||
public List<String> getEntities() { | ||
return entities; | ||
} | ||
|
||
public void setEntities(List<String> entities) { | ||
this.entities = entities; | ||
} | ||
} | ||
|
||
public static class RemoveEntity { | ||
private List<String> entities; | ||
|
||
public RemoveEntity(List<String> entities) { | ||
this.entities = entities; | ||
} | ||
|
||
public List<String> getEntities() { | ||
return entities; | ||
} | ||
|
||
public void setEntities(List<String> entities) { | ||
this.entities = entities; | ||
} | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
api/src/main/java/de/oliver/fancysitula/api/packets/FS_Color.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,31 @@ | ||
package de.oliver.fancysitula.api.packets; | ||
|
||
public enum FS_Color { | ||
BLACK(0), | ||
DARK_BLUE(1), | ||
DARK_GREEN(2), | ||
DARK_AQUA(3), | ||
DARK_RED(4), | ||
DARK_PURPLE(5), | ||
GOLD(6), | ||
GRAY(7), | ||
DARK_GRAY(8), | ||
BLUE(9), | ||
GREEN(10), | ||
AQUA(11), | ||
RED(12), | ||
LIGHT_PURPLE(13), | ||
YELLOW(14), | ||
WHITE(15); | ||
|
||
|
||
private final int id; | ||
|
||
FS_Color(int id) { | ||
this.id = id; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
api/src/main/java/de/oliver/fancysitula/api/teams/FS_CollisionRule.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,18 @@ | ||
package de.oliver.fancysitula.api.teams; | ||
|
||
public enum FS_CollisionRule { | ||
ALWAYS("always"), | ||
NEVER("never"), | ||
PUSH_OTHER_TEAMS("pushOtherTeams"), | ||
PUSH_OWN_TEAM("pushOwnTeam"); | ||
|
||
private final String name; | ||
|
||
FS_CollisionRule(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
Oops, something went wrong.