mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-29 20:24:43 +02:00
cleanup
This commit is contained in:
@ -12,35 +12,45 @@ import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||
import com.plotsquared.sponge.util.SpongeUtil;
|
||||
|
||||
public class SpongeHybridUtils extends HybridUtils {
|
||||
|
||||
public class SpongeHybridUtils extends HybridUtils
|
||||
{
|
||||
|
||||
@Override
|
||||
public void analyzePlot(Plot plot, RunnableVal<PlotAnalysis> whenDone) {
|
||||
public void analyzePlot(final Plot plot, final RunnableVal<PlotAnalysis> whenDone)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
PS.debug("analyzePlot is not implemented");
|
||||
if (whenDone != null) {
|
||||
if (whenDone != null)
|
||||
{
|
||||
whenDone.run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int checkModified(String worldname, int x1, int x2, int y1, int y2, int z1, int z2, PlotBlock[] blocks) {
|
||||
public int checkModified(final String worldname, final int x1, final int x2, final int y1, final int y2, final int z1, final int z2, final PlotBlock[] blocks)
|
||||
{
|
||||
PS.debug("checkModified is not implemented");
|
||||
final World world = SpongeUtil.getWorld(worldname);
|
||||
int count = 0;
|
||||
for (int y = y1; y <= y2; y++) {
|
||||
for (int x = x1; x <= x2; x++) {
|
||||
for (int z = z1; z <= z2; z++) {
|
||||
BlockState state = world.getBlock(x, y, z);
|
||||
PlotBlock block = SpongeMain.THIS.getPlotBlock(state);
|
||||
for (int y = y1; y <= y2; y++)
|
||||
{
|
||||
for (int x = x1; x <= x2; x++)
|
||||
{
|
||||
for (int z = z1; z <= z2; z++)
|
||||
{
|
||||
final BlockState state = world.getBlock(x, y, z);
|
||||
final PlotBlock block = SpongeMain.THIS.getPlotBlock(state);
|
||||
boolean same = false;
|
||||
for (final PlotBlock p : blocks) {
|
||||
if (block.id == p.id) {
|
||||
for (final PlotBlock p : blocks)
|
||||
{
|
||||
if (block.id == p.id)
|
||||
{
|
||||
same = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!same) {
|
||||
if (!same)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -48,17 +58,23 @@ public class SpongeHybridUtils extends HybridUtils {
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int get_ey(String worldname, int sx, int ex, int sz, int ez, int sy) {
|
||||
public int get_ey(final String worldname, final int sx, final int ex, final int sz, final int ez, final int sy)
|
||||
{
|
||||
final World world = SpongeUtil.getWorld(worldname);
|
||||
int ey = sy;
|
||||
for (int x = sx; x <= ex; x++) {
|
||||
for (int z = sz; z <= ez; z++) {
|
||||
for (int y = sy; y < 256; y++) {
|
||||
if (y > ey) {
|
||||
BlockState state = world.getBlock(x, y, z);
|
||||
if (state != null && state.getType() != BlockTypes.AIR) {
|
||||
for (int x = sx; x <= ex; x++)
|
||||
{
|
||||
for (int z = sz; z <= ez; z++)
|
||||
{
|
||||
for (int y = sy; y < 256; y++)
|
||||
{
|
||||
if (y > ey)
|
||||
{
|
||||
final BlockState state = world.getBlock(x, y, z);
|
||||
if ((state != null) && (state.getType() != BlockTypes.AIR))
|
||||
{
|
||||
ey = y;
|
||||
}
|
||||
}
|
||||
@ -67,5 +83,5 @@ public class SpongeHybridUtils extends HybridUtils {
|
||||
}
|
||||
return ey;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user