mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-09 09:54:14 +01:00
Instead of throwing a error then another error. Just make a FlagWatcher after the first error
This commit is contained in:
parent
34f0a13b39
commit
f535eefabf
@ -181,7 +181,6 @@ public abstract class Disguise {
|
|||||||
private int deadTicks = 0;
|
private int deadTicks = 0;
|
||||||
private int refreshDisguise = 0;
|
private int refreshDisguise = 0;
|
||||||
|
|
||||||
// TODO refactor
|
|
||||||
public void run() {
|
public void run() {
|
||||||
// If entity is no longer valid. Remove it.
|
// If entity is no longer valid. Remove it.
|
||||||
if (!getEntity().isValid()) {
|
if (!getEntity().isValid()) {
|
||||||
|
@ -68,10 +68,10 @@ public class FlagWatcher {
|
|||||||
public FlagWatcher clone(Disguise owningDisguise) {
|
public FlagWatcher clone(Disguise owningDisguise) {
|
||||||
FlagWatcher cloned = null;
|
FlagWatcher cloned = null;
|
||||||
try {
|
try {
|
||||||
cloned = getClass().getConstructor(Disguise.class).newInstance(owningDisguise);
|
cloned = getClass().getConstructor(Disguise.class).newInstance(getDisguise());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO: This will throw NPE
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
cloned = new FlagWatcher(getDisguise());
|
||||||
}
|
}
|
||||||
cloned.entityValues = (HashMap<Integer, Object>) entityValues.clone();
|
cloned.entityValues = (HashMap<Integer, Object>) entityValues.clone();
|
||||||
cloned.items = items.clone();
|
cloned.items = items.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user