Skip to content

Commit

Permalink
chore: move getOnlineUsers() method to server, rename getType() and r…
Browse files Browse the repository at this point in the history
…emove unused CoreServer methods
  • Loading branch information
Snabeldier committed Jan 31, 2025
1 parent 5dab05e commit 0884feb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/main/java/minevalley/core/api/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,6 @@ public static NPC createNPC(String value, String signature, String name, Locatio
return server.createNPC(value, signature, name, location, focusNearPlayers);
}

@Nonnull
public static List<OnlineUser> getOnlineUsers() {
return server.getOnlineUsers();
}

/**
* Creates a new car barrier with the specific parameters.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/minevalley/core/api/CoreServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,24 +255,16 @@ public interface CoreServer {
@Nonnull
Reminder createReminder(int hours, int minutes, @Nonnull Runnable callback, DayOfWeek... weekdays) throws IllegalArgumentException;

@Nonnull
Reminder createReminder(int hours, int minutes, @Nonnull Runnable callback, List<DayOfWeek> weekdays) throws IllegalArgumentException;

@Nonnull
Webhook createWebhook(@Nonnull URL url) throws IllegalArgumentException;

@Nonnull
EmbeddedMessage createEmbeddedMessage();

boolean isMaintenance();

NPC createNPC(UUID skinUniqueId, String name, Location location, boolean focusNearPlayers);

NPC createNPC(String value, String signature, String name, Location location, boolean focusNearPlayers);

@Nonnull
List<OnlineUser> getOnlineUsers();

@Nonnull
CarBarrier createCarBarrier(@Nonnull Location loc, int rotation, @Nonnull List<Block> barrierBlocks) throws IllegalArgumentException;

Expand Down Expand Up @@ -344,8 +336,6 @@ Apartment createApartment(@Nonnull Region region, @Nonnull Registrant landlord,
@Nullable
District getDistrict(Chunk chunk);

void updateDistricts();

@Nonnull
RadioMast createRadioMast(@Nonnull String name, @Nonnull Block location, int range) throws IllegalArgumentException;

Expand Down
12 changes: 11 additions & 1 deletion src/main/java/minevalley/core/api/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@

import minevalley.core.api.audio.SoundReceiver;
import minevalley.core.api.messaging.MessageReceiver;
import minevalley.core.api.users.OnlineUser;

import javax.annotation.Nonnull;
import java.util.List;

@SuppressWarnings("unused")
public interface Server extends MessageReceiver, SoundReceiver {

/**
* Gets a list of all online users.
*
* @return a list of all online users
*/
@Nonnull
List<OnlineUser> onlineUsers();

/**
* Get the server type.
*
* @return the server type
*/
@Nonnull
ServerType getType();
ServerType type();

/**
* Gets whether the server is in development mode.
Expand Down

0 comments on commit 0884feb

Please sign in to comment.