Skip to content

Instantly share code, notes, and snippets.

View cerus's full-sized avatar
🐈‍⬛
I create bugs for a living

Maximilian Dorn cerus

🐈‍⬛
I create bugs for a living
View GitHub Profile
// The NmsMethods interface was written by me, it's not an interface from Bukkit or Minecraft
// All of the overridden methods were copied from the CraftBlock class and modified to use the chunk cache
public class NmsMethodsImpl implements NmsMethods {
private final ChunkCacheImpl chunkCache;
public NmsMethodsImpl(final ChunkCacheImpl chunkCache) {
this.chunkCache = chunkCache;
}
// The RayTracer interface was written by me, it's not an interface from Bukkit or Minecraft
public class RayTracerImpl implements RayTracer {
private final CachedBlockAccess cachedBlockAccess;
public RayTracerImpl(final ChunkCacheImpl chunkCache) {
this.cachedBlockAccess = new CachedBlockAccess(chunkCache);
}
@Override
public class CachedBlockAccess implements IBlockAccess {
// ChunkCacheImpl is my chunk cache (who would've thought)
private final ChunkCacheImpl chunkCache;
public CachedBlockAccess(final ChunkCacheImpl chunkCache) {
this.chunkCache = chunkCache;
}
@Override
package de.cerus.afkcheck;
import org.jnativehook.GlobalScreen;
import org.jnativehook.NativeHookException;
import org.jnativehook.keyboard.NativeKeyEvent;
import org.jnativehook.keyboard.NativeKeyListener;
import org.jnativehook.mouse.NativeMouseEvent;
import org.jnativehook.mouse.NativeMouseListener;
import javax.swing.*;