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
try { | |
debugServer = new DebugServer(25566, 512); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
//--Toggle Plugins-- | |
debugServer.respond(OP_TOGGLE, request -> { | |
byte count = request.get(); | |
byte[] errors = new byte[count]; |
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
public static class Particle { | |
private final String id; | |
private int count = 0; | |
private float data, x, y, z = 0; | |
public Particle(String id) { | |
this.id = id; | |
} | |
public static Particle create(String id) { |
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
import java.nio.ByteBuffer | |
import java.nio.channels.DatagramChannel | |
import java.util.concurrent.ExecutorService | |
import java.util.function.BiConsumer | |
import java.util.function.BiFunction | |
import java.util.function.Consumer | |
import java.util.function.Function | |
import static java.lang.String.* | |
import static java.nio.ByteBuffer.allocateDirect |
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
import java.nio.ByteBuffer | |
import java.nio.channels.DatagramChannel | |
import java.util.concurrent.ExecutorService | |
import java.util.function.BiConsumer | |
import java.util.function.BiFunction | |
import java.util.function.Consumer | |
import java.util.function.Function | |
import static java.lang.Integer.parseInt | |
import static java.lang.String.format |
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
package me.exerosis.debug; | |
import java.io.Closeable; | |
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.net.SocketAddress; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.DatagramChannel; | |
import java.util.HashMap; | |
import java.util.Map; |
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
public class DebugServer implements Closeable { | |
private final Map<Number, BiConsumer<ByteBuffer, SocketAddress>> handlers = new HashMap<>(); | |
private final ExecutorService executor = newSingleThreadExecutor(); | |
private final DatagramChannel channel; | |
private final ByteBuffer in; | |
private final ByteBuffer out; | |
public DebugServer(Number port, Number length) throws IOException { | |
this(port, length, ByteBuffer::get); | |
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
package me.exerosis.example; | |
import org.bukkit.ChatColor; | |
import org.bukkit.Location; | |
import org.bukkit.World; | |
import org.bukkit.attribute.Attribute; | |
import org.bukkit.attribute.AttributeInstance; | |
import org.bukkit.attribute.AttributeModifier; | |
import org.bukkit.boss.BossBar; | |
import org.bukkit.entity.LivingEntity; |
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
package me.exerosis.example.alpha; | |
import org.bukkit.entity.LivingEntity; | |
public class BaseBoss implements Boss { | |
private final LivingEntity base; | |
private Stage stage; | |
public BaseBoss(LivingEntity base) { | |
this.base = base; |
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
public class SmoothBlockInterrupt { | |
private final Map<Player, BukkitTask> tasks = new HashMap<>(); | |
public SmoothBlockInterrupt(Plugin plugin, BiConsumer<Block, Player> interruptions) { | |
getProtocolManager().addPacketListener(new PacketAdapter(plugin, BLOCK_DIG) { | |
@Override | |
public void onPacketReceiving(PacketEvent event) { | |
Player player = event.getPlayer(); | |
Block block = event.getPacket() | |
.getBlockPositionModifier().read(0) |
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
public class SmoothBlockInterrupt { | |
private final Map<Player, BukkitTask> tasks = new HashMap<>(); | |
public SmoothBlockInterrupt(Plugin plugin, BiConsumer<Block, Player> interruptions) { | |
getProtocolManager().addPacketListener(new PacketAdapter(plugin, BLOCK_DIG) { | |
@Override | |
public void onPacketReceiving(PacketEvent event) { | |
Player player = event.getPlayer(); | |
Block block = event.getPacket() | |
.getBlockPositionModifier().read(0) |