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