Minor uuid cache changes

This commit is contained in:
Jesse Boyd 2016-07-25 09:23:20 +10:00
parent 14b2b11bf3
commit 770b9be160
2 changed files with 7 additions and 3 deletions

View File

@ -80,8 +80,8 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
e.printStackTrace(); e.printStackTrace();
} }
} }
if (Settings.UUID.NATIVE_UUID_PROVIDER) {
HashBiMap<StringWrapper, UUID> toAdd = HashBiMap.create(new HashMap<StringWrapper, UUID>()); HashBiMap<StringWrapper, UUID> toAdd = HashBiMap.create(new HashMap<StringWrapper, UUID>());
if (Settings.UUID.NATIVE_UUID_PROVIDER) {
HashSet<UUID> all = UUIDHandler.getAllUUIDS(); HashSet<UUID> all = UUIDHandler.getAllUUIDS();
PS.debug("&aFast mode UUID caching enabled!"); PS.debug("&aFast mode UUID caching enabled!");
File playerDataFolder = new File(container, world + File.separator + "playerdata"); File playerDataFolder = new File(container, world + File.separator + "playerdata");
@ -124,7 +124,6 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
PS.debug("Failed to cache: " + all.size() + " uuids - slowly processing all files"); PS.debug("Failed to cache: " + all.size() + " uuids - slowly processing all files");
} }
} }
HashBiMap<StringWrapper, UUID> toAdd = HashBiMap.create(new HashMap<StringWrapper, UUID>());
HashSet<String> worlds = Sets.newHashSet(world, "world"); HashSet<String> worlds = Sets.newHashSet(world, "world");
HashSet<UUID> uuids = new HashSet<>(); HashSet<UUID> uuids = new HashSet<>();
HashSet<String> names = new HashSet<>(); HashSet<String> names = new HashSet<>();

View File

@ -4,9 +4,12 @@ import com.flowpowered.math.vector.Vector3i;
import com.intellectualcrafters.plot.generator.AugmentedUtils; import com.intellectualcrafters.plot.generator.AugmentedUtils;
import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.util.block.DelegateLocalBlockQueue; import com.intellectualcrafters.plot.util.block.DelegateLocalBlockQueue;
import com.plotsquared.sponge.SpongeMain;
import com.plotsquared.sponge.util.SpongeUtil; import com.plotsquared.sponge.util.SpongeUtil;
import java.util.List; import java.util.List;
import org.spongepowered.api.block.BlockState; import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.NamedCause;
import org.spongepowered.api.world.World; import org.spongepowered.api.world.World;
import org.spongepowered.api.world.extent.ImmutableBiomeArea; import org.spongepowered.api.world.extent.ImmutableBiomeArea;
import org.spongepowered.api.world.extent.MutableBlockVolume; import org.spongepowered.api.world.extent.MutableBlockVolume;
@ -34,6 +37,8 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
return generator; return generator;
} }
private Cause cause = Cause.of(NamedCause.of("PlotSquared", SpongeMain.THIS));
@Override @Override
public void populate(World world, MutableBlockVolume terrain, ImmutableBiomeArea biome) { public void populate(World world, MutableBlockVolume terrain, ImmutableBiomeArea biome) {
Vector3i min = terrain.getBlockMin(); Vector3i min = terrain.getBlockMin();
@ -44,7 +49,7 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
AugmentedUtils.generate(world.getName(), cx, cz, new DelegateLocalBlockQueue(null) { AugmentedUtils.generate(world.getName(), cx, cz, new DelegateLocalBlockQueue(null) {
@Override @Override
public boolean setBlock(int x, int y, int z, int id, int data) { public boolean setBlock(int x, int y, int z, int id, int data) {
terrain.setBlock(bx + x, y, bz + z, SpongeUtil.getBlockState(id, data)); terrain.setBlock(bx + x, y, bz + z, SpongeUtil.getBlockState(id, data), cause);
return true; return true;
} }