mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Remove leftovers from getting rid of PlotBlocks in LocalChunk
This commit is contained in:
parent
b366b0d261
commit
19f8704cb4
@ -21,14 +21,14 @@ import org.bukkit.block.data.BlockData;
|
|||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class BukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
|
public class BukkitLocalQueue extends BasicLocalBlockQueue {
|
||||||
|
|
||||||
public BukkitLocalQueue(String world) {
|
public BukkitLocalQueue(String world) {
|
||||||
super(world);
|
super(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public LocalChunk<T> getLocalChunk(int x, int z) {
|
@Override public LocalChunk getLocalChunk(int x, int z) {
|
||||||
return (LocalChunk<T>) new BasicLocalChunk(this, x, z) {
|
return new BasicLocalChunk(this, x, z) {
|
||||||
// Custom stuff?
|
// Custom stuff?
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class BukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public final void setComponents(LocalChunk<T> lc) {
|
@Override public final void setComponents(LocalChunk lc) {
|
||||||
setBaseBlocks(lc);
|
setBaseBlocks(lc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ public class BukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
|
|||||||
return getBukkitWorld().getChunkAt(x, z);
|
return getBukkitWorld().getChunkAt(x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBaseBlocks(LocalChunk<T> lc) {
|
public void setBaseBlocks(LocalChunk lc) {
|
||||||
World worldObj = Bukkit.getWorld(getWorld());
|
World worldObj = Bukkit.getWorld(getWorld());
|
||||||
Chunk chunk = worldObj.getChunkAt(lc.getX(), lc.getZ());
|
Chunk chunk = worldObj.getChunkAt(lc.getX(), lc.getZ());
|
||||||
chunk.load(true);
|
chunk.load(true);
|
||||||
@ -152,7 +152,7 @@ public class BukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
|
|||||||
legacyPlotBlock.id == 0 || legacyPlotBlock.data == block.getData());
|
legacyPlotBlock.id == 0 || legacyPlotBlock.data == block.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBiomes(LocalChunk<T> lc) {
|
public void setBiomes(LocalChunk lc) {
|
||||||
if (lc.biomes != null) {
|
if (lc.biomes != null) {
|
||||||
World worldObj = Bukkit.getWorld(getWorld());
|
World worldObj = Bukkit.getWorld(getWorld());
|
||||||
int bx = lc.getX() << 4;
|
int bx = lc.getX() << 4;
|
||||||
|
@ -15,7 +15,7 @@ import lombok.Getter;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||||
|
|
||||||
public abstract class BasicLocalBlockQueue<T> extends LocalBlockQueue {
|
public abstract class BasicLocalBlockQueue extends LocalBlockQueue {
|
||||||
|
|
||||||
private final String world;
|
private final String world;
|
||||||
private final ConcurrentHashMap<Long, LocalChunk> blockChunks = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<Long, LocalChunk> blockChunks = new ConcurrentHashMap<>();
|
||||||
@ -35,7 +35,7 @@ public abstract class BasicLocalBlockQueue<T> extends LocalBlockQueue {
|
|||||||
|
|
||||||
@Override public abstract PlotBlock getBlock(int x, int y, int z);
|
@Override public abstract PlotBlock getBlock(int x, int y, int z);
|
||||||
|
|
||||||
public abstract void setComponents(LocalChunk<T> lc);
|
public abstract void setComponents(LocalChunk lc);
|
||||||
|
|
||||||
@Override public final String getWorld() {
|
@Override public final String getWorld() {
|
||||||
return world;
|
return world;
|
||||||
@ -62,7 +62,7 @@ public abstract class BasicLocalBlockQueue<T> extends LocalBlockQueue {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean execute(final LocalChunk<T> lc) {
|
public final boolean execute(final LocalChunk lc) {
|
||||||
if (lc == null) {
|
if (lc == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ public abstract class BasicLocalBlockQueue<T> extends LocalBlockQueue {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setChunk(LocalChunk<T> chunk) {
|
public final void setChunk(LocalChunk chunk) {
|
||||||
LocalChunk previous = this.blockChunks.put(chunk.longHash(), chunk);
|
LocalChunk previous = this.blockChunks.put(chunk.longHash(), chunk);
|
||||||
if (previous != null) {
|
if (previous != null) {
|
||||||
chunks.remove(previous);
|
chunks.remove(previous);
|
||||||
@ -169,7 +169,7 @@ public abstract class BasicLocalBlockQueue<T> extends LocalBlockQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public abstract class LocalChunk<B> {
|
public abstract class LocalChunk {
|
||||||
public final BasicLocalBlockQueue parent;
|
public final BasicLocalBlockQueue parent;
|
||||||
public final int z;
|
public final int z;
|
||||||
public final int x;
|
public final int x;
|
||||||
@ -177,7 +177,7 @@ public abstract class BasicLocalBlockQueue<T> extends LocalBlockQueue {
|
|||||||
public BaseBlock[][] baseblocks;
|
public BaseBlock[][] baseblocks;
|
||||||
public String[][] biomes;
|
public String[][] biomes;
|
||||||
|
|
||||||
public LocalChunk(BasicLocalBlockQueue<B> parent, int x, int z) {
|
public LocalChunk(BasicLocalBlockQueue parent, int x, int z) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
@ -223,7 +223,7 @@ public abstract class BasicLocalBlockQueue<T> extends LocalBlockQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class BasicLocalChunk extends LocalChunk<PlotBlock[]> {
|
public class BasicLocalChunk extends LocalChunk {
|
||||||
public BasicLocalChunk(BasicLocalBlockQueue parent, int x, int z) {
|
public BasicLocalChunk(BasicLocalBlockQueue parent, int x, int z) {
|
||||||
super(parent, x, z);
|
super(parent, x, z);
|
||||||
baseblocks = new BaseBlock[16][];
|
baseblocks = new BaseBlock[16][];
|
||||||
|
Loading…
Reference in New Issue
Block a user