Skip to content

Commit

Permalink
fix(SkinOverlayImpl): Made print a default
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeV220 committed Apr 14, 2023
1 parent 38f4953 commit e4fe0f6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 28 deletions.
Expand Up @@ -174,11 +174,6 @@ public String serverVersion() {
return Bukkit.getBukkitVersion();
}

@Override
public void print(String... msg) {
BukkitMinecraftUtils.printMsg(msg);
}

public @NotNull BukkitAudiences adventure() {
if (this.adventure == null) {
throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
Expand Down
Expand Up @@ -170,11 +170,6 @@ public String serverVersion() {
return getProxy().getVersion();
}

@Override
public void print(String... msg) {
BungeeMinecraftUtils.printMsg(msg);
}

public @NotNull BungeeAudiences adventure() {
if (this.adventure == null) {
throw new IllegalStateException("Cannot retrieve audience provider while plugin is not enabled");
Expand Down
Expand Up @@ -4,6 +4,7 @@
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;

Expand Down Expand Up @@ -103,7 +104,9 @@ public interface SkinOverlayImpl {
*
* @param msg The message(s) to print.
*/
void print(String... msg);
default void print(String... msg) {
Arrays.stream(msg).forEach(s -> logger().info(s));
}

/**
* A record representing the plugin's description.
Expand Down
Expand Up @@ -35,7 +35,6 @@

import java.io.File;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -188,11 +187,6 @@ public String serverVersion() {
return "Sponge " + Sponge8MinecraftUtils.MinecraftVersion.getCurrentVersionName();
}

@Override
public void print(String... msg) {
Sponge8MinecraftUtils.printMsg(logger(), Arrays.stream(msg).toList());
}

public PluginContainer getPluginContainer() {
return pluginContainer;
}
Expand Down
Expand Up @@ -33,7 +33,6 @@

import java.io.File;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -186,11 +185,6 @@ public String serverVersion() {
return Sponge.getPlatform().getMinecraftVersion().getName();
}

@Override
public void print(String... msg) {
Sponge7MinecraftUtils.printMsg(logger(), Arrays.stream(msg).toList());
}

public PluginContainer getPluginContainer() {
return pluginContainer;
}
Expand Down
Expand Up @@ -212,9 +212,4 @@ public ProxyServer serverImpl() {
public String serverVersion() {
return SkinOverlayVelocity.getInstance().getProxy().getVersion().getName() + "-" + SkinOverlayVelocity.getInstance().getProxy().getVersion().getVersion();
}

@Override
public void print(String... msg) {
VelocityMinecraftUtils.printMsg(msg);
}
}

0 comments on commit e4fe0f6

Please sign in to comment.