Fishnets and Baubles

This commit is contained in:
Paul Reilly
2023-03-17 22:11:00 -05:00
parent 8f84583e4e
commit 31b0a8a3fe
50 changed files with 1489 additions and 550 deletions

View File

@ -0,0 +1,30 @@
package mc.unraveled.reforged.util;
import org.bukkit.entity.Player;
public class Lock {
private volatile boolean locked = false;
private final Player player;
public Lock(Player player) {
this.player = player;
}
public void lock() {
locked = true;
while (locked) {
Thread.onSpinWait();
player.openInventory(player.getInventory());
player.closeInventory();
}
}
public void unlock() {
locked = false;
}
public boolean isLocked() {
return locked;
}
}