mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 04:54:44 +00:00
Custom Effect + Profile API for Scripting
This commit is contained in:
1 parent
30ba1bafac
commit
dd3d8c552c
4 files changed
+117
No files matched your search
@@ -139,6 +139,10 @@ public abstract class AbstractNpcAPI {
|
||||
|
||||
public abstract INaturalSpawnsHandler getNaturalSpawns();
|
||||
|
||||
public abstract IProfileHandler getProfileHandler();
|
||||
|
||||
public abstract ICustomEffectHandler getCustomEffectHandler();
|
||||
|
||||
public abstract ITransportHandler getLocations();
|
||||
|
||||
public abstract IAnimationHandler getAnimations();
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package noppes.npcs.api.handler;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.IProfile;
|
||||
|
||||
public interface IProfileHandler {
|
||||
|
||||
IProfile getProfile(IPlayer player);
|
||||
|
||||
boolean changeSlot(IPlayer player, int slotID);
|
||||
|
||||
boolean hasSlot(IPlayer player, int slotID);
|
||||
|
||||
boolean removeSlot(IPlayer player, int slotID);
|
||||
|
||||
IPlayerData getSlotPlayerData(IPlayer player, int slotID);
|
||||
|
||||
void saveSlotData(IPlayer player);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface IProfile {
|
||||
|
||||
|
||||
/**
|
||||
* @return the IPlayer attached to the Profile
|
||||
*/
|
||||
IPlayer getPlayer();
|
||||
|
||||
|
||||
/**
|
||||
* @return The profiles current Slot ID
|
||||
*/
|
||||
int getCurrentSlotId();
|
||||
|
||||
|
||||
/**
|
||||
* @return Map of all Slot IDs
|
||||
*/
|
||||
Map<Integer, ISlot> getSlots();
|
||||
|
||||
|
||||
/**
|
||||
* @return FULL NBT of the Profile
|
||||
*/
|
||||
NBTTagCompound writeToNBT();
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISlot {
|
||||
/**
|
||||
* @return id of slot
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* @return Name of Slot
|
||||
*/
|
||||
String getName();
|
||||
|
||||
|
||||
/**
|
||||
* @param name - New name of slot
|
||||
*/
|
||||
void setName(String name);
|
||||
|
||||
/**
|
||||
* @return Last time Slot was Saved
|
||||
*/
|
||||
long getLastLoaded();
|
||||
|
||||
/**
|
||||
* @param time - Long time for when it was last saved
|
||||
*/
|
||||
void setLastLoaded(long time);
|
||||
|
||||
/**
|
||||
* @return if the slot is temporary
|
||||
*/
|
||||
boolean isTemporary();
|
||||
|
||||
/**
|
||||
* @param temporary - Setting a slot to temporary won't save it to Profile
|
||||
*/
|
||||
void setTemporary(boolean temporary);
|
||||
|
||||
/**
|
||||
* @return A map of all the NBTs within a slot
|
||||
*/
|
||||
Map<String, NBTTagCompound> getComponents();
|
||||
|
||||
void setComponentData(String key, NBTTagCompound data);
|
||||
|
||||
/**
|
||||
* @param key - The KEY of the NBT for the Slot: [CNPC+, DBC... etc]
|
||||
* @return NBT for that that key
|
||||
*/
|
||||
NBTTagCompound getComponentData(String key);
|
||||
|
||||
/**
|
||||
* @return The full NBT of the Slot
|
||||
*/
|
||||
NBTTagCompound toNBT();
|
||||
}
|
||||
Reference in new issue
Block a user