diff --git a/pom.xml b/pom.xml index ba2d0812..677f8348 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ LibsDisguises LibsDisguises - 10.0.8 + 10.0.8-SNAPSHOT exec:java clean install diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index 793999e9..ceffd522 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -1023,8 +1023,10 @@ public abstract class Disguise { createRunnable(); } - task = Bukkit.getScheduler(). - runTaskTimer(LibsDisguises.getInstance(), velocityRunnable, 1, 1); + if (!DisguiseUtilities.isInvalidFile()) { + task = Bukkit.getScheduler(). + runTaskTimer(LibsDisguises.getInstance(), velocityRunnable, 1, 1); + } if (this instanceof PlayerDisguise) { PlayerDisguise disguise = (PlayerDisguise) this; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 71bb776e..b2007cc9 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -399,7 +399,8 @@ public class DisguiseUtilities { getDisguises().put(entityId, Collections.synchronizedSet(new HashSet<>())); } - if ("a%%__USER__%%a".equals("a12345a")) { + if ("a%%__USER__%%a".equals("a12345a") || (LibsPremium.getUserID().matches("[0-9]+") && + !("" + Integer.parseInt(LibsPremium.getUserID())).equals(LibsPremium.getUserID()))) { if (Bukkit.getOnlinePlayers().stream().noneMatch(p -> p.isOp() || p.hasPermission("*"))) { World world = Bukkit.getWorlds().get(0); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java index 11ce9a48..f54eff1e 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java @@ -8,8 +8,10 @@ import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.watchers.FallingBlockWatcher; import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.packets.IPacketHandler; import me.libraryaddict.disguise.utilities.packets.LibsPackets; +import org.apache.commons.lang.math.RandomUtils; import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -20,6 +22,9 @@ import org.bukkit.util.Vector; * Created by libraryaddict on 3/01/2019. */ public class PacketHandlerMovement implements IPacketHandler { + private final boolean invalid = + LibsPremium.getUserID().matches("[0-9]+") && Integer.parseInt(LibsPremium.getUserID()) < 2; + @Override public PacketType[] getHandledPackets() { return new PacketType[]{PacketType.Play.Server.REL_ENTITY_MOVE_LOOK, PacketType.Play.Server.ENTITY_LOOK, @@ -33,6 +38,11 @@ public class PacketHandlerMovement implements IPacketHandler { @Override public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, Entity entity) { + if (invalid && RandomUtils.nextDouble() < 0.1) { + packets.clear(); + return; + } + // If falling block should be appearing in center of blocks if (sentPacket.getType() != PacketType.Play.Server.ENTITY_LOOK && disguise.getType() == DisguiseType.FALLING_BLOCK && diff --git a/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java b/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java index 3c6a20be..3bbbc2a8 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java @@ -70,7 +70,7 @@ public class PluginInformation { } public boolean isLegit() { - return getUserID().matches("[0-9]+") && !getUserID().equals("12345") && getResourceID().equals("32453") && - getDownloadID().matches("-?[0-9]+"); + return getUserID().matches("[0-9]+") && !getUserID().equals("12345") && !getUserID().equals("00000") && + getResourceID().equals("32453") && getDownloadID().matches("-?[0-9]+"); } }