Revert migration of FaweCache to Kotlin

This commit is contained in:
MattBDev
2020-01-29 15:01:38 -05:00
parent 7d4acbdcac
commit 020c674c01
58 changed files with 647 additions and 673 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.INSTANCE.getMANUAL());
NullExtent nullExtent = new NullExtent(this, FaweCache.MANUAL);
ExtentTraverser<Extent> next = traverser.next();
if (next != null) {

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.INSTANCE.createCache(() -> new CharFilterBlock(getExtent()));
private LoadingCache<Long, ChunkFilterBlock> threadIdToFilter = FaweCache.IMP.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.INSTANCE.asTag(tileRaw);
CompoundTag tile = FaweCache.IMP.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.INSTANCE.asTag(entRaw);
CompoundTag ent = FaweCache.IMP.asTag(entRaw);
Map<String, Tag> value = ent.getValue();
StringTag id = (StringTag) value.get("Id");

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.INSTANCE.asTag(tileRaw);
CompoundTag tile = FaweCache.IMP.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.INSTANCE.asTag(entRaw);
CompoundTag ent = FaweCache.IMP.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.INSTANCE.getBLOCK_BAG();
throw FaweCache.BLOCK_BAG;
} catch (BlockBagException e) {
missingBlocks[block.getBlockType().getInternalId()]++;
throw FaweCache.INSTANCE.getBLOCK_BAG();
throw FaweCache.BLOCK_BAG;
}
}
if (mine) {