SubServers-2/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Network/Packet/PacketDownloadLang.java

52 lines
1.4 KiB
Java
Raw Normal View History

2016-12-20 00:31:01 +01:00
package net.ME1312.SubServers.Client.Bukkit.Network.Packet;
import net.ME1312.SubServers.Client.Bukkit.Library.Config.YAMLSection;
import net.ME1312.SubServers.Client.Bukkit.Library.Util;
2016-12-20 00:31:01 +01:00
import net.ME1312.SubServers.Client.Bukkit.Library.Version.Version;
import net.ME1312.SubServers.Client.Bukkit.Network.PacketIn;
import net.ME1312.SubServers.Client.Bukkit.Network.PacketOut;
import net.ME1312.SubServers.Client.Bukkit.SubPlugin;
import org.bukkit.Bukkit;
import org.json.JSONObject;
import java.util.Calendar;
/**
* Download Lang Packet
*/
2016-12-20 00:31:01 +01:00
public class PacketDownloadLang implements PacketIn, PacketOut {
private SubPlugin plugin;
/**
* New PacketDownloadLang (In)
*/
public PacketDownloadLang() {}
2016-12-20 00:31:01 +01:00
/**
* New PacketDownloadLang (Out)
*
* @param plugin SubServers.Client
*/
2016-12-20 00:31:01 +01:00
public PacketDownloadLang(SubPlugin plugin) {
if (Util.isNull(plugin)) throw new NullPointerException();
2016-12-20 00:31:01 +01:00
this.plugin = plugin;
}
@Override
public JSONObject generate() {
return null;
}
@Override
public void execute(JSONObject data) {
data.put("Updated", Calendar.getInstance().getTime().getTime());
plugin.lang = new YAMLSection(data);
Bukkit.getLogger().info("SubData > Lang Settings Downloaded");
}
@Override
public Version getVersion() {
return new Version("2.11.0a");
}
}