mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Support get players
This commit is contained in:
parent
08346a2326
commit
86367298cc
@ -18,20 +18,23 @@
|
||||
|
||||
package com.volmit.iris.engine.object.common;
|
||||
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
public class IrisWorld {
|
||||
private static final KList<Player> NO_PLAYERS = new KList<>();
|
||||
private String name;
|
||||
private File worldFolder;
|
||||
private long seed;
|
||||
private World.Environment environment;
|
||||
private boolean real;
|
||||
private World realWorld;
|
||||
|
||||
public static IrisWorld fromWorld(World world)
|
||||
{
|
||||
@ -42,4 +45,19 @@ public class IrisWorld {
|
||||
.environment(world.getEnvironment())
|
||||
.build();
|
||||
}
|
||||
|
||||
public boolean hasRealWorld()
|
||||
{
|
||||
return realWorld != null;
|
||||
}
|
||||
|
||||
public Iterable<? extends Player> getPlayers() {
|
||||
|
||||
if(hasRealWorld())
|
||||
{
|
||||
return getRealWorld().getPlayers();
|
||||
}
|
||||
|
||||
return NO_PLAYERS;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user