mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-30 21:37:38 +00:00
Update to Spigot 1.9-R1
This commit is contained in:
parent
e93ac11172
commit
19ced05110
2
pom.xml
2
pom.xml
@ -67,7 +67,7 @@
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.8.7-R0.1-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/Spigot-1.8.7.jar</systemPath>
|
||||
<systemPath>${project.basedir}/lib/Spigot-1.9.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -3,14 +3,16 @@ package me.totalfreedom.totalfreedommod;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||
import net.minecraft.server.v1_8_R3.PropertyManager;
|
||||
import net.minecraft.server.v1_9_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftServer;
|
||||
import net.minecraft.server.v1_9_R1.PropertyManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.CraftServer;
|
||||
|
||||
public class ServerInterface extends FreedomService
|
||||
{
|
||||
|
||||
public static final String COMPILE_NMS_VERSION = "v1_8_R3";
|
||||
public static final String COMPILE_NMS_VERSION = "v1_9_R1";
|
||||
|
||||
public ServerInterface(TotalFreedomMod plugin)
|
||||
{
|
||||
@ -29,23 +31,23 @@ public class ServerInterface extends FreedomService
|
||||
|
||||
public void setOnlineMode(boolean mode)
|
||||
{
|
||||
final PropertyManager manager = MinecraftServer.getServer().getPropertyManager();
|
||||
final PropertyManager manager = getServer().getPropertyManager();
|
||||
manager.setProperty("online-mode", mode);
|
||||
manager.savePropertiesFile();
|
||||
}
|
||||
|
||||
public int purgeWhitelist()
|
||||
{
|
||||
String[] whitelisted = MinecraftServer.getServer().getPlayerList().getWhitelisted();
|
||||
String[] whitelisted = getServer().getPlayerList().getWhitelisted();
|
||||
int size = whitelisted.length;
|
||||
for (EntityPlayer player : MinecraftServer.getServer().getPlayerList().players)
|
||||
for (EntityPlayer player : getServer().getPlayerList().players)
|
||||
{
|
||||
MinecraftServer.getServer().getPlayerList().getWhitelist().remove(player.getProfile());
|
||||
getServer().getPlayerList().getWhitelist().remove(player.getProfile());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
MinecraftServer.getServer().getPlayerList().getWhitelist().save();
|
||||
getServer().getPlayerList().getWhitelist().save();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -57,17 +59,22 @@ public class ServerInterface extends FreedomService
|
||||
|
||||
public boolean isWhitelisted()
|
||||
{
|
||||
return MinecraftServer.getServer().getPlayerList().getHasWhitelist();
|
||||
return getServer().getPlayerList().getHasWhitelist();
|
||||
}
|
||||
|
||||
public List<?> getWhitelisted()
|
||||
{
|
||||
return Arrays.asList(MinecraftServer.getServer().getPlayerList().getWhitelisted());
|
||||
return Arrays.asList(getServer().getPlayerList().getWhitelisted());
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return MinecraftServer.getServer().getVersion();
|
||||
return getServer().getVersion();
|
||||
}
|
||||
|
||||
private MinecraftServer getServer()
|
||||
{
|
||||
return ((CraftServer) Bukkit.getServer()).getServer();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user