mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-26 18:54:43 +02:00
Refactor BlockVector2
This commit is contained in:
@ -25,19 +25,15 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.chat.PlainChatManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
public final class NukkitMain extends PluginBase implements Listener, IPlotMain {
|
||||
|
||||
|
@ -9,7 +9,6 @@ import com.github.intellectualsites.plotsquared.nukkit.util.block.NukkitWrappedC
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.ChunkManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue;
|
||||
|
@ -28,11 +28,8 @@ import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.listener.PlotListener;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -10,7 +10,6 @@ import com.github.intellectualsites.plotsquared.nukkit.util.NukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
@ -6,12 +6,10 @@ import cn.nukkit.utils.LogLevel;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.Proxy;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
public class Metrics {
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.nukkit.util;
|
||||
|
||||
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.BlockVector2;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.ChunkManager;
|
||||
@ -16,11 +15,11 @@ public class NukkitChunkManager extends ChunkManager {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override public boolean loadChunk(String world, ChunkLoc loc, boolean force) {
|
||||
@Override public boolean loadChunk(String world, BlockVector2 loc, boolean force) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public void unloadChunk(String world, ChunkLoc loc, boolean save, boolean safe) {
|
||||
@Override public void unloadChunk(String world, BlockVector2 loc, boolean save, boolean safe) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ import com.github.intellectualsites.plotsquared.nukkit.NukkitMain;
|
||||
import com.github.intellectualsites.plotsquared.nukkit.events.*;
|
||||
import com.github.intellectualsites.plotsquared.nukkit.object.NukkitPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flag;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.EventUtil;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -6,7 +6,7 @@ import cn.nukkit.level.format.generic.BaseFullChunk;
|
||||
import cn.nukkit.math.Vector3;
|
||||
import com.github.intellectualsites.plotsquared.jnbt.*;
|
||||
import com.github.intellectualsites.plotsquared.nukkit.NukkitMain;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.BlockVector2;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.RunnableVal;
|
||||
@ -16,7 +16,6 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Schematic Handler.
|
||||
@ -98,10 +97,10 @@ public class NukkitSchematicHandler extends SchematicHandler {
|
||||
final int sy = pos1.getY();
|
||||
final int ey = pos2.getY();
|
||||
// Generate list of chunks
|
||||
final ArrayList<ChunkLoc> chunks = new ArrayList<>();
|
||||
final ArrayList<BlockVector2> chunks = new ArrayList<>();
|
||||
for (int x = bcx; x <= tcx; x++) {
|
||||
for (int z = bcz; z <= tcz; z++) {
|
||||
chunks.add(new ChunkLoc(x, z));
|
||||
chunks.add(BlockVector2.at(x, z));
|
||||
}
|
||||
}
|
||||
final Level worldObj = plugin.getServer().getLevelByName(world);
|
||||
@ -113,7 +112,7 @@ public class NukkitSchematicHandler extends SchematicHandler {
|
||||
while (!chunks.isEmpty()
|
||||
&& System.currentTimeMillis() - start < 20) {
|
||||
// save schematics
|
||||
ChunkLoc chunk = chunks.remove(0);
|
||||
BlockVector2 chunk = chunks.remove(0);
|
||||
BaseFullChunk bc = worldObj.getChunk(chunk.x, chunk.z);
|
||||
try {
|
||||
bc.load(false);
|
||||
|
@ -20,7 +20,6 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotBlock;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.nukkit.util.block;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
|
||||
import cn.nukkit.level.Level;
|
||||
import com.github.intellectualsites.plotsquared.nukkit.NukkitMain;
|
||||
import com.github.intellectualsites.plotsquared.nukkit.generator.NukkitPlotGenerator;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.nukkit.util.block;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
|
||||
import cn.nukkit.block.Block;
|
||||
import cn.nukkit.level.Level;
|
||||
import cn.nukkit.level.biome.EnumBiome;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.nukkit.util.block;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
|
||||
import cn.nukkit.level.biome.Biome;
|
||||
import cn.nukkit.level.biome.EnumBiome;
|
||||
import cn.nukkit.level.format.generic.BaseFullChunk;
|
||||
|
Reference in New Issue
Block a user