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

@@ -221,23 +221,17 @@ public class NoppesUtilServer {
logic.func_145755_a(executer.worldObj);
}
public static String runCommand(final World world, final BlockPos pos, final String name, String command, EntityPlayer player, final ICommandSender executer) {
if (player != null) {
command = command.replace("@dp", player.getDisplayName());
}
public static void runCommand(World world, String name, String command) {
TileEntityCommandBlock tile = new TileEntityCommandBlock();
tile.setWorldObj(world);
tile.xCoord = MathHelper.floor_double(pos.getX());
tile.yCoord = MathHelper.floor_double(pos.getY());
tile.zCoord = MathHelper.floor_double(pos.getZ());
tile.setWorldObj(world.provider.worldObj);
tile.xCoord = 0;
tile.yCoord = 0;
tile.zCoord = 0;
CommandBlockLogic logic = tile.func_145993_a();
logic.func_145752_a(command);
logic.func_145754_b("@"+name);
logic.func_145755_a(world);
return logic.func_145749_h().getUnformattedText();
}
public static void consumeItemStack(int i, EntityPlayer player){