Fixed executeCommand() function for scripting API on the server-side.

This commit is contained in:
luisc committed 2021-10-19 19:49:43 -05:00
1 parent 8b710ed520
commit 5515f5ef83
6 files changed
+25 -20

No files matched your search

@@ -28,6 +28,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayer;
import noppes.npcs.CommonProxy;
import noppes.npcs.CustomNpcs;
import noppes.npcs.LogWriter;
@@ -146,6 +147,7 @@ import noppes.npcs.containers.ContainerNpcQuestTypeItem;
import noppes.npcs.controllers.PlayerData;
import noppes.npcs.entity.*;
import noppes.npcs.scripted.interfaces.IWorld;
import org.lwjgl.input.Keyboard;
import tconstruct.client.tabs.InventoryTabFactions;
@@ -239,6 +241,10 @@ public class ClientProxy extends CommonProxy {
}
}
public FakePlayer getCommandPlayer(IWorld world) {
return (FakePlayer)(new EntityCustomNpc(world.getMCWorld())).getFakePlayer();
}
private void createFolders() {
File file = new File(CustomNpcs.Dir,"assets/customnpcs");
if(!file.exists())