Initial work for custom disguises

This commit is contained in:
libraryaddict
2020-04-13 21:14:04 +12:00
parent 80cf5cef27
commit 3c40a27c8f
8 changed files with 74 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ import com.comphenix.protocol.wrappers.WrappedDataWatcher;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.disguisetypes.*;
import me.libraryaddict.disguise.disguisetypes.watchers.CustomWatcher;
import me.libraryaddict.disguise.disguisetypes.watchers.FallingBlockWatcher;
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
@@ -221,7 +222,7 @@ public class PacketHandlerSpawn implements IPacketHandler {
} else {
spawnPlayer.getDataWatcherModifier().write(0, newWatcher);
}
} else if (disguise.getType().isMob() || disguise.getType() == DisguiseType.ARMOR_STAND) {
} else if (disguise.isMobDisguise() || disguise.getType() == DisguiseType.ARMOR_STAND) {
Vector vec = disguisedEntity.getVelocity();
PacketContainer spawnEntity = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_LIVING);
@@ -231,7 +232,12 @@ public class PacketHandlerSpawn implements IPacketHandler {
mods.write(0, disguisedEntity.getEntityId());
mods.write(1, disguisedEntity.getUniqueId());
mods.write(2, disguise.getType().getTypeId());
if (disguise.getType() != DisguiseType.CUSTOM) {
mods.write(2, disguise.getType().getTypeId());
} else {
mods.write(2, ((CustomWatcher) disguise.getWatcher()).getTypeId());
}
// region Vector calculations
double d1 = 3.9D;

View File

@@ -231,9 +231,9 @@ public enum LibsMsg {
GRAB_DISG_HELP_1(ChatColor.GREEN +
"You can choose a name to save the skins under, the names will be usable as if it was an actual player " +
"skin"),
GRAB_DISG_HELP_2(ChatColor.DARK_GREEN + "/grabskin https://somesite.com/myskin.png <Optional Name>"),
GRAB_DISG_HELP_3(ChatColor.DARK_GREEN + "/grabskin myskin.png <Optional Name> - Skins must be in the folder!"),
GRAB_DISG_HELP_4(ChatColor.DARK_GREEN + "/grabskin <Player name or UUID> <Optional Name>"),
GRAB_DISG_HELP_2(ChatColor.DARK_GREEN + "/grabskin <Optional Name> https://somesite.com/myskin.png"),
GRAB_DISG_HELP_3(ChatColor.DARK_GREEN + "/grabskin <Optional Name> myskin.png - Skins must be in the folder!"),
GRAB_DISG_HELP_4(ChatColor.DARK_GREEN + "/grabskin <Optional Name> <Player name or UUID>"),
GRAB_DISG_HELP_5(ChatColor.GREEN + "If you want the slim Alex version of the skin, append :slim. So 'myskin.png:slim'"),
GRAB_DISG_HELP_6(
ChatColor.GREEN + "You will be sent the skin data, but you can also use the saved names in disguises"),