update to 1.7.9

This commit is contained in:
Tobi Schmitz 2014-08-16 19:40:17 +02:00
parent 50f772d142
commit 21652cf085
4 changed files with 15 additions and 12 deletions

View File

@ -65,7 +65,7 @@ public class DPlayer {
double health = ((Damageable) player).getHealth(); 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()); player.getTotalExperience(), (int) health, player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects());
this.player.getInventory().clear(); this.player.getInventory().clear();
@ -159,6 +159,7 @@ public class DPlayer {
if (gworld.isTutorial) { if (gworld.isTutorial) {
p.permission.playerAddGroup(this.player, p.mainConfig.tutorialEndGroup); p.permission.playerAddGroup(this.player, p.mainConfig.tutorialEndGroup);
p.permission.playerRemoveGroup(this.player, p.mainConfig.tutorialStartGroup); p.permission.playerRemoveGroup(this.player, p.mainConfig.tutorialStartGroup);
p.getServer().dispatchCommand(p.getServer().getConsoleSender(), "pex user "+player.getName()+" group set "+p.mainConfig.tutorialEndGroup);
} }
} }
} }

View File

@ -4,6 +4,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@ -24,7 +25,7 @@ public class DSavePlayer {
// Variables // Variables
private String playerName; private String playerName;
private String uuid; private UUID uuid;
private Location oldLocation; private Location oldLocation;
private ItemStack[] oldInventory; private ItemStack[] oldInventory;
@ -37,7 +38,7 @@ public class DSavePlayer {
private GameMode oldGamemode; private GameMode oldGamemode;
private Collection<PotionEffect> oldPotionEffects; private Collection<PotionEffect> 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<PotionEffect> oldPotionEffects) { GameMode oldGamemode, Collection<PotionEffect> oldPotionEffects) {
savePlayers.add(this); savePlayers.add(this);
@ -144,7 +145,7 @@ public class DSavePlayer {
for (String playerName : configFile.getKeys(false)) { for (String playerName : configFile.getKeys(false)) {
// Load uuid // Load uuid
String uuid = configFile.getString(playerName + ".uuid"); UUID uuid = UUID.fromString(configFile.getString(playerName + ".uuid"));
// Load inventory data // Load inventory data
ArrayList<ItemStack> oldInventoryList = (ArrayList<ItemStack>) configFile.get(playerName + ".oldInventory"); ArrayList<ItemStack> oldInventoryList = (ArrayList<ItemStack>) configFile.get(playerName + ".oldInventory");

View File

@ -7,12 +7,13 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
import net.minecraft.server.v1_7_R2.EntityPlayer; import net.minecraft.server.v1_7_R3.EntityPlayer;
import net.minecraft.server.v1_7_R2.MinecraftServer; import net.minecraft.server.v1_7_R3.MinecraftServer;
import net.minecraft.server.v1_7_R2.PlayerInteractManager; import net.minecraft.server.v1_7_R3.PlayerInteractManager;
import net.minecraft.util.com.mojang.authlib.GameProfile; import net.minecraft.util.com.mojang.authlib.GameProfile;
import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang.math.NumberUtils;
@ -22,8 +23,8 @@ import org.bukkit.Location;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer; import org.bukkit.craftbukkit.v1_7_R3.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld; import org.bukkit.craftbukkit.v1_7_R3.CraftWorld;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
@ -434,7 +435,7 @@ public class P extends JavaPlugin {
return NumberUtils.toInt(string, 0); return NumberUtils.toInt(string, 0);
} }
public Player getOfflinePlayer(String player, String uuid) { public Player getOfflinePlayer(String player, UUID uuid) {
Player pplayer = null; Player pplayer = null;
try { try {
File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "players"); File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "players");
@ -461,7 +462,7 @@ public class P extends JavaPlugin {
return pplayer; return pplayer;
} }
public Player getOfflinePlayer(String player, String uuid, Location location) { public Player getOfflinePlayer(String player, UUID uuid, Location location) {
Player pplayer = null; Player pplayer = null;
try { try {
File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "players"); File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "players");

View File

@ -91,7 +91,7 @@ public class EntityListener implements Listener {
Entity entity2 = sub.getEntity(); Entity entity2 = sub.getEntity();
if (entity instanceof Projectile) { if (entity instanceof Projectile) {
entity = ((Projectile) entity).getShooter(); entity = (Entity) ((Projectile) entity).getShooter();
} }
if (entity instanceof Player && entity2 instanceof Player) { if (entity instanceof Player && entity2 instanceof Player) {