mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-19 17:39:45 +00:00
Add CNPC+ Api
This commit is contained in:
1 parent
0c4db676e4
commit
95e2f9df01
109 files changed
+7308
No files matched your search
@@ -0,0 +1,10 @@
|
||||
package noppes.npcs.api.roles;
|
||||
|
||||
import net.minecraft.entity.INpc;
|
||||
|
||||
public interface IRole {
|
||||
|
||||
INpc getNpc();
|
||||
|
||||
int getType();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package noppes.npcs.api.roles;
|
||||
|
||||
public interface IRoleBank extends IRole {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package noppes.npcs.api.roles;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
public interface IRoleFollower extends IRole {
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param player Player who is set as the owner. If null given everything resets
|
||||
*/
|
||||
void setOwner(IPlayer player);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns the followers owner. Returns null if he has no owner or the owner is offline
|
||||
*/
|
||||
IPlayer getOwner();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower has an owner
|
||||
*/
|
||||
boolean hasOwner();
|
||||
|
||||
boolean isFollowing();
|
||||
|
||||
void setIsFollowing(boolean following);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns days left
|
||||
*/
|
||||
int getDaysLeft();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param days The days you want to add to the days remaining
|
||||
*/
|
||||
void addDaysLeft(int days);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower is set to infinite days
|
||||
*/
|
||||
boolean getInfiniteDays();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param infinite Sets whether the days hired are infinite
|
||||
*/
|
||||
void setInfiniteDays(boolean infinite);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Return whether the gui is disabled
|
||||
*/
|
||||
boolean getGuiDisabled();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param disabled Set the gui to be disabled or not
|
||||
*/
|
||||
void setGuiDisabled(boolean disabled);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package noppes.npcs.api.roles;
|
||||
|
||||
public interface IRoleMailman extends IRole {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package noppes.npcs.api.roles;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IRoleTrader extends IRole {
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param currency2 Currency item number two
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
void setSellOption(int slot, IItemStack currency, IItemStack currency2, IItemStack sold);
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
void setSellOption(int slot, IItemStack currency, IItemStack sold);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return The item being sold in this slot.
|
||||
*/
|
||||
IItemStack getSellOption(int slot);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return a ScriptItemStack array of size 2 which contains the currency of this trade
|
||||
*/
|
||||
IItemStack[] getCurrency(int slot);
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
*/
|
||||
void removeSellOption(int slot);
|
||||
|
||||
/**
|
||||
* @param name The trader Linked Market name
|
||||
*/
|
||||
void setMarket(String name);
|
||||
|
||||
/**
|
||||
* @return Get the currently set Linked Market name
|
||||
*/
|
||||
String getMarket();
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return the number of times an item has been sold on that slot
|
||||
*/
|
||||
int getPurchaseNum(int slot);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @param player
|
||||
* @return the number of times this player has purchased from this trader
|
||||
*/
|
||||
int getPurchaseNum(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* Sets the purchase count of all slots to 0
|
||||
*/
|
||||
void resetPurchaseNum();
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot to 0
|
||||
* @param slot
|
||||
*/
|
||||
void resetPurchaseNum(int slot);
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot and player to 0
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
void resetPurchaseNum(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return if this slot is enabled
|
||||
*/
|
||||
boolean isSlotEnabled(int slot);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @param player
|
||||
* @return if this slot is enabled for this player
|
||||
*/
|
||||
boolean isSlotEnabled(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* prevent an item from being sold on that slot
|
||||
* @param slot
|
||||
*/
|
||||
void disableSlot(int slot);
|
||||
|
||||
/**
|
||||
* disables the slot for this player
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
void disableSlot(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* allow an item to be sold on that slot
|
||||
* @param slot
|
||||
*/
|
||||
void enableSlot(int slot);
|
||||
|
||||
/**
|
||||
* enables the slot for this player
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
void enableSlot(int slot, IPlayer player);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package noppes.npcs.api.roles;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.ITransportLocation;
|
||||
|
||||
public interface IRoleTransporter extends IRole {
|
||||
String getName();
|
||||
|
||||
int getTransportId();
|
||||
|
||||
void unlock(IPlayer<EntityPlayerMP> player, ITransportLocation location);
|
||||
|
||||
ITransportLocation getTransport();
|
||||
|
||||
boolean hasTransport();
|
||||
|
||||
void setTransport(ITransportLocation location);
|
||||
}
|
||||
Reference in new issue
Block a user