Skip to content

Commit

Permalink
Fix checkstyle rule violations
Browse files Browse the repository at this point in the history
  • Loading branch information
md5sha256 committed Jan 11, 2024
1 parent 9812135 commit 16de27d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@CommandAlias("hyperverse|hv|worlds|world")
Expand Down Expand Up @@ -690,7 +689,7 @@ private void registerCommandTeleport(
.command(commandTeleportSinglePlayerProxy);
}

private void handleTeleportSinglePlayer(CommandContext<CommandSender> context) {
private void handleTeleportSinglePlayer(@NonNull final CommandContext<CommandSender> context) {
CommandSender sender = context.getSender();
if (!(sender instanceof Player player)) {
throw new IllegalArgumentException("Command can only be used by a player");
Expand All @@ -712,7 +711,7 @@ private void handleTeleportSinglePlayer(CommandContext<CommandSender> context) {
world.teleportPlayer(player);
}

private void handleTeleportSingle(CommandContext<CommandSender> context) {
private void handleTeleportSingle(@NonNull final CommandContext<CommandSender> context) {
Player player = context.get("player");
HyperWorld world = context.getOrDefault("world", null);
if (world == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public WorldFlagParser(@NonNull final GlobalWorldFlagContainer flagContainer) {

@Override
public @NonNull List<String> suggestions(
@NonNull CommandContext<C> context,
@NonNull String input
@NonNull final CommandContext<C> context,
@NonNull final String input
) {
return this.flagContainer.getFlagMap().values().stream()
.map(WorldFlag::getName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import java.util.Locale;

public class ReflectionPlatformProvider implements PlatformProvider {
public final class ReflectionPlatformProvider implements PlatformProvider {

private final Version minecraftVersion;
public ReflectionPlatformProvider(@NotNull final Version version) {
Expand All @@ -32,13 +32,13 @@ public ReflectionPlatformProvider(@NotNull final Version version) {

@Override
public @NotNull Class<? extends NMS> providePlatform() throws PlatformProvisionException {
String expectedPackage = minecraftVersion.original().toLowerCase(Locale.ENGLISH).replace('.', '_');
String expectedPackage = this.minecraftVersion.original().toLowerCase(Locale.ENGLISH).replace('.', '_');
String packageName = "org.incendo.hyperverse.platform.v" + expectedPackage;
try {
Class<?> clazz = Class.forName(packageName + ".NMSImpl");
return clazz.asSubclass(NMS.class);
} catch (ReflectiveOperationException ex) {
throw new PlatformProvisionException("Could not provide platform for version: " + minecraftVersion + "!", ex);
throw new PlatformProvisionException("Could not provide platform for version: " + this.minecraftVersion + "!", ex);
}
}

Expand Down

0 comments on commit 16de27d

Please sign in to comment.