Skip to content

Instantly share code, notes, and snippets.

public static Closeable smoothInterrupt(Plugin plugin, BiConsumer<Player, Block> interruptions) {
final Map<Player, BukkitTask> tasks = new HashMap<>();
PacketAdapter adapter = new PacketAdapter(plugin, BLOCK_DIG) {
@Override
public void onPacketReceiving(PacketEvent event) {
Player player = event.getPlayer();
Block block = event.getPacket()
.getBlockPositionModifier().read(0)
.toLocation(player.getWorld()).getBlock();
public static Closeable smoothInterrupt(Plugin plugin, Predicate<Block> blocks, Consumer<Block> interruptions) {
return smoothInterrupt(plugin, blocks, (player, block) -> interruptions.accept(block));
}
public static Closeable smoothInterrupt(Plugin plugin, Predicate<Block> blocks, BiConsumer<Player, Block> interruptions) {
return smoothInterrupt(plugin, (player, block) -> blocks.test(block), interruptions);
}
public static Closeable smoothInterrupt(Plugin plugin, BiPredicate<Player, Block> blocks, Consumer<Block> interruptions) {
return smoothInterrupt(plugin, blocks, (player, block) -> interruptions.accept(block));
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) {
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) {
package com.penzzly.engine.core.mini;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
group = "com.mynt.test"
version = "1.0-SNAPSHOT"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(kotlinModule("gradle-plugin", "1.2.21"))
group = "com.mynt.test"
version = "1.0-SNAPSHOT"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(kotlinModule("gradle-plugin", "1.2.21"))
package com.penzzly.engine.architecture.base;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static java.util.Arrays.asList;
interface Buffer {
fun clear(): Buffer
fun flip(): Buffer
fun index(): Long
//Read a number of bits(or 8) from a value as a Number at the current index.
fun <Type : Number> next(bits: Number = 8): Type
name: ${project.name}
version: ${project.version}
#Might need to change this depending on your package structure, but it's standard not to.
main: ${project.groupId}.${project.artifactId}