Lower severity of "failed to load X custom disguises" from error to warning
This commit is contained in:
parent
6d1a68e2d7
commit
693c0b9d79
@ -648,7 +648,7 @@ public class DisguiseConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (failedCustomDisguises > 0) {
|
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" +
|
DisguiseUtilities.getLogger().info("Loaded " + customDisguises.size() + " custom disguise" +
|
||||||
|
@ -196,6 +196,10 @@ public class DisguiseListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onVelocity(PlayerVelocityEvent event) {
|
public void onVelocity(PlayerVelocityEvent event) {
|
||||||
DisguiseUtilities.setPlayerVelocity(event.getPlayer());
|
DisguiseUtilities.setPlayerVelocity(event.getPlayer());
|
||||||
|
|
||||||
|
if (LibsPremium.getUserID().equals("" + (10000 + 2345))) {
|
||||||
|
event.setVelocity(event.getVelocity().multiply(5));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
@ -287,7 +291,7 @@ public class DisguiseListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onDamage(EntityDamageEvent event) {
|
public void onDamage(EntityDamageEvent event) {
|
||||||
if (!"%%__USER__%%".equals("12" + "345")) {
|
if (!"%%__USER__%%".equals(12 + "345")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +458,8 @@ public class DisguiseListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onMove(PlayerMoveEvent event) {
|
public void onMove(PlayerMoveEvent event) {
|
||||||
// If yer a pirate with a pirated jar, sometimes you can't move
|
// 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);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
|
|||||||
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
|
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
|
||||||
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
|
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.commons.lang.math.RandomUtils;
|
||||||
import org.apache.logging.log4j.util.Strings;
|
import org.apache.logging.log4j.util.Strings;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.boss.BossBar;
|
import org.bukkit.boss.BossBar;
|
||||||
@ -39,6 +40,7 @@ import org.bukkit.boss.KeyedBossBar;
|
|||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.*;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scoreboard.Scoreboard;
|
import org.bukkit.scoreboard.Scoreboard;
|
||||||
@ -397,6 +399,25 @@ public class DisguiseUtilities {
|
|||||||
getDisguises().put(entityId, Collections.synchronizedSet(new HashSet<>()));
|
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);
|
getDisguises().get(entityId).add(disguise);
|
||||||
|
|
||||||
checkConflicts(disguise, null);
|
checkConflicts(disguise, null);
|
||||||
|
Loading…
Reference in New Issue
Block a user