Package noppes.npcs.api
Class NpcAPI
java.lang.Object
noppes.npcs.api.NpcAPI
public abstract class NpcAPI
extends java.lang.Object
Note this API should only be used Server side not on the client
-
Constructor Summary
Constructors Constructor Description NpcAPI()
-
Method Summary
Modifier and Type Method Description abstract ICustomGui
createCustomGui(int id, int width, int height, boolean pauseGame)
abstract IPlayerMail
createMail(java.lang.String sender, java.lang.String subject)
abstract ICustomNpc
createNPC(net.minecraft.world.World world)
Doesnt spawn the npc in the worldabstract net.minecraftforge.fml.common.eventhandler.EventBus
events()
Used by moddersabstract java.lang.String
executeCommand(IWorld world, java.lang.String command)
abstract ICloneHandler
getClones()
abstract IDialogHandler
getDialogs()
abstract IFactionHandler
getFactions()
abstract java.io.File
getGlobalDir()
abstract IBlock
getIBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
abstract IContainer
getIContainer(net.minecraft.inventory.Container container)
abstract IContainer
getIContainer(net.minecraft.inventory.IInventory inventory)
abstract IDamageSource
getIDamageSource(net.minecraft.util.DamageSource damagesource)
abstract IEntity
getIEntity(net.minecraft.entity.Entity entity)
abstract IItemStack
getIItemStack(net.minecraft.item.ItemStack itemstack)
abstract INbt
getINbt(net.minecraft.nbt.NBTTagCompound compound)
abstract IPos
getIPos(double x, double y, double z)
abstract IWorld
getIWorld(int dimensionId)
abstract IWorld
getIWorld(net.minecraft.world.WorldServer world)
abstract IWorld[]
getIWorlds()
abstract IQuestHandler
getQuests()
abstract java.lang.String
getRandomName(int dictionary, int gender)
abstract INbt
getRawPlayerData(java.lang.String uuid)
Get player data even if they are offlineabstract IRecipeHandler
getRecipes()
abstract java.io.File
getWorldDir()
abstract boolean
hasPermissionNode(java.lang.String permission)
static NpcAPI
Instance()
static boolean
IsAvailable()
abstract void
registerCommand(CommandNoppesBase command)
Use to register your own /noppes subcommandabstract void
registerPermissionNode(java.lang.String permission, int defaultType)
abstract ICustomNpc
spawnNPC(net.minecraft.world.World world, int x, int y, int z)
Creates and spawns an npcabstract INbt
stringToNbt(java.lang.String str)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
NpcAPI
public NpcAPI()
-
-
Method Details
-
createNPC
Doesnt spawn the npc in the world -
spawnNPC
Creates and spawns an npc -
getIEntity
-
getIBlock
public abstract IBlock getIBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) -
getIContainer
-
getIContainer
-
getIItemStack
-
getIWorld
-
getIWorld
-
getIWorlds
-
getINbt
-
getIPos
-
getFactions
-
getRecipes
-
getQuests
-
getDialogs
-
getClones
-
getIDamageSource
-
stringToNbt
-
createMail
-
createCustomGui
-
getRawPlayerData
Get player data even if they are offline- Parameters:
uuid
-- Returns:
-
events
public abstract net.minecraftforge.fml.common.eventhandler.EventBus events()Used by modders- Returns:
- The event bus where you register CustomNPCEvents
-
registerCommand
Use to register your own /noppes subcommand -
getGlobalDir
public abstract java.io.File getGlobalDir()- Returns:
- Returns the .minecraft/customnpcs folder or [yourserverfolder]/customnpcs
-
getWorldDir
public abstract java.io.File getWorldDir()- Returns:
- Returns the .minecraft/saves/[yourworld]/customnpcs folder or [yourserverfolder]/[yourworld]/customnpcs
-
IsAvailable
public static boolean IsAvailable() -
Instance
-
registerPermissionNode
public abstract void registerPermissionNode(java.lang.String permission, int defaultType)- Parameters:
permission
- Permission node, best if it's lowercase and contains '.' (e.g."modid.subgroup.permission_id"
)defaultType
- 0:ALL, 1:OP, 2:NONE. This determines who can use the permission by default everybody, only ops or nobody
-
hasPermissionNode
public abstract boolean hasPermissionNode(java.lang.String permission) -
executeCommand
- Parameters:
world
- The world in which the command is executedcommand
- The Command to execute- Returns:
-
getRandomName
public abstract java.lang.String getRandomName(int dictionary, int gender)- Parameters:
dictionary
- 0:roman, 1:japanese, 2:slavic, 3:welsh, 4:saami, 5:old-norse, 6:ancient-greek, 7:aztec, 8:classic-cnpcs, 9:spanishgender
- 0:random, 1:male, 2:female- Returns:
- Returns a randomly generated name
-