Remove changes to string API contracts introduced by prior commits

This commit is contained in:
md_5 2023-06-12 20:39:58 +10:00
parent 461cd81328
commit 0cd47ae827
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
3 changed files with 2 additions and 6 deletions

View File

@ -1639,7 +1639,6 @@ public final class CraftServer implements Server {
@Deprecated @Deprecated
public OfflinePlayer getOfflinePlayer(String name) { public OfflinePlayer getOfflinePlayer(String name) {
Preconditions.checkArgument(name != null, "name cannot be null"); Preconditions.checkArgument(name != null, "name cannot be null");
Preconditions.checkArgument(!name.isBlank(), "name cannot be empty");
OfflinePlayer result = getPlayerExact(name); OfflinePlayer result = getPlayerExact(name);
if (result == null) { if (result == null) {
@ -1707,7 +1706,6 @@ public final class CraftServer implements Server {
@Override @Override
public void banIP(String address) { public void banIP(String address) {
Preconditions.checkArgument(address != null, "address cannot be null"); Preconditions.checkArgument(address != null, "address cannot be null");
Preconditions.checkArgument(!address.isBlank(), "address cannot be empty");
this.getBanList(org.bukkit.BanList.Type.IP).addBan(address, null, null, null); this.getBanList(org.bukkit.BanList.Type.IP).addBan(address, null, null, null);
} }
@ -1715,7 +1713,6 @@ public final class CraftServer implements Server {
@Override @Override
public void unbanIP(String address) { public void unbanIP(String address) {
Preconditions.checkArgument(address != null, "address cannot be null"); Preconditions.checkArgument(address != null, "address cannot be null");
Preconditions.checkArgument(!address.isBlank(), "address cannot be empty");
this.getBanList(org.bukkit.BanList.Type.IP).pardon(address); this.getBanList(org.bukkit.BanList.Type.IP).pardon(address);
} }

View File

@ -1565,7 +1565,6 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch) { public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch) {
Preconditions.checkArgument(loc != null, "Location cannot be null"); Preconditions.checkArgument(loc != null, "Location cannot be null");
Preconditions.checkArgument(sound != null, "Sound cannot be null"); Preconditions.checkArgument(sound != null, "Sound cannot be null");
Preconditions.checkArgument(!sound.isBlank(), "Sound cannot be empty");
Preconditions.checkArgument(category != null, "Category cannot be null"); Preconditions.checkArgument(category != null, "Category cannot be null");
double x = loc.getX(); double x = loc.getX();
@ -1674,7 +1673,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override @Override
public boolean isGameRule(String rule) { public boolean isGameRule(String rule) {
Preconditions.checkArgument(rule != null, "String rule cannot be null"); Preconditions.checkArgument(rule != null, "String rule cannot be null");
Preconditions.checkArgument(!rule.isBlank(), "String rule cannot be empty"); Preconditions.checkArgument(!rule.isEmpty(), "String rule cannot be empty");
return getGameRulesNMS().containsKey(rule); return getGameRulesNMS().containsKey(rule);
} }

View File

@ -42,7 +42,7 @@ public class CraftStructureBlock extends CraftBlockEntityState<TileEntityStructu
@Override @Override
public void setAuthor(String author) { public void setAuthor(String author) {
Preconditions.checkArgument(author != null, "Author name cannot be null"); Preconditions.checkArgument(author != null, "Author name cannot be null");
Preconditions.checkArgument(!author.isBlank(), "Author name cannot be empty"); Preconditions.checkArgument(!author.isEmpty(), "Author name cannot be empty");
getSnapshot().author = author; getSnapshot().author = author;
} }