From 21652cf085ca17ee27e1e91aa9856a5d69519bf1 Mon Sep 17 00:00:00 2001 From: Tobi Schmitz Date: Sat, 16 Aug 2014 19:40:17 +0200 Subject: [PATCH] update to 1.7.9 --- src/com/dre/dungeonsxl/DPlayer.java | 3 ++- src/com/dre/dungeonsxl/DSavePlayer.java | 7 ++++--- src/com/dre/dungeonsxl/P.java | 15 ++++++++------- .../dre/dungeonsxl/listener/EntityListener.java | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/com/dre/dungeonsxl/DPlayer.java b/src/com/dre/dungeonsxl/DPlayer.java index 598078dc..59154405 100644 --- a/src/com/dre/dungeonsxl/DPlayer.java +++ b/src/com/dre/dungeonsxl/DPlayer.java @@ -65,7 +65,7 @@ public class DPlayer { double health = ((Damageable) player).getHealth(); - this.savePlayer = new DSavePlayer(player.getName(), player.getUniqueId().toString(), player.getLocation(), player.getInventory().getContents(), player.getInventory().getArmorContents(), player.getLevel(), + this.savePlayer = new DSavePlayer(player.getName(), player.getUniqueId(), player.getLocation(), player.getInventory().getContents(), player.getInventory().getArmorContents(), player.getLevel(), player.getTotalExperience(), (int) health, player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects()); this.player.getInventory().clear(); @@ -159,6 +159,7 @@ public class DPlayer { if (gworld.isTutorial) { p.permission.playerAddGroup(this.player, p.mainConfig.tutorialEndGroup); p.permission.playerRemoveGroup(this.player, p.mainConfig.tutorialStartGroup); + p.getServer().dispatchCommand(p.getServer().getConsoleSender(), "pex user "+player.getName()+" group set "+p.mainConfig.tutorialEndGroup); } } } diff --git a/src/com/dre/dungeonsxl/DSavePlayer.java b/src/com/dre/dungeonsxl/DSavePlayer.java index c0c7cb91..fb56e8f2 100644 --- a/src/com/dre/dungeonsxl/DSavePlayer.java +++ b/src/com/dre/dungeonsxl/DSavePlayer.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.UUID; import java.util.concurrent.CopyOnWriteArrayList; import org.bukkit.GameMode; @@ -24,7 +25,7 @@ public class DSavePlayer { // Variables private String playerName; - private String uuid; + private UUID uuid; private Location oldLocation; private ItemStack[] oldInventory; @@ -37,7 +38,7 @@ public class DSavePlayer { private GameMode oldGamemode; private Collection oldPotionEffects; - public DSavePlayer(String playerName, String uuid, Location oldLocation, ItemStack[] oldInventory, ItemStack[] oldArmor, int oldLvl, int oldExp, int oldHealth, int oldFoodLevel, int oldFireTicks, + public DSavePlayer(String playerName, UUID uuid, Location oldLocation, ItemStack[] oldInventory, ItemStack[] oldArmor, int oldLvl, int oldExp, int oldHealth, int oldFoodLevel, int oldFireTicks, GameMode oldGamemode, Collection oldPotionEffects) { savePlayers.add(this); @@ -144,7 +145,7 @@ public class DSavePlayer { for (String playerName : configFile.getKeys(false)) { // Load uuid - String uuid = configFile.getString(playerName + ".uuid"); + UUID uuid = UUID.fromString(configFile.getString(playerName + ".uuid")); // Load inventory data ArrayList oldInventoryList = (ArrayList) configFile.get(playerName + ".oldInventory"); diff --git a/src/com/dre/dungeonsxl/P.java b/src/com/dre/dungeonsxl/P.java index 32c77038..c57f7e74 100644 --- a/src/com/dre/dungeonsxl/P.java +++ b/src/com/dre/dungeonsxl/P.java @@ -7,12 +7,13 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.channels.FileChannel; +import java.util.UUID; import java.util.concurrent.CopyOnWriteArrayList; import net.milkbowl.vault.permission.Permission; -import net.minecraft.server.v1_7_R2.EntityPlayer; -import net.minecraft.server.v1_7_R2.MinecraftServer; -import net.minecraft.server.v1_7_R2.PlayerInteractManager; +import net.minecraft.server.v1_7_R3.EntityPlayer; +import net.minecraft.server.v1_7_R3.MinecraftServer; +import net.minecraft.server.v1_7_R3.PlayerInteractManager; import net.minecraft.util.com.mojang.authlib.GameProfile; import org.apache.commons.lang.math.NumberUtils; @@ -22,8 +23,8 @@ import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.craftbukkit.v1_7_R2.CraftServer; -import org.bukkit.craftbukkit.v1_7_R2.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R3.CraftServer; +import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; @@ -434,7 +435,7 @@ public class P extends JavaPlugin { return NumberUtils.toInt(string, 0); } - public Player getOfflinePlayer(String player, String uuid) { + public Player getOfflinePlayer(String player, UUID uuid) { Player pplayer = null; try { File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "players"); @@ -461,7 +462,7 @@ public class P extends JavaPlugin { return pplayer; } - public Player getOfflinePlayer(String player, String uuid, Location location) { + public Player getOfflinePlayer(String player, UUID uuid, Location location) { Player pplayer = null; try { File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "players"); diff --git a/src/com/dre/dungeonsxl/listener/EntityListener.java b/src/com/dre/dungeonsxl/listener/EntityListener.java index ad462d80..ee4bce97 100644 --- a/src/com/dre/dungeonsxl/listener/EntityListener.java +++ b/src/com/dre/dungeonsxl/listener/EntityListener.java @@ -91,7 +91,7 @@ public class EntityListener implements Listener { Entity entity2 = sub.getEntity(); if (entity instanceof Projectile) { - entity = ((Projectile) entity).getShooter(); + entity = (Entity) ((Projectile) entity).getShooter(); } if (entity instanceof Player && entity2 instanceof Player) {