A lot of GOOD API DOCUMENTATION

This commit is contained in:
Kam committed 2026-03-09 16:20:07 -04:00
1 parent a6c55ca331
commit 319e774518
131 files changed
+3363 -175

No files matched your search

+8
View File
@@ -2,9 +2,17 @@ package noppes.npcs.api.roles;
import net.minecraft.entity.INpc;
/**
* Base interface for all NPC roles (Trader, Follower, Bank, Mailman, Transporter).
*/
public interface IRole {
/** @return the NPC this role is assigned to. */
INpc getNpc();
/**
* @return the role type ordinal.
* 0: None, 1: Trader, 2: Follower, 3: Bank, 4: Transporter, 5: Mailman.
*/
int getType();
}
@@ -1,5 +1,8 @@
package noppes.npcs.api.roles;
/**
* Represents the banker role for an NPC, providing storage access to players.
*/
public interface IRoleBank extends IRole {
}
@@ -22,8 +22,10 @@ public interface IRoleFollower extends IRole {
*/
boolean hasOwner();
/** @return true if the follower is currently following the owner. */
boolean isFollowing();
/** @param following true to make the follower follow the owner. */
void setIsFollowing(boolean following);
/**
@@ -1,5 +1,8 @@
package noppes.npcs.api.roles;
/**
* Represents the mailman role for an NPC, enabling mail delivery to players.
*/
public interface IRoleMailman extends IRole {
}
+1 -1
View File
@@ -285,7 +285,7 @@ public interface IRoleTrader extends IRole {
/**
* @param slot Slot number 0-17
* @return Whether this slot has a currency cost > 0
* @return Whether this slot has a currency cost > 0
*/
boolean hasCurrencyCost(int slot);
}
@@ -4,16 +4,36 @@ import net.minecraft.entity.player.EntityPlayerMP;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.handler.data.ITransportLocation;
/**
* Represents the transporter role for an NPC, allowing players to teleport
* between unlocked transport locations.
*/
public interface IRoleTransporter extends IRole {
/** @return the display name of this transporter NPC. */
String getName();
/** @return the transport location ID assigned to this NPC. */
int getTransportId();
/**
* Unlocks the given transport location for the player.
*
* @param player the player.
* @param location the transport location to unlock.
*/
void unlock(IPlayer<EntityPlayerMP> player, ITransportLocation location);
/** @return the transport location assigned to this NPC, or null if none. */
ITransportLocation getTransport();
/** @return true if this NPC has a transport location assigned. */
boolean hasTransport();
/**
* Assigns a transport location to this NPC.
*
* @param location the transport location.
*/
void setTransport(ITransportLocation location);
}