Renamed things here as well to fix conflicts
This commit is contained in:
parent
ef7d2bf12f
commit
ae11acc4bf
14 changed files with 31 additions and 31 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -12,3 +12,4 @@
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
/bin/
|
/bin/
|
||||||
|
/target/
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package cache;
|
package buttondevteam.perworld.cache;
|
||||||
|
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
public interface CacheInterface {
|
public interface CacheInterface {
|
||||||
|
|
||||||
public static ConfigurationSection worlds = main.MainPlugin.worlds;
|
public static ConfigurationSection worlds = buttondevteam.perworld.main.MainPlugin.worlds;
|
||||||
public static ConfigurationSection players = main.MainPlugin.players;
|
public static ConfigurationSection players = buttondevteam.perworld.main.MainPlugin.players;
|
||||||
|
|
||||||
Object generateElement(String string);
|
Object generateElement(String string);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package cache;
|
package buttondevteam.perworld.cache;
|
||||||
|
|
||||||
public class CacheRequestHandler {
|
public class CacheRequestHandler {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package cache.player;
|
package buttondevteam.perworld.cache.player;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package cache.player;
|
package buttondevteam.perworld.cache.player;
|
||||||
|
|
||||||
public class Name {
|
public class Name {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package cache.world;
|
package buttondevteam.perworld.cache.world;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import cache.CacheInterface;
|
import buttondevteam.perworld.cache.CacheInterface;
|
||||||
|
|
||||||
public class ShareSettings implements CacheInterface {
|
public class ShareSettings implements CacheInterface {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package main;
|
package buttondevteam.perworld.main;
|
||||||
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package main;
|
package buttondevteam.perworld.main;
|
||||||
|
|
||||||
import static main.MainPlugin.debugClock;
|
import static buttondevteam.perworld.main.MainPlugin.debugClock;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package main;
|
package buttondevteam.perworld.main;
|
||||||
|
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
@ -30,6 +30,6 @@ public class MainPlugin extends JavaPlugin {
|
||||||
if (!config.contains("players")) config.createSection("players");
|
if (!config.contains("players")) config.createSection("players");
|
||||||
saveConfig();
|
saveConfig();
|
||||||
|
|
||||||
new cache.world.ShareSettings().initCache();
|
new buttondevteam.perworld.cache.world.ShareSettings().initCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,17 +1,16 @@
|
||||||
package main;
|
package buttondevteam.perworld.main;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventory;
|
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventory;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.minecraft.server.v1_10_R1.IInventory;
|
import net.minecraft.server.v1_10_R1.IInventory;
|
||||||
|
|
||||||
import static cache.world.ShareSettings.compare;
|
|
||||||
import static main.MainPlugin.plugin;
|
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static main.MainPlugin.config;
|
import static buttondevteam.perworld.cache.world.ShareSettings.compare;
|
||||||
import static main.MainPlugin.debugClock;
|
import static buttondevteam.perworld.main.MainPlugin.config;
|
||||||
|
import static buttondevteam.perworld.main.MainPlugin.debugClock;
|
||||||
|
import static buttondevteam.perworld.main.MainPlugin.plugin;
|
||||||
|
|
||||||
public class PlayerUpdater {
|
public class PlayerUpdater {
|
||||||
|
|
||||||
|
@ -55,8 +54,8 @@ public class PlayerUpdater {
|
||||||
//updatePlayerData(values, player);
|
//updatePlayerData(values, player);
|
||||||
|
|
||||||
player.sendMessage("...done, " + (System.currentTimeMillis() - debugClock) + " ms");
|
player.sendMessage("...done, " + (System.currentTimeMillis() - debugClock) + " ms");
|
||||||
new cache.world.ShareSettings().initCache();
|
new buttondevteam.perworld.cache.world.ShareSettings().initCache();
|
||||||
player.sendMessage(cache.world.ShareSettings.cache.keySet().stream().collect(Collectors.joining(",")));
|
player.sendMessage(buttondevteam.perworld.cache.world.ShareSettings.cache.keySet().stream().collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ public class PlayerUpdater {
|
||||||
public static void updateLocation(Values values, Player player){
|
public static void updateLocation(Values values, Player player){
|
||||||
config.set(
|
config.set(
|
||||||
values.pFrom + ".location",
|
values.pFrom + ".location",
|
||||||
serializers.location.serialize(player.getLocation())
|
buttondevteam.perworld.serializers.location.serialize(player.getLocation())
|
||||||
);
|
);
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
/* players are not automatically moved to their stored location,
|
/* players are not automatically moved to their stored location,
|
||||||
|
@ -76,18 +75,18 @@ public class PlayerUpdater {
|
||||||
//UPDATE INVENTORIES
|
//UPDATE INVENTORIES
|
||||||
public static void updateInventories(Values values, Player player){
|
public static void updateInventories(Values values, Player player){
|
||||||
IInventory inventory = ((CraftInventory) player.getInventory()).getInventory();
|
IInventory inventory = ((CraftInventory) player.getInventory()).getInventory();
|
||||||
config.set(values.pFrom + ".inventory", serializers.inventory.serialize(inventory));
|
config.set(values.pFrom + ".inventory", buttondevteam.perworld.serializers.inventory.serialize(inventory));
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
if (!values.shareinv)
|
if (!values.shareinv)
|
||||||
serializers.inventory.setFromSerialized(
|
buttondevteam.perworld.serializers.inventory.setFromSerialized(
|
||||||
inventory, (String) config.get(values.pTo + ".inventory")
|
inventory, (String) config.get(values.pTo + ".inventory")
|
||||||
);
|
);
|
||||||
|
|
||||||
IInventory enderchest = ((CraftInventory) player.getEnderChest()).getInventory();
|
IInventory enderchest = ((CraftInventory) player.getEnderChest()).getInventory();
|
||||||
config.set(values.pFrom + ".enderchest", serializers.inventory.serialize(enderchest));
|
config.set(values.pFrom + ".enderchest", buttondevteam.perworld.serializers.inventory.serialize(enderchest));
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
if (!values.sharedata)
|
if (!values.sharedata)
|
||||||
serializers.inventory.setFromSerialized(
|
buttondevteam.perworld.serializers.inventory.setFromSerialized(
|
||||||
enderchest, (String) config.get(values.pTo + ".enderchest")
|
enderchest, (String) config.get(values.pTo + ".enderchest")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +94,7 @@ public class PlayerUpdater {
|
||||||
|
|
||||||
//UPDATE PLAYERDATA
|
//UPDATE PLAYERDATA
|
||||||
public static void updatePlayerData(Values values, Player player){
|
public static void updatePlayerData(Values values, Player player){
|
||||||
config.set(values.pFrom + ".playerdata", serializers.playerdata.serialize(player));
|
config.set(values.pFrom + ".playerdata", buttondevteam.perworld.serializers.playerdata.serialize(player));
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
if (!values.sharedata)
|
if (!values.sharedata)
|
||||||
;
|
;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package main;
|
package buttondevteam.perworld.main;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package serializers;
|
package buttondevteam.perworld.serializers;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package serializers;
|
package buttondevteam.perworld.serializers;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package serializers;
|
package buttondevteam.perworld.serializers;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue