geforkt von Mirrors/Paper
Update Bukkit for Minecraft 1.7.8
By: Travis Watkins <amaranth@ubuntu.com>
Dieser Commit ist enthalten in:
Ursprung
9581550637
Commit
07c1670354
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.7.5-R0.1-SNAPSHOT</version>
|
||||
<version>1.7.8-R0.1-SNAPSHOT</version>
|
||||
<name>Bukkit</name>
|
||||
<url>http://www.bukkit.org</url>
|
||||
|
||||
|
@ -20,6 +20,10 @@ public interface BanList {
|
||||
* Banned player IP addresses
|
||||
*/
|
||||
IP,
|
||||
/**
|
||||
* Banned player UUID
|
||||
*/
|
||||
UUID,
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -19,12 +19,12 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
|
||||
/**
|
||||
* Returns the name of this player
|
||||
* <p>
|
||||
* Names are no longer unique past a single game session. For persistent storage
|
||||
* it is recommended that you use {@link #getUniqueId()} instead.
|
||||
*
|
||||
* @deprecated Use {@link #getUniqueId()} as player names are no longer
|
||||
* guaranteed to be unique
|
||||
* @return Player name
|
||||
* @return Player name or null if we have not seen a name for this player yet
|
||||
*/
|
||||
@Deprecated
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
|
@ -558,13 +558,17 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Gets the player by the given name, regardless if they are offline or
|
||||
* online.
|
||||
* <p>
|
||||
* This method may involve a blocking web request to get the UUID for the
|
||||
* given name.
|
||||
* <p>
|
||||
* This will return an object even if the player does not exist. To this
|
||||
* method, all players will exist.
|
||||
*
|
||||
* @deprecated Use {@link #getOfflinePlayer(UUID)} as player names are no
|
||||
* longer guaranteed to be unique
|
||||
* @deprecated Persistent storage of users should be by UUID as names are no longer
|
||||
* unique past a single session.
|
||||
* @param name the name the player to retrieve
|
||||
* @return an offline player
|
||||
* @see #getOfflinePlayer(java.util.UUID)
|
||||
*/
|
||||
@Deprecated
|
||||
public OfflinePlayer getOfflinePlayer(String name);
|
||||
@ -611,6 +615,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
|
||||
/**
|
||||
* Gets a ban list for the supplied type.
|
||||
* <p>
|
||||
* Bans by name are no longer supported and this method will return
|
||||
* null when trying to request them. The replacement is bans by UUID.
|
||||
*
|
||||
* @param type the type of list to fetch, cannot be null
|
||||
* @return a ban list of the specified type
|
||||
|
@ -1,7 +1,10 @@
|
||||
package org.bukkit.block;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.SkullType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents a Skull
|
||||
*/
|
||||
@ -17,18 +20,43 @@ public interface Skull extends BlockState {
|
||||
/**
|
||||
* Gets the owner of the skull
|
||||
*
|
||||
* @return the owner of the skull
|
||||
* @return the owner of the skull or null if the profile does not have a name
|
||||
* @deprecated Skulls no longer store player names, they store profiles
|
||||
* @see #getPlayer()
|
||||
*/
|
||||
@Deprecated
|
||||
public String getOwner();
|
||||
|
||||
/**
|
||||
* Sets the owner of the skull
|
||||
* Does nothing
|
||||
*
|
||||
* @param name the new owner of the skull
|
||||
* @return true if the owner was successfully set
|
||||
* @deprecated Skulls no longer store player names, they store profiles
|
||||
* @see #setPlayer(org.bukkit.OfflinePlayer)
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean setOwner(String name);
|
||||
|
||||
/**
|
||||
* Gets the owner of the skull, if one exists
|
||||
*
|
||||
* @return the owner of the skull or null if this skull does not have an owner
|
||||
*/
|
||||
public OfflinePlayer getPlayer();
|
||||
|
||||
/**
|
||||
* Sets the owner of the skull to this player
|
||||
* <p>
|
||||
* If the owner does not contain all the needed data for the skull a call to
|
||||
* {@link #update()} may potentially involve a blocking web request to acquire
|
||||
* the missing data.
|
||||
*
|
||||
* @param player the new owner of the skull
|
||||
* @return true if the owner was successfully set
|
||||
*/
|
||||
public boolean setPlayer(OfflinePlayer player);
|
||||
|
||||
/**
|
||||
* Gets the rotation of the skull in the world
|
||||
*
|
||||
|
@ -29,10 +29,17 @@ public class BanCommand extends VanillaCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
String reason = args.length > 0 ? StringUtils.join(args, ' ', 1, args.length) : null;
|
||||
Bukkit.getBanList(BanList.Type.NAME).addBan(args[0], reason, null, sender.getName());
|
||||
|
||||
Player player = Bukkit.getPlayer(args[0]);
|
||||
String uuid;
|
||||
if (player != null) {
|
||||
uuid = player.getUniqueId().toString();
|
||||
} else {
|
||||
uuid = sender.getServer().getOfflinePlayer(args[0]).getUniqueId().toString();
|
||||
}
|
||||
|
||||
String reason = args.length > 0 ? StringUtils.join(args, ' ', 1, args.length) : null;
|
||||
Bukkit.getBanList(BanList.Type.UUID).addBan(uuid, reason, null, sender.getName());
|
||||
|
||||
if (player != null) {
|
||||
player.kickPlayer("Banned by admin.");
|
||||
}
|
||||
|
@ -2,12 +2,14 @@ package org.bukkit.command.defaults;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.BanEntry;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
@ -27,7 +29,7 @@ public class BanListCommand extends VanillaCommand {
|
||||
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
|
||||
if (!testPermission(sender)) return true;
|
||||
|
||||
BanList.Type banType = BanList.Type.NAME;
|
||||
BanList.Type banType = BanList.Type.UUID;
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("ips")) {
|
||||
banType = BanList.Type.IP;
|
||||
@ -48,6 +50,19 @@ public class BanListCommand extends VanillaCommand {
|
||||
message.append(", ");
|
||||
}
|
||||
}
|
||||
|
||||
String output = banlist[x].getTarget();
|
||||
if (banType == BanList.Type.UUID) {
|
||||
try {
|
||||
OfflinePlayer player = sender.getServer().getOfflinePlayer(UUID.fromString(output));
|
||||
if (player.getName() != null) {
|
||||
output = player.getName();
|
||||
}
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// We seem to have an invalid UUID, what do?
|
||||
}
|
||||
}
|
||||
|
||||
message.append(banlist[x].getTarget());
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,8 @@ public class PardonCommand extends VanillaCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
Bukkit.getBanList(BanList.Type.NAME).pardon(args[0]);
|
||||
String uuid = sender.getServer().getOfflinePlayer(args[0]).getUniqueId().toString();
|
||||
Bukkit.getBanList(BanList.Type.UUID).pardon(uuid);
|
||||
Command.broadcastCommandMessage(sender, "Pardoned " + args[0]);
|
||||
return true;
|
||||
}
|
||||
|
@ -1,11 +1,20 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface AnimalTamer {
|
||||
|
||||
/**
|
||||
* This is the name of the specified AnimalTamer.
|
||||
*
|
||||
* @return The name to reference on tamed animals
|
||||
* @return The name to reference on tamed animals or null if a name cannot be obtained
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* This is the UUID of the specified AnimalTamer.
|
||||
*
|
||||
* @return The UUID to reference on tamed animals
|
||||
*/
|
||||
public UUID getUniqueId();
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren