Skip to content

Commit

Permalink
Fixing some stupidity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xezard committed Nov 19, 2022
1 parent c204382 commit 059309e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
3 changes: 0 additions & 3 deletions api/src/main/java/ru/xezard/glow/data/glow/Glow.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public Glow(ChatColor color, String name) {

@Override
public void addHolders(Entity... entities) {
Preconditions.checkArgument(this.holders.size() + entities.length <= 40,
"You cannot add more than 40 holders to one glow.");

this.processHolder(true, entities);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
import com.comphenix.protocol.wrappers.WrappedWatchableObject;
import com.google.common.base.Preconditions;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.experimental.FieldDefaults;
Expand Down Expand Up @@ -69,9 +68,6 @@ public List<AbstractPacket> createGlowPackets(Set<Entity> entities, boolean glow
@Override
public AbstractPacket createTeamPacket(Set<Entity> holders, ChatColor color, String teamName,
AbstractWrapperPlayServerScoreboardTeam.Mode mode) {
Preconditions.checkArgument(holders.size() <= 40,
"Cannot create team packet with more than 40 entries!");

WrapperPlayServerScoreboardTeam team = new WrapperPlayServerScoreboardTeam();

team.setTeamName(teamName);
Expand Down
8 changes: 8 additions & 0 deletions api/src/main/java/ru/xezard/glow/packets/AbstractPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ public void sendPacket(Iterable<Player> recipients) {
}

public void sendPacket(Player... recipients) {
if (recipients == null) {
return;
}

for (Player receiver : recipients) {
if (receiver == null || !receiver.isOnline()) {
return;
}

try {
ProtocolLibrary.getProtocolManager().sendServerPacket(receiver, this.handle);
} catch (InvocationTargetException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ public List<String> getPlayers() {

@Override
public void setPlayers(List<String> value) {
Preconditions.checkArgument(value.size() <= 40,
"ScoreboardTeam cannot contain more than 40 entries.");

this.handle.getSpecificModifier(Collection.class)
.write(0, value);
}
Expand Down

0 comments on commit 059309e

Please sign in to comment.