Directly using VirtualBox from Java #5
3 changed files with 24 additions and 22 deletions
BIN
VirtualComputer/repo/org/virtualbox/VirtualBox/5.2/VirtualBox-5.2.jar
Executable file → Normal file
BIN
VirtualComputer/repo/org/virtualbox/VirtualBox/5.2/VirtualBox-5.2.jar
Executable file → Normal file
Binary file not shown.
|
@ -97,8 +97,10 @@ public class MCFrameBuffer implements IFramebuffer {
|
|||
* return; // Don't even try to render too large resolutions }
|
||||
*/
|
||||
tt = Bukkit.getScheduler().runTaskLaterAsynchronously(PluginMain.Instance, () -> {
|
||||
try {
|
||||
display.querySourceBitmap(0L, holder);
|
||||
byte[] arr = PluginMain.allpixels.array();
|
||||
//byte[] arr = PluginMain.allpixels.array();
|
||||
long[] arr = new long[1];
|
||||
long[] w = new long[1], h = new long[1], bpp = new long[1], bpl = new long[1], pf = new long[1];
|
||||
holder.value.getTypedWrapped().queryBitmapInfo(arr, w, h, bpp, bpl, pf);
|
||||
System.out.println("Arr0:" + arr[0]);
|
||||
|
@ -113,6 +115,9 @@ public class MCFrameBuffer implements IFramebuffer {
|
|||
else if (r instanceof DirectRenderer)
|
||||
((DirectRenderer) r).render(PluginMain.allpixels, xOrigin, yOrigin, width, height);
|
||||
System.out.println("Change!");
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}, 5); // Wait 1/4th of a second
|
||||
}
|
||||
|
||||
|
@ -126,7 +131,6 @@ public class MCFrameBuffer implements IFramebuffer {
|
|||
((DirectRenderer) r).render(PluginMain.allpixels, x, y, width, height);
|
||||
System.out.println("Update!");
|
||||
}, 5);*/
|
||||
throw new UnsupportedOperationException("Use UpdateImage");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,11 +139,11 @@ public class MCFrameBuffer implements IFramebuffer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void processVHWACommand(byte arg0) {
|
||||
public void setVisibleRegion(byte arg0, long arg1) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisibleRegion(byte arg0, long arg1) {
|
||||
public void processVHWACommand(byte b, int i, boolean b1) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package sznp.virtualcomputer;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sun.jna.Memory;
|
||||
import com.sun.jna.Pointer;
|
||||
import jnr.ffi.LibraryLoader;
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -10,7 +9,6 @@ import org.bukkit.command.ConsoleCommandSender;
|
|||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.virtualbox_5_2.*;
|
||||
import sun.misc.Unsafe;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
|
|
Loading…
Reference in a new issue