mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Update to latest P2
This commit is contained in:
parent
59897dea11
commit
10a6619853
@ -8,7 +8,7 @@ fun Project.applyCommonConfiguration() {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven { url = uri("http://ci.athion.net/job/PlotSquared-we/ws/mvn/") }
|
maven { url = uri("http://ci.athion.net/job/PlotSquared-breaking/ws/mvn/") }
|
||||||
maven { url = uri("https://maven.sk89q.com/repo/") }
|
maven { url = uri("https://maven.sk89q.com/repo/") }
|
||||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
|
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
|
||||||
maven { url = uri("http://empcraft.com/maven2") }
|
maven { url = uri("http://empcraft.com/maven2") }
|
||||||
|
@ -7,7 +7,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url = uri("http://ci.athion.net/job/PlotSquared-we/ws/mvn/") }
|
maven { url = uri("http://ci.athion.net/job/PlotSquared-breaking/ws/mvn/") }
|
||||||
}
|
}
|
||||||
|
|
||||||
applyPlatformAndCoreConfiguration()
|
applyPlatformAndCoreConfiguration()
|
||||||
|
@ -6,6 +6,7 @@ import com.boydti.fawe.object.io.BufferedRandomAccessFile;
|
|||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.world.block.BlockID;
|
import com.sk89q.worldedit.world.block.BlockID;
|
||||||
|
import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -138,11 +139,14 @@ public abstract class MCAWriter implements Extent {
|
|||||||
chunk.setPosition(fcx + (getOffsetX() >> 4), fcz + (getOffsetZ() >> 4));
|
chunk.setPosition(fcx + (getOffsetX() >> 4), fcz + (getOffsetZ() >> 4));
|
||||||
|
|
||||||
// Compress
|
// Compress
|
||||||
byte[] bytes = chunk.toBytes(byteStore1.get());
|
FastByteArrayOutputStream uncompressed = chunk.toBytes(byteStore1.get());
|
||||||
byte[] compressedBytes = MainUtil.compress(bytes, byteStore2.get(), deflateStore.get());
|
int len = uncompressed.length;
|
||||||
|
uncompressed.reset();
|
||||||
|
MainUtil.compress(uncompressed.array, len , byteStore2.get(), uncompressed, deflateStore.get());
|
||||||
|
byte[] clone = Arrays.copyOf(uncompressed.array, uncompressed.length);
|
||||||
|
|
||||||
// TODO optimize (avoid cloning) by add a synchronized block and write to the RAF here instead of below
|
// TODO optimize (avoid cloning) by add a synchronized block and write to the RAF here instead of below
|
||||||
compressed[((fcx & 31)) + ((fcz & 31) << 5)] = compressedBytes.clone();
|
compressed[((fcx & 31)) + ((fcz & 31) << 5)] = clone;
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -4,20 +4,16 @@ import com.boydti.fawe.Fawe;
|
|||||||
import com.boydti.fawe.FaweAPI;
|
import com.boydti.fawe.FaweAPI;
|
||||||
import com.boydti.fawe.FaweCache;
|
import com.boydti.fawe.FaweCache;
|
||||||
import com.boydti.fawe.beta.IQueueExtent;
|
import com.boydti.fawe.beta.IQueueExtent;
|
||||||
import com.github.intellectualsites.plotsquared.plot.util.StringMan;
|
|
||||||
import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
|
import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
import com.sk89q.worldedit.extension.platform.Capability;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.biome.BiomeTypes;
|
|
||||||
import com.sk89q.worldedit.world.biome.Biomes;
|
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
|
||||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
// TODO FIXME
|
// TODO FIXME
|
||||||
public class FaweLocalBlockQueue extends LocalBlockQueue {
|
public class FaweLocalBlockQueue extends LocalBlockQueue {
|
||||||
@ -25,6 +21,7 @@ public class FaweLocalBlockQueue extends LocalBlockQueue {
|
|||||||
public final IQueueExtent IMP;
|
public final IQueueExtent IMP;
|
||||||
private final LegacyMapper legacyMapper;
|
private final LegacyMapper legacyMapper;
|
||||||
private final World world;
|
private final World world;
|
||||||
|
private BlockVector3 mutable = new MutableBlockVector3();
|
||||||
|
|
||||||
public FaweLocalBlockQueue(String worldName) {
|
public FaweLocalBlockQueue(String worldName) {
|
||||||
super(worldName);
|
super(worldName);
|
||||||
@ -74,6 +71,12 @@ public class FaweLocalBlockQueue extends LocalBlockQueue {
|
|||||||
return IMP.setBlock(x, y, z, id);
|
return IMP.setBlock(x, y, z, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setBlock(int x, int y, int z, Pattern pattern) {
|
||||||
|
mutable.setComponents(x, y, z);
|
||||||
|
return pattern.apply(IMP, mutable, mutable);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBlock(final int x, final int y, final int z, final BaseBlock id) {
|
public boolean setBlock(final int x, final int y, final int z, final BaseBlock id) {
|
||||||
return IMP.setBlock(x, y, z, id);
|
return IMP.setBlock(x, y, z, id);
|
||||||
@ -84,21 +87,9 @@ public class FaweLocalBlockQueue extends LocalBlockQueue {
|
|||||||
return IMP.getBlock(x, y, z);
|
return IMP.getBlock(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BiomeType biome;
|
|
||||||
private String lastBiome;
|
|
||||||
private BiomeRegistry reg;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, String biome) {
|
public boolean setBiome(int x, int z, BiomeType biomeType) {
|
||||||
if (!StringMan.isEqual(biome, lastBiome)) {
|
return IMP.setBiome(x, 0, z, biomeType);
|
||||||
if (reg == null) {
|
|
||||||
reg = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.USER_COMMANDS).getRegistries().getBiomeRegistry();
|
|
||||||
}
|
|
||||||
Collection<BiomeType> biomes = BiomeTypes.values();
|
|
||||||
lastBiome = biome;
|
|
||||||
this.biome = Biomes.findBiomeByName(biomes, biome, reg);
|
|
||||||
}
|
|
||||||
return IMP.setBiome(x, 0, z, this.biome);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,7 +59,8 @@ public class PlotSetBiome extends Command {
|
|||||||
Collection<BiomeType> knownBiomes = BiomeTypes.values();
|
Collection<BiomeType> knownBiomes = BiomeTypes.values();
|
||||||
final BiomeType biome = Biomes.findBiomeByName(knownBiomes, args[0], biomeRegistry);
|
final BiomeType biome = Biomes.findBiomeByName(knownBiomes, args[0], biomeRegistry);
|
||||||
if (biome == null) {
|
if (biome == null) {
|
||||||
String biomes = StringMan.join(WorldUtil.IMP.getBiomeList(), Captions.BLOCK_LIST_SEPARATOR.toString());
|
String biomes = StringMan
|
||||||
|
.join(BiomeType.REGISTRY.values(), Captions.BLOCK_LIST_SEPARATOR.getTranslated());
|
||||||
Captions.NEED_BIOME.send(player);
|
Captions.NEED_BIOME.send(player);
|
||||||
MainUtil.sendMessage(player, Captions.SUBCOMMAND_SET_OPTIONS_HEADER.toString() + biomes);
|
MainUtil.sendMessage(player, Captions.SUBCOMMAND_SET_OPTIONS_HEADER.toString() + biomes);
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user