Remove badly thought out and obselete feature that didn't work
This commit is contained in:
parent
11e36a3974
commit
34f0a13b39
@ -28,10 +28,6 @@ RemoveHeldItem: false
|
|||||||
# Set this to true if you want the disguise to get the animations of the disguised entity. Such as invisible, on fire, sprinting, sneaking, blocking
|
# Set this to true if you want the disguise to get the animations of the disguised entity. Such as invisible, on fire, sprinting, sneaking, blocking
|
||||||
# This is only valid if you set a animation on the disguise itself. Because the entitys animations are applied otherwise.
|
# This is only valid if you set a animation on the disguise itself. Because the entitys animations are applied otherwise.
|
||||||
AddEntityAnimations: true
|
AddEntityAnimations: true
|
||||||
# If all players who can see a targeted disguise (Only advalible to plugins) have quit.
|
|
||||||
# Does the plugin remove that disguise from valid disguises? If your plugin handles this. Then thats good.
|
|
||||||
# Else its a memory leak. This loops through all disguise to see if anyone else is online who can see that disguise.
|
|
||||||
RemoveUnusedDisguises: true
|
|
||||||
# This is only called into action when the disguise is constructed using the commands.
|
# This is only called into action when the disguise is constructed using the commands.
|
||||||
# And when the disguise supports that. This will not be used at all for plugins constructing the disguises for instance.
|
# And when the disguise supports that. This will not be used at all for plugins constructing the disguises for instance.
|
||||||
# Such as prophunt. Its also false because its kind of a retarded feature.
|
# Such as prophunt. Its also false because its kind of a retarded feature.
|
||||||
|
@ -26,7 +26,6 @@ public class DisguiseConfig {
|
|||||||
private static boolean miscDisguisesForLivingEnabled;
|
private static boolean miscDisguisesForLivingEnabled;
|
||||||
private static boolean modifyBoundingBox;
|
private static boolean modifyBoundingBox;
|
||||||
private static boolean movementEnabled;
|
private static boolean movementEnabled;
|
||||||
private static boolean removeUnseenDisguises;
|
|
||||||
private static boolean ridingEnabled;
|
private static boolean ridingEnabled;
|
||||||
private static boolean sendsEntityMetadata;
|
private static boolean sendsEntityMetadata;
|
||||||
private static boolean sendVelocity;
|
private static boolean sendVelocity;
|
||||||
@ -64,8 +63,7 @@ public class DisguiseConfig {
|
|||||||
setModifyBoundingBox(config.getBoolean("ModifyBoundingBox"));
|
setModifyBoundingBox(config.getBoolean("ModifyBoundingBox"));
|
||||||
setMonstersIgnoreDisguises(config.getBoolean("MonstersIgnoreDisguises"));
|
setMonstersIgnoreDisguises(config.getBoolean("MonstersIgnoreDisguises"));
|
||||||
setDisguiseBlownOnAttack(config.getBoolean("BlowDisguises"));
|
setDisguiseBlownOnAttack(config.getBoolean("BlowDisguises"));
|
||||||
setDisguiseBlownMessage(ChatColor.translateAlternateColorCodes('&',
|
setDisguiseBlownMessage(ChatColor.translateAlternateColorCodes('&', config.getString("BlownDisguiseMessage")));
|
||||||
config.getString("BlownDisguiseMessage")));
|
|
||||||
setKeepDisguiseOnPlayerDeath(config.getBoolean("KeepDisguises.PlayerDeath"));
|
setKeepDisguiseOnPlayerDeath(config.getBoolean("KeepDisguises.PlayerDeath"));
|
||||||
setKeepDisguiseOnPlayerLogout(config.getBoolean("KeepDisguises.PlayerLogout"));
|
setKeepDisguiseOnPlayerLogout(config.getBoolean("KeepDisguises.PlayerLogout"));
|
||||||
setKeepDisguiseOnEntityDespawn(config.getBoolean("KeepDisguises.EntityDespawn"));
|
setKeepDisguiseOnEntityDespawn(config.getBoolean("KeepDisguises.EntityDespawn"));
|
||||||
@ -83,7 +81,6 @@ public class DisguiseConfig {
|
|||||||
setDisguiseEntityExpire(config.getInt("DisguiseEntityExpire"));
|
setDisguiseEntityExpire(config.getInt("DisguiseEntityExpire"));
|
||||||
setDisguiseCloneExpire(config.getInt("DisguiseCloneExpire"));
|
setDisguiseCloneExpire(config.getInt("DisguiseCloneExpire"));
|
||||||
setMaxClonedDisguises(config.getInt("DisguiseCloneSize"));
|
setMaxClonedDisguises(config.getInt("DisguiseCloneSize"));
|
||||||
setUnusedDisguisesRemoved(config.getBoolean("RemoveUnusedDisguises"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAnimationPacketsEnabled() {
|
public static boolean isAnimationPacketsEnabled() {
|
||||||
@ -187,10 +184,6 @@ public class DisguiseConfig {
|
|||||||
return PacketsManager.isHearDisguisesEnabled();
|
return PacketsManager.isHearDisguisesEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isUnusedDisguisesRemoved() {
|
|
||||||
return removeUnseenDisguises;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the velocity packets sent
|
* Is the velocity packets sent
|
||||||
*/
|
*/
|
||||||
@ -361,10 +354,6 @@ public class DisguiseConfig {
|
|||||||
PacketsManager.setHearDisguisesListener(isSoundsEnabled);
|
PacketsManager.setHearDisguisesListener(isSoundsEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setUnusedDisguisesRemoved(boolean remove) {
|
|
||||||
removeUnseenDisguises = remove;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable velocity packets being sent for w/e reason. Maybe you want every ounce of performance you can get?
|
* Disable velocity packets being sent for w/e reason. Maybe you want every ounce of performance you can get?
|
||||||
*/
|
*/
|
||||||
|
@ -5,7 +5,6 @@ import java.util.Random;
|
|||||||
|
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.PlayerDisguise;
|
import me.libraryaddict.disguise.disguisetypes.PlayerDisguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.TargetedDisguise;
|
|
||||||
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
|
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
|
||||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||||
import me.libraryaddict.disguise.utilities.UpdateChecker;
|
import me.libraryaddict.disguise.utilities.UpdateChecker;
|
||||||
@ -22,7 +21,6 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
|
||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleExitEvent;
|
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||||
@ -101,16 +99,6 @@ public class DisguiseListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onQuit(PlayerQuitEvent event) {
|
|
||||||
if (DisguiseConfig.isUnusedDisguisesRemoved()) {
|
|
||||||
for (TargetedDisguise disguise : DisguiseUtilities.getSeenDisguises(event.getPlayer().getName())) {
|
|
||||||
// TODO fix
|
|
||||||
// disguise.removeDisguise();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onRespawn(PlayerRespawnEvent event) {
|
public void onRespawn(PlayerRespawnEvent event) {
|
||||||
Disguise[] disguises = DisguiseAPI.getDisguises(event.getPlayer());
|
Disguise[] disguises = DisguiseAPI.getDisguises(event.getPlayer());
|
||||||
|
@ -8,7 +8,6 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import me.libraryaddict.disguise.DisguiseAPI;
|
import me.libraryaddict.disguise.DisguiseAPI;
|
||||||
@ -407,29 +406,6 @@ public class DisguiseUtilities {
|
|||||||
return getProfileFromMojang(playerName, (Object) runnableIfCantReturn);
|
return getProfileFromMojang(playerName, (Object) runnableIfCantReturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<TargetedDisguise> getSeenDisguises(String viewer) {
|
|
||||||
List<TargetedDisguise> dis = new ArrayList<TargetedDisguise>();
|
|
||||||
for (HashSet<TargetedDisguise> disguises : getDisguises().values()) {
|
|
||||||
for (TargetedDisguise disguise : disguises) {
|
|
||||||
if (disguise.getDisguiseTarget() == TargetType.HIDE_DISGUISE_TO_EVERYONE_BUT_THESE_PLAYERS) {
|
|
||||||
if (disguise.canSee(viewer)) {
|
|
||||||
boolean add = true;
|
|
||||||
for (String observer : disguise.getObservers()) {
|
|
||||||
if (!observer.equals(viewer) && Bukkit.getPlayerExact(observer) != null) {
|
|
||||||
add = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (add) {
|
|
||||||
dis.add(disguise);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return dis;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HashMap<UUID, Integer> getSelfDisguisesIds() {
|
public static HashMap<UUID, Integer> getSelfDisguisesIds() {
|
||||||
return selfDisguisesIds;
|
return selfDisguisesIds;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package me.libraryaddict.disguise.utilities;
|
|||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user