Made the disguise class abstract, the same for the clone class

This commit is contained in:
Andrew 2013-11-06 05:36:18 +13:00
parent eb6d158ad4
commit fb38bcd99f

View File

@ -31,7 +31,7 @@ import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.reflect.StructureModifier; import com.comphenix.protocol.reflect.StructureModifier;
public class Disguise { public abstract class Disguise {
/** /**
* Incase I forget, this is used to access normally hidden api calls. * Incase I forget, this is used to access normally hidden api calls.
*/ */
@ -52,16 +52,8 @@ public class Disguise {
return hearSelfDisguise; return hearSelfDisguise;
} }
public Disguise clone() { @Override
Disguise disguise = new Disguise().createDisguise(getType(), replaceSounds()); public abstract Disguise clone();
disguise.setViewSelfDisguise(viewSelfDisguise());
disguise.setHearSelfDisguise(canHearSelfDisguise());
disguise.setHideArmorFromSelf(isHidingArmorFromSelf());
disguise.setHideHeldItemFromSelf(isHidingHeldItemFromSelf());
disguise.setVelocitySent(isVelocitySent());
disguise.setWatcher(getWatcher().clone());
return disguise;
}
protected Disguise createDisguise(DisguiseType newType, boolean doSounds) { protected Disguise createDisguise(DisguiseType newType, boolean doSounds) {
if (getWatcher() != null) if (getWatcher() != null)