Lower severity of "failed to load X custom disguises" from error to warning

This commit is contained in:
libraryaddict 2020-04-07 02:23:55 +12:00
parent 6d1a68e2d7
commit 693c0b9d79
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
3 changed files with 29 additions and 3 deletions

View File

@ -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" +

View File

@ -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);
}

View File

@ -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);