mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 06:25:11 +00:00
Fixed executeCommand() function for scripting API on the server-side.
This commit is contained in:
1 parent
8b710ed520
commit
5515f5ef83
6 files changed
+25
-20
No files matched your search
@@ -26,6 +26,7 @@ import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.scripted.*;
|
||||
import noppes.npcs.containers.ContainerNpcInterface;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
@@ -174,11 +175,9 @@ public class WrapperNpcAPI extends NpcAPI {
|
||||
return new ScriptDamageSource(damagesource);
|
||||
}
|
||||
|
||||
public String executeCommand(IWorld world, String command) {
|
||||
FakePlayer player = new FakePlayer(world.getMCWorld(), new GameProfile(new UUID(0L,0L), "CommandPlayer"));
|
||||
player.setWorld(world.getMCWorld());
|
||||
player.setPosition(0.0D, 0.0D, 0.0D);
|
||||
return NoppesUtilServer.runCommand(world.getMCWorld(), BlockPos.ORIGIN, "API", command, (EntityPlayer)null, player);
|
||||
public void executeCommand(IWorld world, String command) {
|
||||
//if(!world.getMCWorld().isRemote)
|
||||
NoppesUtilServer.runCommand(world.getMCWorld(), "API", command);
|
||||
}
|
||||
public String getRandomName(int dictionary, int gender) {
|
||||
return CustomNpcs.MARKOV_GENERATOR[dictionary].fetch(gender);
|
||||
|
||||
Reference in new issue
Block a user