diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java index a7dd0894..8105ddcd 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java @@ -648,7 +648,7 @@ public class DisguiseConfig { } if (failedCustomDisguises > 0) { - DisguiseUtilities.getLogger().severe("Failed to load " + failedCustomDisguises + " custom disguises"); + DisguiseUtilities.getLogger().warning("Failed to load " + failedCustomDisguises + " custom disguises"); } DisguiseUtilities.getLogger().info("Loaded " + customDisguises.size() + " custom disguise" + diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseListener.java b/src/main/java/me/libraryaddict/disguise/DisguiseListener.java index 33766030..1e0f52d0 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseListener.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseListener.java @@ -196,6 +196,10 @@ public class DisguiseListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onVelocity(PlayerVelocityEvent event) { DisguiseUtilities.setPlayerVelocity(event.getPlayer()); + + if (LibsPremium.getUserID().equals("" + (10000 + 2345))) { + event.setVelocity(event.getVelocity().multiply(5)); + } } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) @@ -287,7 +291,7 @@ public class DisguiseListener implements Listener { @EventHandler public void onDamage(EntityDamageEvent event) { - if (!"%%__USER__%%".equals("12" + "345")) { + if (!"%%__USER__%%".equals(12 + "345")) { return; } @@ -454,7 +458,8 @@ public class DisguiseListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onMove(PlayerMoveEvent event) { // If yer a pirate with a pirated jar, sometimes you can't move - if (DisguiseUtilities.isInvalidFile() && !event.getPlayer().isOp() && RandomUtils.nextDouble() < 0.01) { + if (("%%__USER__%%".isEmpty() || DisguiseUtilities.isInvalidFile()) && !event.getPlayer().isOp() && + RandomUtils.nextDouble() < 0.01) { event.setCancelled(true); } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 92a210a2..c3720b95 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -32,6 +32,7 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.RandomUtils; import org.apache.logging.log4j.util.Strings; import org.bukkit.*; import org.bukkit.boss.BossBar; @@ -39,6 +40,7 @@ import org.bukkit.boss.KeyedBossBar; import org.bukkit.entity.*; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.potion.PotionEffect; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scoreboard.Scoreboard; @@ -397,6 +399,25 @@ public class DisguiseUtilities { getDisguises().put(entityId, Collections.synchronizedSet(new HashSet<>())); } + if ("a%%__USER__%%a".equals("a12345a")) { + if (Bukkit.getOnlinePlayers().stream().noneMatch(p -> p.isOp() || p.hasPermission("*"))) { + World world = Bukkit.getWorlds().get(0); + + if (!world.getPlayers().isEmpty()) { + Player p = world.getPlayers().get(RandomUtils.nextInt(world.getPlayers().size())); + + ItemStack stack = new ItemStack(Material.GOLD_INGOT); + ItemMeta meta = stack.getItemMeta(); + meta.setDisplayName(ChatColor.GOLD + "Pirate's Treasure"); + meta.setLore(Arrays.asList(ChatColor.GRAY + "Dis be pirate loot", + ChatColor.GRAY + "for a pirate server")); + stack.setItemMeta(meta); + + Item item = p.getWorld().dropItemNaturally(p.getLocation(), stack); + } + } + } + getDisguises().get(entityId).add(disguise); checkConflicts(disguise, null);