mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
Implemented custom commands.
This commit is contained in:
1 parent
a47af08d0f
commit
3d498814f9
3 files changed
+91
-1
No files matched your search
@@ -6,8 +6,10 @@
|
||||
package noppes.npcs.scripted;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventBus;
|
||||
import foxz.command.ScriptedCommand;
|
||||
import jdk.nashorn.internal.ir.debug.ObjectSizeCalculator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.command.CommandHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -69,6 +71,14 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
worldCache.clear();
|
||||
}
|
||||
|
||||
public void registerICommand(ICommand command) {
|
||||
((CommandHandler)CustomNpcs.getServer().getCommandManager()).registerCommand((ScriptedCommand) command);
|
||||
}
|
||||
|
||||
public ICommand getICommand(String commandName, int priorityLevel) {
|
||||
return new ScriptedCommand(commandName,priorityLevel);
|
||||
}
|
||||
|
||||
public void addGlobalObject(String key, Object obj) {
|
||||
NpcAPI.engineObjects.put(key,obj);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user