More Kotlin

This commit is contained in:
MattBDev
2020-01-21 14:30:13 -05:00
parent 0cad7f229b
commit 88359f0215
82 changed files with 867 additions and 1343 deletions

View File

@ -457,7 +457,7 @@ public interface Extent extends InputExtent, OutputExtent {
default boolean cancel() {
ExtentTraverser<Extent> traverser = new ExtentTraverser<>(this);
NullExtent nullExtent = new NullExtent(this, FaweCache.MANUAL);
NullExtent nullExtent = new NullExtent(this, FaweCache.INSTANCE.getMANUAL());
ExtentTraverser<Extent> next = traverser.next();
if (next != null) {
@ -523,7 +523,7 @@ public interface Extent extends InputExtent, OutputExtent {
default <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) throws MaxChangedBlocksException {
checkNotNull(region);
checkNotNull(block);
boolean hasNbt = block instanceof BaseBlock && ((BaseBlock)block).hasNbtData();
boolean hasNbt = block instanceof BaseBlock && block.hasNbtData();
int changes = 0;
for (BlockVector3 pos : region) {

View File

@ -51,7 +51,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class MaskingExtent extends AbstractDelegateExtent implements IBatchProcessor, Filter {
private Mask mask;
private LoadingCache<Long, ChunkFilterBlock> threadIdToFilter = FaweCache.IMP.createCache(() -> new CharFilterBlock(getExtent()));
private LoadingCache<Long, ChunkFilterBlock> threadIdToFilter = FaweCache.INSTANCE.createCache(() -> new CharFilterBlock(getExtent()));
/**
* Create a new instance.

View File

@ -268,7 +268,7 @@ public class FastSchematicReader extends NBTSchematicReader {
// tiles
if (tiles != null && !tiles.isEmpty()) {
for (Map<String, Object> tileRaw : tiles) {
CompoundTag tile = FaweCache.IMP.asTag(tileRaw);
CompoundTag tile = FaweCache.INSTANCE.asTag(tileRaw);
int[] pos = tile.getIntArray("Pos");
int x,y,z;
@ -303,7 +303,7 @@ public class FastSchematicReader extends NBTSchematicReader {
// entities
if (entities != null && !entities.isEmpty()) {
for (Map<String, Object> entRaw : entities) {
CompoundTag ent = FaweCache.IMP.asTag(entRaw);
CompoundTag ent = FaweCache.INSTANCE.asTag(entRaw);
Map<String, Tag> value = ent.getValue();
StringTag id = (StringTag) value.get("Id");
@ -340,4 +340,4 @@ public class FastSchematicReader extends NBTSchematicReader {
public void close() throws IOException {
inputStream.close();
}
}
}

View File

@ -322,7 +322,7 @@ public class SchematicReader implements ClipboardReader {
if (tiles != null && !tiles.isEmpty()) {
outer:
for (Map<String, Object> tileRaw : tiles) {
CompoundTag tile = FaweCache.IMP.asTag(tileRaw);
CompoundTag tile = FaweCache.INSTANCE.asTag(tileRaw);
int x = (int) tileRaw.get("x");
int y = (int) tileRaw.get("y");
int z = (int) tileRaw.get("z");
@ -350,7 +350,7 @@ public class SchematicReader implements ClipboardReader {
entRaw.put("Id", id);
EntityType type = EntityTypes.parse(id);
if (type != null) {
CompoundTag ent = FaweCache.IMP.asTag(entRaw);
CompoundTag ent = FaweCache.INSTANCE.asTag(entRaw);
for (EntityNBTCompatibilityHandler compat : ENTITY_COMPATIBILITY_HANDLERS) {
if (compat.isAffectedEntity(type, ent)) {
ent = compat.updateNBT(type, ent);

View File

@ -107,10 +107,10 @@ public class BlockBagExtent extends AbstractDelegateExtent {
try {
blockBag.fetchPlacedBlock(block.toImmutableState());
} catch (UnplaceableBlockException e) {
throw FaweCache.BLOCK_BAG;
throw FaweCache.INSTANCE.getBLOCK_BAG();
} catch (BlockBagException e) {
missingBlocks[block.getBlockType().getInternalId()]++;
throw FaweCache.BLOCK_BAG;
throw FaweCache.INSTANCE.getBLOCK_BAG();
}
}
if (mine) {