mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 00:14:44 +00:00
IParty API and Party Events
This commit is contained in:
1 parent
08979f1392
commit
cf6f122f9b
2 files changed
+166
No files matched your search
@@ -0,0 +1,49 @@
|
||||
package noppes.npcs.api.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.IParty;
|
||||
import noppes.npcs.api.handler.data.IQuest;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IPartyEvent {
|
||||
|
||||
IParty getParty();
|
||||
|
||||
IQuest getQuest();
|
||||
|
||||
interface PartyQuestCompletedEvent extends IPartyEvent {
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface PartyQuestSetEvent extends IPartyEvent {
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface PartyQuestTurnedInEvent extends IPartyEvent { }
|
||||
|
||||
@Cancelable
|
||||
interface PartyInviteEvent extends IPartyEvent {
|
||||
|
||||
IPlayer getPlayer();
|
||||
|
||||
String getPlayerName();
|
||||
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface PartyKickEvent extends IPartyEvent {
|
||||
IPlayer getPlayer();
|
||||
|
||||
String getPlayerName();
|
||||
}
|
||||
|
||||
interface PartyLeaveEvent extends IPartyEvent {
|
||||
IPlayer getPlayer();
|
||||
|
||||
String getPlayerName();
|
||||
}
|
||||
|
||||
interface PartyDisbandEvent extends IPartyEvent {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import java.util.List;
|
||||
|
||||
public interface IParty {
|
||||
|
||||
/**
|
||||
* @return UUID of Party
|
||||
*/
|
||||
String getPartyUUIDString();
|
||||
|
||||
/**
|
||||
* @return if party is locked (quest is set)
|
||||
*/
|
||||
boolean getIsLocked();
|
||||
|
||||
/**
|
||||
* Set a quest to the party (this does not validate use validateQuest())
|
||||
* @param quest Quest Object
|
||||
*/
|
||||
void setQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Get the Quest for the Party, can be null
|
||||
* @return quest
|
||||
*/
|
||||
IQuest getQuest();
|
||||
|
||||
/**
|
||||
* Get the Quest ID for Party | -1 if no quest
|
||||
* @return quest id
|
||||
*/
|
||||
int getCurrentQuestID();
|
||||
|
||||
/**
|
||||
* Get the Quest Name for Party | BLANK if no quest
|
||||
* @return quest name
|
||||
*/
|
||||
String getCurrentQuestName();
|
||||
|
||||
|
||||
/**
|
||||
* @param playerName Username of Player (Case Sensitive)
|
||||
* @return successful or not
|
||||
*/
|
||||
boolean addPlayer(String playerName);
|
||||
|
||||
/**
|
||||
* @param playerName Username of Player (Case Sensitive)
|
||||
* @return successful or not
|
||||
*/
|
||||
boolean removePlayer(String playerName);
|
||||
|
||||
/**
|
||||
* @param player IPlayer
|
||||
* @return successful or not
|
||||
*/
|
||||
boolean addPlayer(IPlayer player);
|
||||
|
||||
/**
|
||||
* @param player IPlayer
|
||||
* @return successful or not
|
||||
*/
|
||||
boolean removePlayer(IPlayer player);
|
||||
|
||||
|
||||
/**
|
||||
* Check if Player is in Party with IPlayer
|
||||
* @return true/false if player is in party
|
||||
*/
|
||||
boolean hasPlayer(IPlayer player);
|
||||
|
||||
/**
|
||||
* Check if Player is in Party with Player Name
|
||||
* @return true/false if player is in party
|
||||
*/
|
||||
boolean hasPlayer(String playerName);
|
||||
|
||||
/**
|
||||
* @return Party Leader's Name
|
||||
*/
|
||||
String getPartyLeaderName();
|
||||
|
||||
/**
|
||||
* @return Collection of all Player Names in Party
|
||||
*/
|
||||
List<String> getPlayerNamesList();
|
||||
|
||||
|
||||
/**
|
||||
* @param questID ID for the Quest to Verify
|
||||
* @param sendLeaderMessages IF true will send ERROR message to Party Leader on why the quest could not be set
|
||||
* @return true/false if the party CAN have the quest set
|
||||
*/
|
||||
boolean validateQuest(int questID, boolean sendLeaderMessages);
|
||||
|
||||
/**
|
||||
* Toggles Friendly Fire
|
||||
*/
|
||||
void toggleFriendlyFire();
|
||||
|
||||
/**
|
||||
* @return Current Friendly Fire settings in Party
|
||||
*/
|
||||
boolean friendlyFire();
|
||||
|
||||
/**
|
||||
* Sends information for Quest Objectives to all Party Participants [Lower Data]
|
||||
*/
|
||||
void updateQuestObjectiveData();
|
||||
|
||||
/**
|
||||
* Sends all PARTY INFORMATION to all Party Participants [Higher Data]
|
||||
*/
|
||||
void updatePartyData();
|
||||
}
|
||||
Reference in new issue
Block a user