mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:24:03 +00:00
Minor code quality changes
Changed Lock to subclass ReentrantLock since that is the only subclass DelegateLock should be using. The lock should also never be null so I added an annotation in the constructor. I also removed some code and replaced it with PaperLib code to just clean up things a little bit.
This commit is contained in:
@@ -12,6 +12,7 @@ import com.boydti.fawe.util.TaskManager;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockTypesCache;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import net.jpountz.util.UnsafeUtils;
|
||||
import net.minecraft.server.v1_15_R1.*;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.CraftChunk;
|
||||
@@ -96,7 +97,7 @@ public final class BukkitAdapter_1_15 extends NMSAdapter {
|
||||
try {
|
||||
synchronized (section) {
|
||||
DataPaletteBlock<IBlockData> blocks = section.getBlocks();
|
||||
Lock currentLock = (Lock) fieldLock.get(blocks);
|
||||
ReentrantLock currentLock = (ReentrantLock) fieldLock.get(blocks);
|
||||
if (currentLock instanceof DelegateLock) {
|
||||
return (DelegateLock) currentLock;
|
||||
}
|
||||
|
Reference in New Issue
Block a user