Rename discard() to removeDisguise(). Make the disguise reusable
This commit is contained in:
		@@ -106,7 +106,7 @@ public class DisguiseAPI {
 | 
			
		||||
        setupPlayerFakeDisguise(disguise);
 | 
			
		||||
        // Discard the disguise
 | 
			
		||||
        if (oldDisguise != null)
 | 
			
		||||
            oldDisguise.discard();
 | 
			
		||||
            oldDisguise.removeDisguise();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -368,7 +368,7 @@ public class DisguiseAPI {
 | 
			
		||||
        Bukkit.getPluginManager().callEvent(event);
 | 
			
		||||
        if (event.isCancelled())
 | 
			
		||||
            return;
 | 
			
		||||
        disguise.discard();
 | 
			
		||||
        disguise.removeDisguise();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public HashMap<Integer, Disguise> getDisguises() {
 | 
			
		||||
 
 | 
			
		||||
@@ -205,18 +205,14 @@ public class Disguise {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Destroys the disguise and undisguises the entity if its using this disguise. This doesn't fire a UndisguiseEvent
 | 
			
		||||
     * Removes the disguise and undisguises the entity if its using this disguise. This doesn't fire a UndisguiseEvent
 | 
			
		||||
     */
 | 
			
		||||
    public void discard() {
 | 
			
		||||
        // If the runnable is null. Just return. Its been discarded already.
 | 
			
		||||
        if (runnable == null)
 | 
			
		||||
            return;
 | 
			
		||||
    public void removeDisguise() {
 | 
			
		||||
        // Why the hell can't I safely check if its running?!?!
 | 
			
		||||
        try {
 | 
			
		||||
            runnable.cancel();
 | 
			
		||||
        } catch (Exception ex) {
 | 
			
		||||
        }
 | 
			
		||||
        runnable = null;
 | 
			
		||||
        HashMap<Integer, Disguise> disguises = disguiseAPI.getDisguises();
 | 
			
		||||
        // If this disguise has a entity set
 | 
			
		||||
        if (getEntity() != null) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user