mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-19 22:04:43 +02:00
Compare commits
1 Commits
feature/v6
...
fix/expire
Author | SHA1 | Date | |
---|---|---|---|
ebbbb6c670 |
@ -289,7 +289,7 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
|||||||
* Get the {@link ExpireManager} implementation for the platform
|
* Get the {@link ExpireManager} implementation for the platform
|
||||||
*
|
*
|
||||||
* @return Expire manager
|
* @return Expire manager
|
||||||
* @since 6.10.2
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
default @NonNull ExpireManager expireManager() {
|
default @NonNull ExpireManager expireManager() {
|
||||||
return injector().getInstance(ExpireManager.class);
|
return injector().getInstance(ExpireManager.class);
|
||||||
|
@ -298,10 +298,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
int roadSchemHeight;
|
int roadSchemHeight;
|
||||||
|
|
||||||
if (schematic1 != null) {
|
if (schematic1 != null) {
|
||||||
roadSchemHeight = Math.max(
|
roadSchemHeight = schematic1.getClipboard().getDimensions().getY();
|
||||||
schematic1.getClipboard().getDimensions().getY(),
|
|
||||||
schematic2.getClipboard().getDimensions().getY()
|
|
||||||
);
|
|
||||||
maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
|
maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
|
||||||
if (maxSchematicHeight == worldGenHeight) {
|
if (maxSchematicHeight == worldGenHeight) {
|
||||||
SCHEM_Y = getMinGenHeight();
|
SCHEM_Y = getMinGenHeight();
|
||||||
@ -489,7 +486,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
/**
|
/**
|
||||||
* @deprecated This method should not be available for public API usage and will be made private.
|
* @deprecated This method should not be available for public API usage and will be made private.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) {
|
public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) {
|
||||||
if (z < 0) {
|
if (z < 0) {
|
||||||
z += this.SIZE;
|
z += this.SIZE;
|
||||||
@ -524,7 +521,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
/**
|
/**
|
||||||
* @deprecated This method should not be available for public API usage and will be made private.
|
* @deprecated This method should not be available for public API usage and will be made private.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public void addOverlayBiome(short x, short z, BiomeType id) {
|
public void addOverlayBiome(short x, short z, BiomeType id) {
|
||||||
if (z < 0) {
|
if (z < 0) {
|
||||||
z += this.SIZE;
|
z += this.SIZE;
|
||||||
|
@ -234,52 +234,44 @@ public class HybridUtils {
|
|||||||
Set<BlockType> types = new HashSet<>();
|
Set<BlockType> types = new HashSet<>();
|
||||||
for (int yIndex = 0; yIndex < height; yIndex++) {
|
for (int yIndex = 0; yIndex < height; yIndex++) {
|
||||||
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
||||||
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
try {
|
||||||
if (now == null) {
|
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
||||||
throw new NullPointerException(String.format(
|
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
||||||
"\"now\" block null attempting to perform plot analysis. Indexes: x=%d of %d, yIndex=%d" +
|
changes[i]++;
|
||||||
" of %d, z=%d of %d",
|
|
||||||
x,
|
|
||||||
width,
|
|
||||||
yIndex,
|
|
||||||
height,
|
|
||||||
z,
|
|
||||||
length
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
|
||||||
changes[i]++;
|
|
||||||
}
|
|
||||||
if (now.getBlockType().getMaterial().isAir()) {
|
|
||||||
air[i]++;
|
|
||||||
} else {
|
|
||||||
// check vertices
|
|
||||||
// modifications_adjacent
|
|
||||||
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
|
||||||
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (now.getBlockType().getMaterial().isAir()) {
|
||||||
|
air[i]++;
|
||||||
|
} else {
|
||||||
|
// check vertices
|
||||||
|
// modifications_adjacent
|
||||||
|
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
||||||
|
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!now.equals(now.getBlockType().getDefaultState())) {
|
if (!now.equals(now.getBlockType().getDefaultState())) {
|
||||||
data[i]++;
|
data[i]++;
|
||||||
|
}
|
||||||
|
types.add(now.getBlockType());
|
||||||
}
|
}
|
||||||
types.add(now.getBlockType());
|
} catch (NullPointerException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variety[i] = types.size();
|
variety[i] = types.size();
|
||||||
|
@ -112,7 +112,7 @@ public final class PlotId {
|
|||||||
* @return Plot ID copy
|
* @return Plot ID copy
|
||||||
* @deprecated PlotId is immutable, copy is not required.
|
* @deprecated PlotId is immutable, copy is not required.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public @NonNull PlotId copy() {
|
public @NonNull PlotId copy() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public class ExpireManager {
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use {@link PlotPlatform#expireManager()} instead
|
* @deprecated Use {@link PlotPlatform#expireManager()} instead
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public static ExpireManager IMP;
|
public static ExpireManager IMP;
|
||||||
private final ConcurrentHashMap<UUID, Long> dates_cache;
|
private final ConcurrentHashMap<UUID, Long> dates_cache;
|
||||||
private final ConcurrentHashMap<UUID, Long> account_age_cache;
|
private final ConcurrentHashMap<UUID, Long> account_age_cache;
|
||||||
|
@ -19,7 +19,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.plotsquared"
|
group = "com.plotsquared"
|
||||||
version = "6.10.4-SNAPSHOT"
|
version = "6.10.2-SNAPSHOT"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
group = rootProject.group
|
group = rootProject.group
|
||||||
@ -65,7 +65,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.18"))
|
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.16"))
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
Reference in New Issue
Block a user