Revert "More code quality fixes"

This reverts commit 2d6957ce
This commit is contained in:
MattBDev
2020-01-23 14:41:57 -05:00
parent 37003ec089
commit e0f6869573
115 changed files with 1688 additions and 686 deletions

View File

@ -71,7 +71,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public <B extends BlockStateHolder<B>> boolean setBlock(int x, int y, int z, B block) throws WorldEditException {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return false;
}
@ -82,7 +82,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public boolean setBiome(int x, int y, int z, BiomeType biome) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return false;
}
@ -93,7 +93,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public BiomeType getBiome(BlockVector2 position) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return null;
}
@ -104,7 +104,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public BiomeType getBiomeType(int x, int y, int z) {
if (!contains(x, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return null;
}
@ -115,7 +115,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public BaseBlock getFullBlock(BlockVector3 position) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return BlockTypes.AIR.getDefaultState().toBaseBlock();
}
@ -126,7 +126,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public BlockState getBlock(BlockVector3 position) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return BlockTypes.AIR.getDefaultState();
}
@ -137,7 +137,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public int getBlockLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return 0;
}
@ -148,7 +148,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public int getBrightness(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return 0;
}
@ -159,7 +159,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public int getLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return 0;
}
@ -170,7 +170,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public int getOpacity(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return 0;
}
@ -181,7 +181,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public int getSkyLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return 0;
}
@ -193,7 +193,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
public Entity createEntity(Location location, BaseEntity entity) {
if (!contains(location.getBlockX(), location.getBlockY(), location.getBlockZ())) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOUTSIDE_REGION());
}
return null;
}

View File

@ -26,7 +26,7 @@ public class MemoryCheckingExtent extends PassthroughExtent {
this.player.print(TranslatableComponent.of("fawe.info.worldedit.oom.admin"));
}
}
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getLowMemory());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getLOW_MEMORY());
}
return super.getExtent();
}

View File

@ -54,7 +54,7 @@ public class NullExtent extends FaweRegionExtent implements IBatchProcessor {
}
public NullExtent() {
this(new com.sk89q.worldedit.extent.NullExtent(), FaweCache.INSTANCE.getManual());
this(new com.sk89q.worldedit.extent.NullExtent(), FaweCache.INSTANCE.getMANUAL());
}
@Override

View File

@ -2,6 +2,7 @@ package com.boydti.fawe.object.extent;
import com.boydti.fawe.FaweCache;
import com.boydti.fawe.object.FaweLimit;
import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.util.WEManager;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.BaseEntity;
@ -37,7 +38,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
return null;
}
if (!limit.MAX_ENTITIES()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxEntities());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMAX_ENTITIES());
return null;
}
return super.createEntity(location, entity);
@ -46,7 +47,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
@Override
public BlockState getBlock(int x, int y, int z) {
if (!limit.MAX_CHECKS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxChecks());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMAX_CHECKS());
return BlockTypes.AIR.getDefaultState();
} else {
return extent.getBlock(x, y, z);
@ -56,7 +57,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
@Override
public BaseBlock getFullBlock(BlockVector3 pos) {
if (!limit.MAX_CHECKS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxChecks());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMAX_CHECKS());
return BlockTypes.AIR.getDefaultState().toBaseBlock();
} else {
return extent.getFullBlock(pos);
@ -78,18 +79,18 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
boolean hasNbt = block instanceof BaseBlock && block.hasNbtData();
if (hasNbt) {
if (!limit.MAX_BLOCKSTATES()) {
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMaxTiles());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMAX_TILES());
return false;
} else {
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMaxChanges());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMAX_CHANGES());
return false;
}
return extent.setBlock(x, y, z, block);
}
}
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMaxChanges());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMAX_CHANGES());
return false;
} else {
return extent.setBlock(x, y, z, block);
@ -99,7 +100,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxChanges());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMAX_CHANGES());
return false;
}
return super.setBiome(position, biome);