Merge iie's code into my code #1

Merged
NorbiPeti merged 4 commits from iie into master 2016-11-05 20:57:36 +00:00
14 changed files with 31 additions and 31 deletions
Showing only changes of commit ae11acc4bf - Show all commits

1
.gitignore vendored
View file

@ -12,3 +12,4 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/bin/
/target/

View file

@ -1,11 +1,11 @@
package cache;
package buttondevteam.perworld.cache;
import org.bukkit.configuration.ConfigurationSection;
public interface CacheInterface {
public static ConfigurationSection worlds = main.MainPlugin.worlds;
public static ConfigurationSection players = main.MainPlugin.players;
public static ConfigurationSection worlds = buttondevteam.perworld.main.MainPlugin.worlds;
public static ConfigurationSection players = buttondevteam.perworld.main.MainPlugin.players;
Object generateElement(String string);

View file

@ -1,4 +1,4 @@
package cache;
package buttondevteam.perworld.cache;
public class CacheRequestHandler {

View file

@ -1,4 +1,4 @@
package cache.player;
package buttondevteam.perworld.cache.player;
import java.util.HashMap;

View file

@ -1,4 +1,4 @@
package cache.player;
package buttondevteam.perworld.cache.player;
public class Name {

View file

@ -1,8 +1,8 @@
package cache.world;
package buttondevteam.perworld.cache.world;
import java.util.HashMap;
import cache.CacheInterface;
import buttondevteam.perworld.cache.CacheInterface;
public class ShareSettings implements CacheInterface {

View file

@ -1,4 +1,4 @@
package main;
package buttondevteam.perworld.main;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;

View file

@ -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.event.EventHandler;

View file

@ -1,4 +1,4 @@
package main;
package buttondevteam.perworld.main;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
@ -30,6 +30,6 @@ public class MainPlugin extends JavaPlugin {
if (!config.contains("players")) config.createSection("players");
saveConfig();
new cache.world.ShareSettings().initCache();
new buttondevteam.perworld.cache.world.ShareSettings().initCache();
}
}

View file

@ -1,17 +1,16 @@
package main;
package buttondevteam.perworld.main;
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventory;
import org.bukkit.entity.Player;
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 static main.MainPlugin.config;
import static main.MainPlugin.debugClock;
import static buttondevteam.perworld.cache.world.ShareSettings.compare;
import static buttondevteam.perworld.main.MainPlugin.config;
import static buttondevteam.perworld.main.MainPlugin.debugClock;
import static buttondevteam.perworld.main.MainPlugin.plugin;
public class PlayerUpdater {
@ -55,8 +54,8 @@ public class PlayerUpdater {
//updatePlayerData(values, player);
player.sendMessage("...done, " + (System.currentTimeMillis() - debugClock) + " ms");
new cache.world.ShareSettings().initCache();
player.sendMessage(cache.world.ShareSettings.cache.keySet().stream().collect(Collectors.joining(",")));
new buttondevteam.perworld.cache.world.ShareSettings().initCache();
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){
config.set(
values.pFrom + ".location",
serializers.location.serialize(player.getLocation())
buttondevteam.perworld.serializers.location.serialize(player.getLocation())
);
plugin.saveConfig();
/* players are not automatically moved to their stored location,
@ -76,18 +75,18 @@ public class PlayerUpdater {
//UPDATE INVENTORIES
public static void updateInventories(Values values, Player player){
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();
if (!values.shareinv)
serializers.inventory.setFromSerialized(
buttondevteam.perworld.serializers.inventory.setFromSerialized(
inventory, (String) config.get(values.pTo + ".inventory")
);
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();
if (!values.sharedata)
serializers.inventory.setFromSerialized(
buttondevteam.perworld.serializers.inventory.setFromSerialized(
enderchest, (String) config.get(values.pTo + ".enderchest")
);
}
@ -95,7 +94,7 @@ public class PlayerUpdater {
//UPDATE PLAYERDATA
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();
if (!values.sharedata)
;

View file

@ -1,4 +1,4 @@
package main;
package buttondevteam.perworld.main;
import java.util.ArrayList;
import java.util.Arrays;

View file

@ -1,4 +1,4 @@
package serializers;
package buttondevteam.perworld.serializers;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

View file

@ -1,4 +1,4 @@
package serializers;
package buttondevteam.perworld.serializers;
import org.bukkit.Location;
import org.bukkit.World;

View file

@ -1,4 +1,4 @@
package serializers;
package buttondevteam.perworld.serializers;
import java.util.Arrays;