mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 13:36:00 +00:00
Profile Operations in Order
This commit is contained in:
1 parent
ccc16aa1ac
commit
f5a2ce27ff
4 files changed
+56
-13
No files matched your search
@@ -33,10 +33,19 @@ public class CNPCData implements IProfileData {
|
||||
PlayerData newData = new PlayerData();
|
||||
newData.player = player;
|
||||
customNPCData.setNBT((NBTTagCompound) newData.getNBT().copy());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
customNPCData.setNBT(replace);
|
||||
}
|
||||
customNPCData.updateClient = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSwitchPriority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifySwitch(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -6,24 +6,37 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
public interface IProfileData {
|
||||
|
||||
/**
|
||||
* Do not use the tag: - Name, lastLoaded, ID
|
||||
* Do not use the tags: Name, lastLoaded, ID.
|
||||
*
|
||||
* @return The Save Tag utilized in the Profile
|
||||
* @return The save tag utilized in the Profile.
|
||||
*/
|
||||
public String getTagName();
|
||||
|
||||
/**
|
||||
* @return NBTTagCompound of their Current Data for a given Entity Player
|
||||
* @return NBTTagCompound of the current data for a given EntityPlayer.
|
||||
*/
|
||||
public NBTTagCompound getCurrentNBT(EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Called immediately after setNBT() Replaces existing NBT
|
||||
* Called immediately after setNBT() to replace existing NBT.
|
||||
*/
|
||||
public void save(EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Replaces their Current Data operation when changing Profiles
|
||||
* Replaces the current data operation when changing profiles.
|
||||
*/
|
||||
public void setNBT(EntityPlayer player, NBTTagCompound replace);
|
||||
|
||||
/**
|
||||
* Returns the priority for this ProfileData's verification check.
|
||||
* Lower numbers run first.
|
||||
*/
|
||||
public int getSwitchPriority();
|
||||
|
||||
/**
|
||||
* Called before a profile switch occurs.
|
||||
* @param player The player switching profiles.
|
||||
* @return true if allowed, false if not.
|
||||
*/
|
||||
public boolean verifySwitch(EntityPlayer player);
|
||||
}
|
||||
@@ -4,5 +4,7 @@ public enum ProfileOperation {
|
||||
SUCCESS,
|
||||
ERROR,
|
||||
LOCKED,
|
||||
PLAYER_NOT_FOUND
|
||||
PLAYER_NOT_FOUND,
|
||||
VERIFICATION_FAILED
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user