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

@ -232,11 +232,11 @@ public class EditSessionBuilder {
event.setExtent(extent);
eventBus.post(event);
if (event.isCancelled()) {
return new NullExtent(extent, FaweCache.INSTANCE.getMANUAL());
return new NullExtent(extent, FaweCache.INSTANCE.getManual());
}
final Extent toReturn = event.getExtent();
if(toReturn instanceof com.sk89q.worldedit.extent.NullExtent) {
return new NullExtent(toReturn, FaweCache.INSTANCE.getMANUAL());
return new NullExtent(toReturn, FaweCache.INSTANCE.getManual());
}
// if (!(toReturn instanceof AbstractDelegateExtent)) {
// Fawe.debug("Extent " + toReturn + " must be AbstractDelegateExtent");
@ -316,7 +316,7 @@ public class EditSessionBuilder {
if (Permission.hasPermission(player, "worldedit.fast")) {
player.print(TranslatableComponent.of("fawe.info.worldedit.oom.admin"));
}
throw FaweCache.INSTANCE.getLOW_MEMORY();
throw FaweCache.INSTANCE.getLowMemory();
}
}
// this.originalLimit = limit;
@ -420,7 +420,7 @@ public class EditSessionBuilder {
FaweRegionExtent regionExtent = null;
if (allowedRegions != null) {
if (allowedRegions.length == 0) {
regionExtent = new NullExtent(this.extent, FaweCache.INSTANCE.getNO_REGION());
regionExtent = new NullExtent(this.extent, FaweCache.INSTANCE.getNoRegion());
} else {
// this.extent = new ProcessedWEExtent(this.extent, this.limit);
if (allowedRegions.length == 1) {

View File

@ -1,5 +1,7 @@
package com.boydti.fawe.util;
import kotlin.UInt;
public class MathMan {
/**
@ -414,4 +416,10 @@ public class MathMan {
public static boolean isPowerOfTwo(int x) {
return (x & (x - 1)) == 0;
}
public static int floor(double value) {
int i = (int)value;
return value < (double)i ? i - 1 : i;
}
}