-
-
Save cerus/2e54686297980a2d7fda4f29bc29c843 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.getServer().getScheduler().runTaskAsynchronously(this, () -> { | |
// The raytracing stuff is done here | |
final byte[][] bytes = new RayTracer().captureFrame(player.getEyeLocation(), 128, 128, false); | |
// Everything below is just map stuff | |
final DrawAdapterImpl drawAdapter = new DrawAdapterImpl(); | |
for (int x = 0; x < bytes.length; x++) { | |
for (int y = 0; y < bytes[x].length; y++) { | |
drawAdapter.setPixel(x, y, bytes[x][y]); | |
} | |
} | |
// FakeMap is basically a client-side map | |
final FakeMap fakeMap = new FakeMap(nmsAdapter, drawAdapter); | |
fakeMap.setId(((MapMeta) player.getInventory().getItemInMainHand().getItemMeta()).getMapId()); | |
fakeMap.addObserver(player); | |
fakeMap.setLocked(true); | |
fakeMap.setTrackPos(false); | |
fakeMap.send(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment