Fix up stuff a little for latest ProtocolLib, more disguise params

This commit is contained in:
libraryaddict
2016-07-08 17:59:30 +12:00
parent 37395a1a6d
commit e6627c1fea
8 changed files with 75 additions and 34 deletions

View File

@@ -23,6 +23,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.potion.PotionEffectType;
import com.comphenix.protocol.wrappers.BlockPosition;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.comphenix.protocol.wrappers.WrappedSignedProperty;
import com.google.gson.Gson;
@@ -952,7 +953,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor
{
BlockFace face = BlockFace.valueOf(valueString.toUpperCase());
if (face.ordinal() > 4)
if (face.ordinal() > 5)
{
throw new DisguiseParseException();
}
@@ -961,7 +962,8 @@ public abstract class BaseDisguiseCommand implements CommandExecutor
}
catch (Exception ex)
{
throw parseToException("a direction (north, east, south, west, up)", valueString, methodName);
throw parseToException("a direction (north, east, south, west, up, down)", valueString,
methodName);
}
}
else if (param == RabbitType.class)
@@ -988,6 +990,23 @@ public abstract class BaseDisguiseCommand implements CommandExecutor
throw parseToException("rabbit type (white, brown, patches...)", valueString, methodName);
}
}
else if (param == BlockPosition.class)
{
try
{
String[] split = valueString.split(",");
assert split.length == 3;
value = new BlockPosition(Integer.parseInt(split[0]), Integer.parseInt(split[1]),
Integer.parseInt(split[2]));
}
catch (Exception ex)
{
throw parseToException("three numbers Number,Number,Number", valueString,
methodName);
}
}
}
if (value == null && boolean.class == param)

View File

@@ -14,6 +14,9 @@ import org.bukkit.command.CommandSender;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import com.comphenix.protocol.wrappers.BlockPosition;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import me.libraryaddict.disguise.disguisetypes.AnimalColor;
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
@@ -316,6 +319,15 @@ public class HelpDisguiseCommand extends BaseDisguiseCommand
{
valueType = "rabbit type";
}
else if (c == BlockPosition.class)
{
valueType = "three numbers";
}
else if (c == WrappedGameProfile.class)
{
valueType = "gameprofile";
}
if (valueType != null)
{
ChatColor methodColor = ChatColor.YELLOW;