More code quality fixes

This commit is contained in:
MattBDev
2020-01-22 16:56:24 -05:00
parent 88359f0215
commit 2d6957ce1c
115 changed files with 686 additions and 1688 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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getOUTSIDE_REGION());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getOutsideRegion());
}
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.getLOW_MEMORY());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getLowMemory());
}
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,7 +2,6 @@ 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;
@ -38,7 +37,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
return null;
}
if (!limit.MAX_ENTITIES()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMAX_ENTITIES());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxEntities());
return null;
}
return super.createEntity(location, entity);
@ -47,7 +46,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.getMAX_CHECKS());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxChecks());
return BlockTypes.AIR.getDefaultState();
} else {
return extent.getBlock(x, y, z);
@ -57,7 +56,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
@Override
public BaseBlock getFullBlock(BlockVector3 pos) {
if (!limit.MAX_CHECKS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMAX_CHECKS());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxChecks());
return BlockTypes.AIR.getDefaultState().toBaseBlock();
} else {
return extent.getFullBlock(pos);
@ -79,18 +78,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.getMAX_TILES());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMaxTiles());
return false;
} else {
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMAX_CHANGES());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMaxChanges());
return false;
}
return extent.setBlock(x, y, z, block);
}
}
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMAX_CHANGES());
WEManager.IMP.cancelEdit(this, FaweCache.INSTANCE.getMaxChanges());
return false;
} else {
return extent.setBlock(x, y, z, block);
@ -100,7 +99,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMAX_CHANGES());
WEManager.IMP.cancelEditSafe(this, FaweCache.INSTANCE.getMaxChanges());
return false;
}
return super.setBiome(position, biome);