Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 01:50:06 +01:00
Convert tabs to whitespace.
Dieser Commit ist enthalten in:
Ursprung
4d8cf04be1
Commit
46f5b12b36
@ -277,7 +277,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
|
||||
sections[y4] = section = new ChunkSection(y4 << 4, nmsWorld.worldProvider.g());
|
||||
}
|
||||
if (existing.e() != blockData.e() || existing.getMaterial().f() != blockData.getMaterial().f()) {
|
||||
nmsChunk.setType(pos = new BlockPosition(x, y, z), blockData, false);
|
||||
nmsChunk.setType(pos = new BlockPosition(x, y, z), blockData, false);
|
||||
} else {
|
||||
section.setType(x & 15, y & 15, z & 15, blockData);
|
||||
}
|
||||
@ -555,25 +555,25 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
|
||||
return material.getCraftBlockData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
|
||||
// TODO Auto-generated method stub
|
||||
@Override
|
||||
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyAndLightBlock(Location position, BlockState previousType) {
|
||||
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
|
||||
}
|
||||
@Override
|
||||
public void notifyAndLightBlock(Location position, BlockState previousType) {
|
||||
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
|
||||
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
|
||||
}
|
||||
@Override
|
||||
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
|
||||
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFakeOP(Player player) {
|
||||
// TODO Auto-generated method stub
|
||||
@Override
|
||||
public void sendFakeOP(Player player) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.boydti.fawe.bukkit.filter;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.FaweAPI;
|
||||
import com.boydti.fawe.object.RunnableVal;
|
||||
@ -13,9 +15,6 @@ import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import org.bukkit.World;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class WorldGuardFilter extends CuboidRegionFilter {
|
||||
private final World world;
|
||||
private boolean large;
|
||||
@ -32,8 +31,8 @@ public class WorldGuardFilter extends CuboidRegionFilter {
|
||||
public void run(Object value) {
|
||||
WorldGuardFilter.this.manager = WorldGuard.getInstance().getPlatform().getRegionContainer().get(FaweAPI.getWorld(world.getName()));
|
||||
for (ProtectedRegion region : manager.getRegions().values()) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
if (max.getBlockX() - min.getBlockX() > 1024 || max.getBlockZ() - min.getBlockZ() > 1024) {
|
||||
Fawe.debug("Large or complex region shapes cannot be optimized. Filtering will be slower");
|
||||
large = true;
|
||||
|
@ -125,7 +125,7 @@ public class CFIPacketListener implements Listener {
|
||||
|
||||
VirtualWorld gen = getGenerator(event);
|
||||
if (gen != null) {
|
||||
BlockVector3 origin = gen.getOrigin().toBlockPoint();
|
||||
BlockVector3 origin = gen.getOrigin().toBlockPoint();
|
||||
PacketContainer packet = event.getPacket();
|
||||
StructureModifier<Integer> ints = packet.getIntegers();
|
||||
int cx = ints.read(0);
|
||||
@ -160,8 +160,8 @@ public class CFIPacketListener implements Listener {
|
||||
Location pos = player.getLocation();
|
||||
VirtualWorld gen = getGenerator(event);
|
||||
if (gen != null) {
|
||||
BlockVector3 origin = gen.getOrigin().toBlockPoint();
|
||||
BlockVector3 pt = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
BlockVector3 origin = gen.getOrigin().toBlockPoint();
|
||||
BlockVector3 pt = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
|
||||
StructureModifier<Integer> ints = event.getPacket().getIntegers();
|
||||
int id = ints.read(0);
|
||||
@ -185,8 +185,8 @@ public class CFIPacketListener implements Listener {
|
||||
Location pos = player.getLocation();
|
||||
VirtualWorld gen = getGenerator(event);
|
||||
if (gen != null) {
|
||||
BlockVector3 origin = gen.getOrigin().toBlockPoint();
|
||||
BlockVector3 from = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
BlockVector3 origin = gen.getOrigin().toBlockPoint();
|
||||
BlockVector3 from = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
|
||||
PacketContainer packet = event.getPacket();
|
||||
StructureModifier<Double> doubles = packet.getDoubles();
|
||||
@ -248,7 +248,7 @@ public class CFIPacketListener implements Listener {
|
||||
BlockInteractEvent toCall = new BlockInteractEvent(actor, location, action);
|
||||
platform.handleBlockInteract(toCall);
|
||||
if (toCall.isCancelled() || action == Interaction.OPEN) {
|
||||
BlockVector3 realPos = pt.add(gen.getOrigin().toBlockPoint());
|
||||
BlockVector3 realPos = pt.add(gen.getOrigin().toBlockPoint());
|
||||
BlockStateHolder block = gen.getBlock(pt);
|
||||
sendBlockChange(plr, realPos, block);
|
||||
return true;
|
||||
@ -287,7 +287,7 @@ public class CFIPacketListener implements Listener {
|
||||
private void handleBlockEvent(PacketEvent event, boolean relative, RunnableVal3<PacketEvent, VirtualWorld, BlockVector3> task) {
|
||||
VirtualWorld gen = getGenerator(event);
|
||||
if (gen != null) {
|
||||
BlockVector3 pt = getRelPos(event, gen);
|
||||
BlockVector3 pt = getRelPos(event, gen);
|
||||
if (pt != null) {
|
||||
if (relative) pt = getRelative(event, pt);
|
||||
if (gen.contains(pt)) {
|
||||
|
@ -22,9 +22,9 @@ import java.util.Map;
|
||||
|
||||
public class WorldguardFlag extends BukkitMaskManager implements Listener {
|
||||
private WorldGuardPlugin worldguard;
|
||||
FaweBukkit plugin;
|
||||
private FaweBukkit plugin;
|
||||
|
||||
public WorldguardFlag(final Plugin p2, final FaweBukkit p3) {
|
||||
public WorldguardFlag(Plugin p2, FaweBukkit p3) {
|
||||
super("worldguardflag");
|
||||
this.worldguard = (WorldGuardPlugin) p2; // this.getWorldGuard();
|
||||
this.plugin = p3;
|
||||
@ -66,9 +66,9 @@ public class WorldguardFlag extends BukkitMaskManager implements Listener {
|
||||
|
||||
@Override
|
||||
public BlockVector3 getMinimumPoint() {
|
||||
BlockVector3 point = null;
|
||||
BlockVector3 point = null;
|
||||
for (Map.Entry<String, ProtectedRegion> entry : manager.getRegions().entrySet()) {
|
||||
BlockVector3 p = entry.getValue().getMinimumPoint();
|
||||
BlockVector3 p = entry.getValue().getMinimumPoint();
|
||||
if (point == null) {
|
||||
point = p;
|
||||
continue;
|
||||
@ -80,9 +80,9 @@ public class WorldguardFlag extends BukkitMaskManager implements Listener {
|
||||
|
||||
@Override
|
||||
public BlockVector3 getMaximumPoint() {
|
||||
BlockVector3 point = null;
|
||||
BlockVector3 point = null;
|
||||
for (Map.Entry<String, ProtectedRegion> entry : manager.getRegions().entrySet()) {
|
||||
BlockVector3 p = entry.getValue().getMaximumPoint();
|
||||
BlockVector3 p = entry.getValue().getMaximumPoint();
|
||||
if (point == null) {
|
||||
point = p;
|
||||
continue;
|
||||
|
@ -601,29 +601,29 @@ public final class Spigot_v1_14_R1 extends CachedBukkitAdapter implements Bukkit
|
||||
return material.getCraftBlockData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
|
||||
@Override
|
||||
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutTileEntityData(
|
||||
new BlockPosition(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
|
||||
7,
|
||||
(NBTTagCompound) fromNative(nbtData)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyAndLightBlock(Location position, BlockState previousType) {
|
||||
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
|
||||
}
|
||||
@Override
|
||||
public void notifyAndLightBlock(Location position, BlockState previousType) {
|
||||
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
|
||||
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
|
||||
}
|
||||
@Override
|
||||
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
|
||||
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFakeOP(Player player) {
|
||||
@Override
|
||||
public void sendFakeOP(Player player) {
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityStatus(
|
||||
((CraftPlayer) player).getHandle(), (byte) 28
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -366,20 +366,20 @@ public class AsyncBlock implements Block {
|
||||
this.getUnsafeBlock().removeMetadata(metadataKey, owningPlugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassable() {
|
||||
return this.getUnsafeBlock().isPassable();
|
||||
}
|
||||
@Override
|
||||
public boolean isPassable() {
|
||||
return this.getUnsafeBlock().isPassable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTrace(@NotNull Location arg0, @NotNull Vector arg1, double arg2, @NotNull FluidCollisionMode arg3) {
|
||||
return this.getUnsafeBlock().rayTrace(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTrace(@NotNull Location arg0, @NotNull Vector arg1, double arg2, @NotNull FluidCollisionMode arg3) {
|
||||
return this.getUnsafeBlock().rayTrace(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
@NotNull @Override
|
||||
public BoundingBox getBoundingBox() {
|
||||
return this.getUnsafeBlock().getBoundingBox();
|
||||
}
|
||||
@NotNull @Override
|
||||
public BoundingBox getBoundingBox() {
|
||||
return this.getUnsafeBlock().getBoundingBox();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull BlockSoundGroup getSoundGroup() {
|
||||
|
@ -172,15 +172,15 @@ public class AsyncChunk implements Chunk {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForceLoaded() {
|
||||
return world.isChunkForceLoaded(x, z);
|
||||
}
|
||||
@Override
|
||||
public boolean isForceLoaded() {
|
||||
return world.isChunkForceLoaded(x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForceLoaded(boolean arg0) {
|
||||
world.getChunkAt(x, z).setForceLoaded(arg0);
|
||||
}
|
||||
@Override
|
||||
public void setForceLoaded(boolean arg0) {
|
||||
world.getChunkAt(x, z).setForceLoaded(arg0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addPluginChunkTicket(final Plugin plugin) {
|
||||
|
@ -1088,97 +1088,97 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox arg0) {
|
||||
return parent.getNearbyEntities(arg0);
|
||||
}
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox arg0) {
|
||||
return parent.getNearbyEntities(arg0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox arg0, Predicate<Entity> arg1) {
|
||||
return parent.getNearbyEntities(arg0, arg1);
|
||||
}
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox arg0, Predicate<Entity> arg1) {
|
||||
return parent.getNearbyEntities(arg0, arg1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(Location arg0, double arg1, double arg2, double arg3,
|
||||
Predicate<Entity> arg4) {
|
||||
return parent.getNearbyEntities(arg0, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(Location arg0, double arg1, double arg2, double arg3,
|
||||
Predicate<Entity> arg4) {
|
||||
return parent.getNearbyEntities(arg0, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChunkForceLoaded(int arg0, int arg1) {
|
||||
return parent.isChunkForceLoaded(arg0, arg1);
|
||||
}
|
||||
@Override
|
||||
public boolean isChunkForceLoaded(int arg0, int arg1) {
|
||||
return parent.isChunkForceLoaded(arg0, arg1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location locateNearestStructure(Location arg0, StructureType arg1, int arg2, boolean arg3) {
|
||||
return parent.locateNearestStructure(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
@Override
|
||||
public Location locateNearestStructure(Location arg0, StructureType arg1, int arg2, boolean arg3) {
|
||||
return parent.locateNearestStructure(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTrace(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, boolean arg4,
|
||||
double arg5, Predicate<Entity> arg6) {
|
||||
return parent.rayTrace(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTrace(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, boolean arg4,
|
||||
double arg5, Predicate<Entity> arg6) {
|
||||
return parent.rayTrace(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2) {
|
||||
return parent.rayTraceBlocks(arg0, arg1, arg2);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2) {
|
||||
return parent.rayTraceBlocks(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3) {
|
||||
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3) {
|
||||
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3,
|
||||
boolean arg4) {
|
||||
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3,
|
||||
boolean arg4) {
|
||||
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, Predicate<Entity> arg3) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, Predicate<Entity> arg3) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3,
|
||||
Predicate<Entity> arg4) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3,
|
||||
Predicate<Entity> arg4) {
|
||||
return parent.rayTraceEntities(arg0, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle arg0, Location arg1, int arg2, double arg3, double arg4, double arg5,
|
||||
double arg6, T arg7, boolean arg8) {
|
||||
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
||||
}
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle arg0, Location arg1, int arg2, double arg3, double arg4, double arg5,
|
||||
double arg6, T arg7, boolean arg8) {
|
||||
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
|
||||
double arg6, double arg7, double arg8, T arg9, boolean arg10) {
|
||||
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
|
||||
double arg6, double arg7, double arg8, T arg9, boolean arg10) {
|
||||
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChunkForceLoaded(int x, int z, boolean forced) {
|
||||
parent.setChunkForceLoaded(x, z, forced);
|
||||
}
|
||||
@Override
|
||||
public void setChunkForceLoaded(int x, int z, boolean forced) {
|
||||
parent.setChunkForceLoaded(x, z, forced);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Chunk> getForceLoadedChunks() {
|
||||
return parent.getForceLoadedChunks();
|
||||
}
|
||||
@Override
|
||||
public Collection<Chunk> getForceLoadedChunks() {
|
||||
return parent.getForceLoadedChunks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addPluginChunkTicket(int x, int z, @NotNull Plugin plugin) {
|
||||
|
@ -20,7 +20,7 @@ public class AsyncSign extends AsyncBlockState implements Sign {
|
||||
public AsyncSign(AsyncBlock block, int combined) {
|
||||
super(block, combined);
|
||||
}
|
||||
|
||||
|
||||
private boolean isEditable = false;
|
||||
|
||||
@Override
|
||||
@ -60,15 +60,15 @@ public class AsyncSign extends AsyncBlockState implements Sign {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable() {
|
||||
return this.isEditable;
|
||||
}
|
||||
@Override
|
||||
public boolean isEditable() {
|
||||
return this.isEditable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEditable(boolean arg0) {
|
||||
this.isEditable = arg0;
|
||||
}
|
||||
@Override
|
||||
public void setEditable(boolean arg0) {
|
||||
this.isEditable = arg0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull PersistentDataContainer getPersistentDataContainer() {
|
||||
|
@ -327,7 +327,7 @@ public enum BukkitAdapter {
|
||||
* @return The Bukkit BlockData
|
||||
*/
|
||||
public static BlockData adapt(@NotNull BlockStateHolder block) {
|
||||
return getAdapter().adapt(block);
|
||||
return getAdapter().adapt(block);
|
||||
}
|
||||
|
||||
public static BlockData getBlockData(int combinedId) {
|
||||
@ -341,11 +341,11 @@ public enum BukkitAdapter {
|
||||
* @return The WorldEdit BlockState
|
||||
*/
|
||||
public static BlockState asBlockState(ItemStack itemStack) throws WorldEditException {
|
||||
checkNotNull(itemStack);
|
||||
if (itemStack.getType().isBlock()) {
|
||||
checkNotNull(itemStack);
|
||||
if (itemStack.getType().isBlock()) {
|
||||
return getAdapter().asBlockState(itemStack);
|
||||
} else {
|
||||
throw new NotABlockException();
|
||||
throw new NotABlockException();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,23 +1,18 @@
|
||||
package com.sk89q.worldedit.bukkit.adapter;
|
||||
|
||||
import com.bekvon.bukkit.residence.commands.material;
|
||||
import com.sk89q.worldedit.bukkit.adapter.IBukkitAdapter;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import org.bukkit.Bukkit;
|
||||
import java.util.List;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public abstract class CachedBukkitAdapter implements IBukkitAdapter {
|
||||
private int[] itemTypes;
|
||||
private int[] blockTypes;
|
||||
@ -63,7 +58,7 @@ public abstract class CachedBukkitAdapter implements IBukkitAdapter {
|
||||
@Override
|
||||
public BlockType adapt(Material material) {
|
||||
try {
|
||||
return BlockTypes.values[blockTypes[material.ordinal()]];
|
||||
return BlockTypes.values[blockTypes[material.ordinal()]];
|
||||
} catch (NullPointerException e) {
|
||||
if (init()) return adapt(material);
|
||||
throw e;
|
||||
|
@ -1,8 +1,14 @@
|
||||
package com.sk89q.worldedit.bukkit.adapter;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.NotABlockException;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
import com.sk89q.worldedit.bukkit.*;
|
||||
import com.sk89q.worldedit.bukkit.BukkitEntity;
|
||||
import com.sk89q.worldedit.bukkit.BukkitItemStack;
|
||||
import com.sk89q.worldedit.bukkit.BukkitPlayer;
|
||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
@ -19,6 +25,7 @@ import com.sk89q.worldedit.world.entity.EntityTypes;
|
||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Biome;
|
||||
@ -26,10 +33,6 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public interface IBukkitAdapter {
|
||||
|
||||
/**
|
||||
@ -143,7 +146,7 @@ public interface IBukkitAdapter {
|
||||
}
|
||||
|
||||
default org.bukkit.Location adapt(org.bukkit.World world, BlockVector3 position){
|
||||
return adapt(world, position.toVector3());
|
||||
return adapt(world, position.toVector3());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -114,7 +114,7 @@ public class AnvilCommands {
|
||||
descFooter = "The -d flag disabled wildcard data matching\n"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replaceall")
|
||||
public void replaceAll(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
public void replaceAll(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// final FaweBlockMatcher matchFrom; TODO NOT IMPLEMENTED
|
||||
// if (from == null) {
|
||||
// matchFrom = FaweBlockMatcher.NOT_AIR;
|
||||
@ -178,7 +178,7 @@ public class AnvilCommands {
|
||||
"The auto-save interval is the recommended value for `file-duration` and `chunk-inactivity`"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.deleteallunclaimed")
|
||||
public void deleteAllUnclaimed(Player player, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name='d', desc = "TODO") boolean debug) throws WorldEditException {
|
||||
public void deleteAllUnclaimed(Player player, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name = 'd', desc = "TODO") boolean debug) throws WorldEditException {
|
||||
// String folder = player.getWorld().getName(); TODO NOT IMPLEMENTED
|
||||
// DeleteUnclaimedFilter filter = new DeleteUnclaimedFilter(player.getWorld(), fileDurationMillis, inhabitedTicks, fileDurationMillis);
|
||||
// if (debug) {
|
||||
@ -201,7 +201,7 @@ public class AnvilCommands {
|
||||
"The auto-save interval is the recommended value for `file-duration` and `chunk-inactivity`"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.deleteunclaimed")
|
||||
public void deleteUnclaimed(Player player, EditSession editSession, @Selection Region selection, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name='d', desc = "TODO") boolean debug) throws WorldEditException {
|
||||
public void deleteUnclaimed(Player player, EditSession editSession, @Selection Region selection, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name = 'd', desc = "TODO") boolean debug) throws WorldEditException {
|
||||
// DeleteUnclaimedFilter filter = new DeleteUnclaimedFilter(player.getWorld(), fileDurationMillis, inhabitedTicks, fileDurationMillis); TODO NOT IMPLEMENTED
|
||||
// if (debug) {
|
||||
// filter.enableDebug();
|
||||
@ -238,7 +238,7 @@ public class AnvilCommands {
|
||||
"Unmodified chunks will be deleted\n"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.trimallplots")
|
||||
public void trimAllPlots(Player player, @Switch(name='v', desc = "Delete unvisited chunks") boolean deleteUnvisited) throws WorldEditException {
|
||||
public void trimAllPlots(Player player, @Switch(name = 'v', desc = "Delete unvisited chunks") boolean deleteUnvisited) throws WorldEditException {
|
||||
// String folder = player.getWorld().getName(); TODO NOT IMPLEMENTED
|
||||
// int visitTime = deleteUnvisited ? 1 : -1;
|
||||
// PlotTrimFilter filter = new PlotTrimFilter(player.getWorld(), 0, visitTime, 600000);
|
||||
@ -256,7 +256,7 @@ public class AnvilCommands {
|
||||
desc = "Delete chunks matching a specific biome"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.trimallair")
|
||||
public void deleteBiome(Player player, String folder, BiomeType biome, @Switch(name='u', desc = "TODO") boolean unsafe) {
|
||||
public void deleteBiome(Player player, String folder, BiomeType biome, @Switch(name = 'u', desc = "TODO") boolean unsafe) {
|
||||
// DeleteBiomeFilterSimple filter = new DeleteBiomeFilterSimple(biome); TODO NOT IMPLEMENTED
|
||||
// DeleteBiomeFilterSimple result = runWithWorld(player, folder, filter, true, unsafe);
|
||||
// if (result != null) {
|
||||
@ -269,7 +269,7 @@ public class AnvilCommands {
|
||||
desc = "Trim all air in the world"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.trimallair")
|
||||
public void trimAllAir(Player player, String folder, @Switch(name='u', desc = "TODO") boolean unsafe) throws WorldEditException {
|
||||
public void trimAllAir(Player player, String folder, @Switch(name = 'u', desc = "TODO") boolean unsafe) throws WorldEditException {
|
||||
// TrimAirFilter filter = new TrimAirFilter(); TODO NOT IMPLEMENTED
|
||||
// TrimAirFilter result = runWithWorld(player, folder, filter, true, unsafe);
|
||||
// if (result != null) {
|
||||
@ -297,7 +297,7 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with another"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replaceall")
|
||||
public void replaceAllPattern(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap) throws WorldEditException {
|
||||
public void replaceAllPattern(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap) throws WorldEditException {
|
||||
// MCAFilterCounter filter; TODO NOT IMPLEMENTED
|
||||
// if (useMap) {
|
||||
// if (to instanceof RandomPattern) {
|
||||
@ -326,7 +326,7 @@ public class AnvilCommands {
|
||||
desc = "Count all blocks in a world"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.countall")
|
||||
public void countAll(Player player, EditSession editSession, String folder, String arg, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
public void countAll(Player player, EditSession editSession, String folder, String arg, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// Set<BaseBlock> searchBlocks = worldEdit.getBlocks(player, arg, true);
|
||||
// MCAFilterCounter filter;
|
||||
// if (useData || arg.contains(":")) { // Optimize for both cases
|
||||
@ -400,7 +400,7 @@ public class AnvilCommands {
|
||||
desc = "Count blocks in a selection"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.count")
|
||||
public void count(Player player, EditSession editSession, @Selection Region selection, String arg, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
public void count(Player player, EditSession editSession, @Selection Region selection, String arg, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// Set<BaseBlock> searchBlocks = worldEdit.getBlocks(player, arg, true); TODO NOT IMPLEMENTED
|
||||
// MCAFilterCounter filter;
|
||||
// if (useData || arg.contains(":")) { // Optimize for both cases
|
||||
@ -422,7 +422,7 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with another"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.distr")
|
||||
public void distr(Player player, EditSession editSession, @Selection Region selection, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
public void distr(Player player, EditSession editSession, @Selection Region selection, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// long total = 0; TODO NOT IMPLEMENTED
|
||||
// long[] count;
|
||||
// MCAFilter<long[]> counts;
|
||||
@ -501,7 +501,7 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with another"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replace")
|
||||
public void replace(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
public void replace(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// final FaweBlockMatcher matchFrom; TODO NOT IMPLEMENTED
|
||||
// if (from == null) {
|
||||
// matchFrom = FaweBlockMatcher.NOT_AIR;
|
||||
@ -523,8 +523,8 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with a pattern"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replace")
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap
|
||||
public void replacePattern(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap) throws WorldEditException {
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap
|
||||
public void replacePattern(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap) throws WorldEditException {
|
||||
// MCAFilterCounter filter; TODO NOT IMPLEMENTED
|
||||
// if (useMap) {
|
||||
// if (to instanceof RandomPattern) {
|
||||
@ -554,7 +554,7 @@ public class AnvilCommands {
|
||||
desc = "Set all blocks in the selection with a pattern"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.set")
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap
|
||||
public void set(Player player, EditSession editSession, @Selection Region selection, final Pattern to) throws WorldEditException {
|
||||
// MCAFilterCounter filter = new SetPatternFilter(to); TODO NOT IMPLEMENTED
|
||||
// MCAFilterCounter result = runWithSelection(player, editSession, selection, filter);
|
||||
@ -610,7 +610,7 @@ public class AnvilCommands {
|
||||
"The -c flag will align the paste to the chunks."
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.pastechunks")
|
||||
public void paste(Player player, LocalSession session, EditSession editSession, @Switch(name='c', desc = "TODO") boolean alignChunk) throws WorldEditException, IOException {
|
||||
public void paste(Player player, LocalSession session, EditSession editSession, @Switch(name = 'c', desc = "TODO") boolean alignChunk) throws WorldEditException, IOException {
|
||||
// FawePlayer fp = FawePlayer.wrap(player); TODO NOT IMPLEMENTED
|
||||
// MCAClipboard clipboard = fp.getMeta(FawePlayer.METADATA_KEYS.ANVIL_CLIPBOARD);
|
||||
// if (clipboard == null) {
|
||||
|
@ -626,7 +626,6 @@ public enum BBC {
|
||||
return "DARK_PURPLE";
|
||||
case '6':
|
||||
return "GOLD";
|
||||
default:
|
||||
case '7':
|
||||
return "GRAY";
|
||||
case '8':
|
||||
@ -657,6 +656,8 @@ public enum BBC {
|
||||
return "ITALIC";
|
||||
case 'r':
|
||||
return "RESET";
|
||||
default:
|
||||
return "GRAY";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ public class SchematicStreamer extends NBTStreamer {
|
||||
|
||||
public Clipboard getClipboard() throws IOException {
|
||||
try {
|
||||
setupClipboard(0);
|
||||
setupClipboard(0);
|
||||
addDimensionReaders();
|
||||
addBlockReaders();
|
||||
readFully();
|
||||
|
@ -181,8 +181,8 @@ public abstract class FawePlayer<T> extends Metadatable {
|
||||
public void checkConfirmationStack(@NotNull Runnable task, String command, Region region, int times, InjectedValueAccess context) throws RegionOperationException {
|
||||
if (command != null && !getMeta("cmdConfirmRunning", false)) {
|
||||
if (region != null) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
long area = (long) ((max.getX() - min.getX()) * (max.getZ() - min.getZ() + 1)) * times;
|
||||
if (area > 2 << 18) {
|
||||
setConfirmTask(task, context, command);
|
||||
@ -198,8 +198,8 @@ public abstract class FawePlayer<T> extends Metadatable {
|
||||
public void checkConfirmationRegion(@NotNull Runnable task, String command, Region region, InjectedValueAccess context) throws RegionOperationException {
|
||||
if (command != null && !getMeta("cmdConfirmRunning", false)) {
|
||||
if (region != null) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
long area = (max.getX() - min.getX()) * (max.getZ() - min.getZ() + 1);
|
||||
if (area > 2 << 18) {
|
||||
setConfirmTask(task, context, command);
|
||||
|
@ -1,8 +1,9 @@
|
||||
package com.boydti.fawe.object;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.object.changeset.FaweChangeSet;
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
@ -13,15 +14,12 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Stores changes to a {@link ChangeSet}.
|
||||
*/
|
||||
@ -156,9 +154,9 @@ public class HistoryExtent extends AbstractDelegateExtent {
|
||||
return this.entity.getFacet(cls);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setLocation(Location location) {
|
||||
return this.entity.setLocation(location);
|
||||
}
|
||||
@Override
|
||||
public boolean setLocation(Location location) {
|
||||
return this.entity.setLocation(location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,15 +68,15 @@ public class NullChangeSet extends FaweChangeSet {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class CopyPastaBrush implements Brush, ResettableTool {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (super.test(vector) && vector.getBlockY() >= minY) {
|
||||
BaseBlock block = editSession.getFullBlock(vector);
|
||||
BaseBlock block = editSession.getFullBlock(vector);
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
builder.add(vector, BlockTypes.AIR.getDefaultState().toBaseBlock(), block);
|
||||
return true;
|
||||
|
@ -133,8 +133,8 @@ public class HeightBrush implements Brush {
|
||||
}
|
||||
|
||||
if (smooth) {
|
||||
BlockVector2 min = BlockVector2.at(Math.max(0, bx - size), Math.max(0, bz - size));
|
||||
BlockVector2 max = BlockVector2.at(Math.min(hmmg.getWidth() - 1, bx + size), Math.min(hmmg.getLength() - 1, bz + size));
|
||||
BlockVector2 min = BlockVector2.at(Math.max(0, bx - size), Math.max(0, bz - size));
|
||||
BlockVector2 max = BlockVector2.at(Math.min(hmmg.getWidth() - 1, bx + size), Math.min(hmmg.getLength() - 1, bz + size));
|
||||
hmmg.smooth(min, max, 8, 1);
|
||||
|
||||
if (size > 20) {
|
||||
|
@ -7,7 +7,6 @@ import com.boydti.fawe.object.mask.IdMask;
|
||||
import com.boydti.fawe.object.visitor.DFSRecursiveVisitor;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.command.tool.brush.Brush;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
@ -23,7 +22,6 @@ import com.sk89q.worldedit.math.interpolation.Node;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class SplineBrush implements Brush, ResettableTool {
|
||||
@ -84,7 +82,7 @@ public class SplineBrush implements Brush, ResettableTool {
|
||||
for (int y = -1; y <= 1; y++) {
|
||||
for (int z = -1; z <= 1; z++) {
|
||||
if (x != 0 || y != 0 || z != 0) {
|
||||
BlockVector3 pos = BlockVector3.at(x, y, z);
|
||||
BlockVector3 pos = BlockVector3.at(x, y, z);
|
||||
if (!directions.contains(pos)) {
|
||||
directions.add(pos);
|
||||
}
|
||||
@ -151,7 +149,7 @@ public class SplineBrush implements Brush, ResettableTool {
|
||||
}
|
||||
|
||||
private Vector3 getCentroid(Collection<BlockVector3> points) {
|
||||
MutableVector3 sum = new MutableVector3();
|
||||
MutableVector3 sum = new MutableVector3();
|
||||
for (BlockVector3 p : points) {
|
||||
sum.mutX(sum.getX() + p.getX());
|
||||
sum.mutY(sum.getY() + p.getY());
|
||||
|
@ -61,7 +61,7 @@ public class SurfaceSpline implements Brush {
|
||||
tipy = editSession.getNearestSurfaceTerrainBlock(tipx, tipz, tipy, 0, maxY);
|
||||
if (tipy == -1) continue;
|
||||
if (radius == 0) {
|
||||
BlockVector3 set = mutable.setComponents(tipx, tipy, tipz);
|
||||
BlockVector3 set = mutable.setComponents(tipx, tipy, tipz);
|
||||
try {
|
||||
pattern.apply(editSession, set, set);
|
||||
} catch (WorldEditException e) {
|
||||
|
@ -24,7 +24,7 @@ public interface HeightMap {
|
||||
}
|
||||
|
||||
default void applyHeightMapData(int[][] data, EditSession session, BlockVector3 pos, int size, double yscale, boolean smooth, boolean towards, boolean layers) throws MaxChangedBlocksException {
|
||||
BlockVector3 top = session.getMaximumPoint();
|
||||
BlockVector3 top = session.getMaximumPoint();
|
||||
int maxY = top.getBlockY();
|
||||
Location min = new Location(session.getWorld(), pos.subtract(size, maxY, size).toVector3());
|
||||
BlockVector3 max = pos.add(size, maxY, size);
|
||||
@ -47,7 +47,7 @@ public interface HeightMap {
|
||||
}
|
||||
|
||||
default int[][] generateHeightData(EditSession session, Mask mask, BlockVector3 pos, int size, final int rotationMode, double yscale, boolean smooth, boolean towards, final boolean layers) {
|
||||
BlockVector3 top = session.getMaximumPoint();
|
||||
BlockVector3 top = session.getMaximumPoint();
|
||||
int maxY = top.getBlockY();
|
||||
int diameter = 2 * size + 1;
|
||||
int centerX = pos.getBlockX();
|
||||
|
@ -15,7 +15,7 @@ import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
public interface VirtualWorld extends SimpleWorld, Closeable {
|
||||
Vector3 getOrigin();
|
||||
Vector3 getOrigin();
|
||||
|
||||
@Override
|
||||
default BaseBlock getFullBlock(BlockVector3 position) {
|
||||
|
@ -173,15 +173,15 @@ public class AbstractDelegateChangeSet extends FaweChangeSet {
|
||||
parent.add(x, y, z, combinedFrom, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -103,15 +103,15 @@ public class AnvilHistory extends FaweChangeSet implements IAnvilHistory {
|
||||
return size == -1 ? folder.listFiles().length : size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -79,15 +79,15 @@ public class CFIChangeSet extends FaweChangeSet {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -108,15 +108,15 @@ public class CPUOptimizedChangeSet extends FaweChangeSet {
|
||||
return changes.size() * 65536; // num chunks * 65536 (guess of 65536 changes per chunk)
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@ -511,15 +510,15 @@ public class DiskStorageHistory extends FaweStreamChangeSet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -237,15 +237,15 @@ public class MemoryOptimizedHistory extends FaweStreamChangeSet {
|
||||
return tileR == null ? null : new NBTInputStream(MainUtil.getCompressedIS(new FastByteArraysInputStream(tileR)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecordingChanges() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.boydti.fawe.object.clipboard;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.jnbt.NBTStreamer;
|
||||
import com.boydti.fawe.util.ReflectionUtils;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.IntTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
@ -15,11 +15,10 @@ import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class FaweClipboard {
|
||||
public abstract BaseBlock getBlock(int x, int y, int z);
|
||||
@ -86,8 +85,8 @@ public abstract class FaweClipboard {
|
||||
|
||||
@Override
|
||||
public <B extends BlockStateHolder<B>> void run(int x, int y, int z, B block) {
|
||||
if(!(block instanceof BaseBlock)) return;
|
||||
BaseBlock base = (BaseBlock)block;
|
||||
if(!(block instanceof BaseBlock)) return;
|
||||
BaseBlock base = (BaseBlock)block;
|
||||
CompoundTag tag = base.getNbtData();
|
||||
if (tag != null) {
|
||||
Map<String, Tag> values = ReflectionUtils.getMap(tag.getValue());
|
||||
@ -161,10 +160,10 @@ public abstract class FaweClipboard {
|
||||
return world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setLocation(Location location) {
|
||||
//Should not be teleporting this entity
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean setLocation(Location location) {
|
||||
//Should not be teleporting this entity
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ public class MemoryOptimizedClipboard extends FaweClipboard {
|
||||
}
|
||||
}
|
||||
if (lastCombinedIds == null) {
|
||||
BlockType bt = BlockTypes.getFromStateId(v);
|
||||
BlockType bt = BlockTypes.getFromStateId(v);
|
||||
if (bt.getMaterial().isAir()) {
|
||||
return;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public abstract class ReadOnlyClipboard extends FaweClipboard {
|
||||
|
||||
@Override
|
||||
public void streamBiomes(NBTStreamer.ByteReader task) {
|
||||
BlockVector3 dim = getDimensions();
|
||||
BlockVector3 dim = getDimensions();
|
||||
int index = 0;
|
||||
for (int z = 0; z <= dim.getBlockZ(); z++) {
|
||||
for (int x = 0; x <= dim.getBlockX(); x++, index++) {
|
||||
|
@ -60,8 +60,8 @@ public class ResizableClipboardBuilder extends MemoryOptimizedHistory {
|
||||
}
|
||||
|
||||
public Clipboard build() {
|
||||
BlockVector3 pos1 = BlockVector3.at(minX, minY, minZ);
|
||||
BlockVector3 pos2 = BlockVector3.at(maxX, maxY, maxZ);
|
||||
BlockVector3 pos1 = BlockVector3.at(minX, minY, minZ);
|
||||
BlockVector3 pos2 = BlockVector3.at(maxX, maxY, maxZ);
|
||||
CuboidRegion region = new CuboidRegion(pos1, pos2);
|
||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(region);
|
||||
Iterator<Change> iter = getIterator(true);
|
||||
|
@ -3,22 +3,20 @@ package com.boydti.fawe.object.clipboard;
|
||||
import com.boydti.fawe.util.ReflectionUtils;
|
||||
import com.sk89q.jnbt.IntTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.visitor.RegionVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -73,8 +71,8 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
|
||||
@Override
|
||||
public void forEach(BlockReader task, boolean air) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
MutableBlockVector3 pos = new MutableBlockVector3();
|
||||
if (region instanceof CuboidRegion) {
|
||||
if (air) {
|
||||
@ -104,7 +102,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
int y = pos.getBlockY() - my;
|
||||
int z = pos.getBlockZ() - mz;
|
||||
if (region.contains(pos)) {
|
||||
BaseBlock block = extent.getFullBlock(pos);
|
||||
BaseBlock block = extent.getFullBlock(pos);
|
||||
if (block.hasNbtData()) {
|
||||
Map<String, Tag> values = ReflectionUtils.getMap(block.getNbtData().getValue());
|
||||
values.put("x", new IntTag(x));
|
||||
@ -133,7 +131,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
int xx = pos.getBlockX() - mx;
|
||||
if (region.contains(pos)) {
|
||||
// BlockState block = getBlockAbs(x, y, z);
|
||||
BaseBlock block = extent.getFullBlock(pos);
|
||||
BaseBlock block = extent.getFullBlock(pos);
|
||||
if (!air && block.getBlockType().getMaterial().isAir()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
if (o instanceof BlockVector3) {
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
return contains(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
}
|
||||
return false;
|
||||
@ -152,7 +152,7 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
if (o instanceof BlockVector3) {
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
return remove(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
}
|
||||
return false;
|
||||
|
@ -43,7 +43,7 @@ public class LocalBlockVector2DSet implements Set<BlockVector2> {
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
if (o instanceof BlockVector2) {
|
||||
BlockVector2 v = (BlockVector2) o;
|
||||
BlockVector2 v = (BlockVector2) o;
|
||||
return contains(v.getBlockX(), v.getBlockZ());
|
||||
}
|
||||
return false;
|
||||
@ -202,7 +202,7 @@ public class LocalBlockVector2DSet implements Set<BlockVector2> {
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
if (o instanceof BlockVector2) {
|
||||
BlockVector2 v = (BlockVector2) o;
|
||||
BlockVector2 v = (BlockVector2) o;
|
||||
return remove(v.getBlockX(), v.getBlockZ());
|
||||
}
|
||||
return false;
|
||||
|
@ -50,7 +50,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
if (o instanceof BlockVector3) {
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
return contains(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
}
|
||||
return false;
|
||||
@ -249,7 +249,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
if (o instanceof BlockVector3) {
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
BlockVector3 v = (BlockVector3) o;
|
||||
return remove(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
}
|
||||
return false;
|
||||
|
@ -78,12 +78,12 @@ public class SummedAreaTable {
|
||||
if (index == 0) {
|
||||
return curr;
|
||||
}
|
||||
/* top row */
|
||||
/* top row */
|
||||
else if (row == 0 && col != 0) {
|
||||
leftSum = summed[index - 1];
|
||||
return curr + leftSum;
|
||||
}
|
||||
/* left-most column */
|
||||
/* left-most column */
|
||||
else if (row != 0 && col == 0) {
|
||||
topSum = summed[index - width];
|
||||
return curr + topSum;
|
||||
@ -94,4 +94,4 @@ public class SummedAreaTable {
|
||||
return curr + leftSum + topSum - topLeftSum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +59,9 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
|
||||
public BlockState getBlock(int x, int y, int z) {
|
||||
return super.getBlock(x + dx, y + dy, z + dz);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 pos) {
|
||||
return super.getFullBlock(pos.add(dx, dy, dz));
|
||||
return super.getFullBlock(pos.add(dx, dy, dz));
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public BiomeType getBiome(final BlockVector2 arg0) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -62,7 +62,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public BlockState getBlock(final BlockVector3 arg0) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -70,7 +70,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public BlockState getBlock(int x, int y, int z) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -86,7 +86,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public boolean setBiome(final BlockVector2 arg0, final BiomeType arg1) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -94,7 +94,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public boolean setBlock(final BlockVector3 arg0, final BlockStateHolder arg1) throws WorldEditException {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -102,7 +102,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -110,7 +110,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public Entity createEntity(final Location arg0, final BaseEntity arg1) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -138,7 +138,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public boolean contains(int x, int z) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -146,7 +146,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public boolean contains(int x, int y, int z) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -165,7 +165,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public int getNearestSurfaceLayer(int x, int z, int y, int minY, int maxY) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@ -173,7 +173,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@ -181,7 +181,7 @@ public class NullExtent extends FaweRegionExtent {
|
||||
@Override
|
||||
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
throw reason;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
return super.getFullBlock(getPos(position));
|
||||
return super.getFullBlock(getPos(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,11 +1,8 @@
|
||||
package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.boydti.fawe.util.ReflectionUtils;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
@ -13,12 +10,11 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.NbtValued;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class StripNBTExtent extends AbstractDelegateExtent {
|
||||
private final String[] strip;
|
||||
@ -50,8 +46,8 @@ public class StripNBTExtent extends AbstractDelegateExtent {
|
||||
}
|
||||
|
||||
public <B extends BlockStateHolder<B>> B stripBlockNBT(B block) {
|
||||
if(!(block instanceof BaseBlock)) return block;
|
||||
BaseBlock localBlock = (BaseBlock)block;
|
||||
if(!(block instanceof BaseBlock)) return block;
|
||||
BaseBlock localBlock = (BaseBlock)block;
|
||||
if (!localBlock.hasNbtData()) return block;
|
||||
CompoundTag nbt = localBlock.getNbtData();
|
||||
Map<String, Tag> value = nbt.getValue();
|
||||
|
@ -68,9 +68,9 @@ public class TemporalExtent extends AbstractDelegateExtent {
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
if (position.getX() == x && position.getY() == y && position.getZ() == z) {
|
||||
if(block instanceof BaseBlock) {
|
||||
return (BaseBlock)block;
|
||||
return (BaseBlock)block;
|
||||
}else {
|
||||
return block.toBaseBlock();
|
||||
return block.toBaseBlock();
|
||||
}
|
||||
}
|
||||
return super.getFullBlock(position);
|
||||
|
@ -1,16 +1,15 @@
|
||||
package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
public class TransformExtent extends BlockTransformExtent {
|
||||
@ -31,15 +30,15 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
|
||||
@Override
|
||||
public BlockVector3 getMinimumPoint() {
|
||||
BlockVector3 pos1 = getPos(super.getMinimumPoint());
|
||||
BlockVector3 pos2 = getPos(super.getMaximumPoint());
|
||||
BlockVector3 pos1 = getPos(super.getMinimumPoint());
|
||||
BlockVector3 pos2 = getPos(super.getMaximumPoint());
|
||||
return pos1.getMinimum(pos2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockVector3 getMaximumPoint() {
|
||||
BlockVector3 pos1 = getPos(super.getMinimumPoint());
|
||||
BlockVector3 pos2 = getPos(super.getMaximumPoint());
|
||||
BlockVector3 pos1 = getPos(super.getMinimumPoint());
|
||||
BlockVector3 pos2 = getPos(super.getMaximumPoint());
|
||||
return pos1.getMaximum(pos2);
|
||||
}
|
||||
|
||||
@ -84,7 +83,7 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
return transform(super.getFullBlock(getPos(position)));
|
||||
return transform(super.getFullBlock(getPos(position)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,12 +1,10 @@
|
||||
package com.boydti.fawe.object.function.block;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
|
||||
public class CombinedBlockCopy implements RegionFunction {
|
||||
|
||||
@ -23,7 +21,7 @@ public class CombinedBlockCopy implements RegionFunction {
|
||||
@Override
|
||||
public boolean apply(BlockVector3 position) throws WorldEditException {
|
||||
// BlockStateHolder block = source.getBlock(position);
|
||||
BaseBlock block = source.getFullBlock(position);
|
||||
BaseBlock block = source.getFullBlock(position);
|
||||
function.apply(position);
|
||||
return destination.setBlock(position, block);
|
||||
}
|
||||
|
@ -58,23 +58,23 @@ public class AdjacentAnyMask extends AbstractMask implements ResettableMask {
|
||||
int y = v.getBlockY();
|
||||
int z = v.getBlockZ();
|
||||
if (mask.test(x + 1, y, z)) {
|
||||
mutable.setComponents(1, 0, 0);
|
||||
mutable.setComponents(1, 0, 0);
|
||||
}else
|
||||
if (mask.test(x - 1, y, z)) {
|
||||
mutable.setComponents(-1, 0, 0);
|
||||
mutable.setComponents(-1, 0, 0);
|
||||
}else
|
||||
if (mask.test(x, y, z + 1)) {
|
||||
mutable.setComponents(0, 0, 1);
|
||||
mutable.setComponents(0, 0, 1);
|
||||
}else
|
||||
if (mask.test(x, y, z - 1)) {
|
||||
mutable.setComponents(0, 0, -1);
|
||||
mutable.setComponents(0, 0, -1);
|
||||
}else
|
||||
if (y < 256 && mask.test(x, y + 1, z)) {
|
||||
mutable.setComponents(0, 1, 0);
|
||||
}else
|
||||
if (y > 0 && mask.test(x, y - 1, z)) {
|
||||
mutable.setComponents(0, -1, 0);
|
||||
}
|
||||
if (y < 256 && mask.test(x, y + 1, z)) {
|
||||
mutable.setComponents(0, 1, 0);
|
||||
}else
|
||||
if (y > 0 && mask.test(x, y - 1, z)) {
|
||||
mutable.setComponents(0, -1, 0);
|
||||
}
|
||||
return (mutable.getX() == 0 && mutable.getY() == 0 && mutable.getZ() == 0) ? null : mutable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class AdjacentMask extends AbstractMask {
|
||||
|
||||
@Override
|
||||
public boolean test(BlockVector3 bv) {
|
||||
v.setComponents(bv);
|
||||
v.setComponents(bv);
|
||||
int count = 0;
|
||||
double x = bv.getX();
|
||||
double y = bv.getY();
|
||||
|
@ -23,7 +23,7 @@ public class BiomeMask extends AbstractExtentMask implements ResettableMask {
|
||||
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
BlockVector2 pos = mutable.setComponents(vector.getBlockX(), vector.getBlockZ());
|
||||
BlockVector2 pos = mutable.setComponents(vector.getBlockX(), vector.getBlockZ());
|
||||
return getExtent().getBiome(pos).getId() == biome.getId();
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class WallMask extends AbstractMask {
|
||||
|
||||
@Override
|
||||
public boolean test(BlockVector3 bv) {
|
||||
v.setComponents(bv);
|
||||
v.setComponents(bv);
|
||||
int count = 0;
|
||||
double x = v.getX();
|
||||
double y = v.getY();
|
||||
|
@ -1,12 +1,11 @@
|
||||
package com.boydti.fawe.object.pattern;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class IdPattern extends AbstractExtentPattern {
|
||||
private final Pattern pattern;
|
||||
@ -19,8 +18,8 @@ public class IdPattern extends AbstractExtentPattern {
|
||||
|
||||
@Override
|
||||
public BaseBlock apply(BlockVector3 position) {
|
||||
BaseBlock oldBlock = getExtent().getFullBlock(position);
|
||||
BaseBlock newBlock = pattern.apply(position);
|
||||
BaseBlock oldBlock = getExtent().getFullBlock(position);
|
||||
BaseBlock newBlock = pattern.apply(position);
|
||||
return newBlock.withPropertyId(oldBlock.getInternalPropertiesId()).toBaseBlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,12 @@
|
||||
package com.boydti.fawe.object.pattern;
|
||||
|
||||
import com.boydti.fawe.beta.FilterBlock;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.BreadthFirstSearch;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
@ -60,7 +57,7 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
}
|
||||
|
||||
private boolean allowed(BlockVector3 bv) {
|
||||
MutableBlockVector3 v = new MutableBlockVector3(bv);
|
||||
MutableBlockVector3 v = new MutableBlockVector3(bv);
|
||||
BlockStateHolder block = pattern.apply(bv);
|
||||
if (!block.getBlockType().getMaterial().isMovementBlocker()) {
|
||||
return false;
|
||||
|
@ -19,19 +19,22 @@
|
||||
|
||||
package com.boydti.fawe.object.regions;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.regions.AbstractRegion;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.regions.polyhedron.Edge;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Vector;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.*;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class PolyhedralRegion extends AbstractRegion {
|
||||
|
||||
@ -145,8 +148,8 @@ public class PolyhedralRegion extends AbstractRegion {
|
||||
} else {
|
||||
// minimumPoint = new MutableBlockVector3(minimumPoint.getMinimum(vertex));
|
||||
// maximumPoint = new MutableBlockVector3(maximumPoint.getMaximum(vertex));
|
||||
minimumPoint = minimumPoint.getMinimum(vertex);
|
||||
maximumPoint = maximumPoint.getMaximum(vertex);
|
||||
minimumPoint = minimumPoint.getMinimum(vertex);
|
||||
maximumPoint = maximumPoint.getMaximum(vertex);
|
||||
}
|
||||
|
||||
int size = vertices.size();
|
||||
|
@ -7,8 +7,6 @@ import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.RunContext;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@ -57,7 +55,7 @@ public abstract class DFSVisitor implements Operation {
|
||||
private IntegerTrio[] getIntDirections() {
|
||||
IntegerTrio[] array = new IntegerTrio[directions.size()];
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
BlockVector3 dir = directions.get(i);
|
||||
BlockVector3 dir = directions.get(i);
|
||||
array[i] = new IntegerTrio(dir.getBlockX(), dir.getBlockY(), dir.getBlockZ());
|
||||
}
|
||||
return array;
|
||||
@ -100,7 +98,7 @@ public abstract class DFSVisitor implements Operation {
|
||||
// mutable2.mutX(from.getX() + direction.x);
|
||||
// mutable2.mutY(from.getY() + direction.y);
|
||||
// mutable2.mutZ(from.getZ() + direction.z);
|
||||
BlockVector3 bv2 = BlockVector3.at(from.getX() + direction.x, from.getY() + direction.y, from.getZ() + direction.z);
|
||||
BlockVector3 bv2 = BlockVector3.at(from.getX() + direction.x, from.getY() + direction.y, from.getZ() + direction.z);
|
||||
if (isVisitable(bv, bv2)) {
|
||||
adjacent = new Node(bv2.getBlockX(), bv2.getBlockY(), bv2.getBlockZ());
|
||||
if ((!adjacent.equals(current.from))) {
|
||||
|
@ -69,15 +69,15 @@ public class FaweLocalBlockQueue extends LocalBlockQueue {
|
||||
public long getModified() {
|
||||
return IMP.size();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean setBlock(final int x, final int y, final int z, final PlotBlock id) {
|
||||
return setBlock(x, y, z, legacyMapper.getBaseBlockFromPlotBlock(id));
|
||||
return setBlock(x, y, z, legacyMapper.getBaseBlockFromPlotBlock(id));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,10 +155,10 @@ public class WEManager {
|
||||
|
||||
|
||||
public boolean intersects(final Region region1, final Region region2) {
|
||||
BlockVector3 rg1P1 = region1.getMinimumPoint();
|
||||
BlockVector3 rg1P2 = region1.getMaximumPoint();
|
||||
BlockVector3 rg2P1 = region2.getMinimumPoint();
|
||||
BlockVector3 rg2P2 = region2.getMaximumPoint();
|
||||
BlockVector3 rg1P1 = region1.getMinimumPoint();
|
||||
BlockVector3 rg1P2 = region1.getMaximumPoint();
|
||||
BlockVector3 rg2P1 = region2.getMinimumPoint();
|
||||
BlockVector3 rg2P2 = region2.getMaximumPoint();
|
||||
|
||||
return (rg1P1.getBlockX() <= rg2P2.getBlockX()) && (rg1P2.getBlockX() >= rg2P1.getBlockX()) && (rg1P1.getBlockZ() <= rg2P2.getBlockZ()) && (rg1P2.getBlockZ() >= rg2P1.getBlockZ());
|
||||
}
|
||||
|
@ -417,8 +417,8 @@ public class PlayerWrapper extends AbstractPlayerActor {
|
||||
return parent.openFileSaveDialog(extensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setLocation(Location location) {
|
||||
return parent.setLocation(location);
|
||||
}
|
||||
@Override
|
||||
public boolean setLocation(Location location) {
|
||||
return parent.setLocation(location);
|
||||
}
|
||||
}
|
||||
|
@ -252,13 +252,13 @@ public class WorldWrapper extends AbstractWorld {
|
||||
return parent.setBiome(position, biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException {
|
||||
return parent.notifyAndLightBlock(position, previousType);
|
||||
}
|
||||
@Override
|
||||
public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException {
|
||||
return parent.notifyAndLightBlock(position, previousType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockVector3 getSpawnPosition() {
|
||||
return parent.getSpawnPosition();
|
||||
}
|
||||
@Override
|
||||
public BlockVector3 getSpawnPosition() {
|
||||
return parent.getSpawnPosition();
|
||||
}
|
||||
}
|
||||
|
@ -3052,8 +3052,8 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld,
|
||||
final FaweRegionExtent fe = this.getRegionExtent();
|
||||
final boolean cuboid = region instanceof CuboidRegion;
|
||||
if (fe != null && cuboid) {
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
if (!fe.contains(max.getBlockX(), max.getBlockY(), max.getBlockZ()) && !fe.contains(min.getBlockX(), min.getBlockY(), min.getBlockZ())) {
|
||||
throw FaweException.OUTSIDE_REGION;
|
||||
}
|
||||
@ -3190,24 +3190,24 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld,
|
||||
world.setWeather(weatherType, duration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropItem(Vector3 position, BaseItemStack item) {
|
||||
world.dropItem(position, item);
|
||||
}
|
||||
@Override
|
||||
public void dropItem(Vector3 position, BaseItemStack item) {
|
||||
world.dropItem(position, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playEffect(Vector3 position, int type, int data) {
|
||||
return world.playEffect(position, type, data);
|
||||
}
|
||||
@Override
|
||||
public boolean playEffect(Vector3 position, int type, int data) {
|
||||
return world.playEffect(position, type, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException {
|
||||
return world.notifyAndLightBlock(position, previousType);
|
||||
}
|
||||
@Override
|
||||
public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException {
|
||||
return world.notifyAndLightBlock(position, previousType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockVector3 getSpawnPosition() {
|
||||
return world.getSpawnPosition();
|
||||
}
|
||||
@Override
|
||||
public BlockVector3 getSpawnPosition() {
|
||||
return world.getSpawnPosition();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ public class RegionCommands extends MethodCommands {
|
||||
int y = 0;
|
||||
int affected = 0;
|
||||
while (iter.hasNext()) {
|
||||
BlockVector2 pos = iter.next();
|
||||
BlockVector2 pos = iter.next();
|
||||
int x = pos.getBlockX();
|
||||
int z = pos.getBlockZ();
|
||||
y = editSession.getNearestSurfaceTerrainBlock(x, z, y, 0, maxY);
|
||||
@ -405,8 +405,8 @@ public class RegionCommands extends MethodCommands {
|
||||
@Arg(desc = "The mask of blocks to use as the height map", def = "")
|
||||
Mask mask,
|
||||
@Switch(name='s', desc = "TODO") boolean snow, InjectedValueAccess context) throws WorldEditException {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1));
|
||||
FaweLimit limit = FawePlayer.wrap(player).getLimit();
|
||||
if (volume >= limit.MAX_CHECKS) {
|
||||
|
@ -183,9 +183,9 @@ public class DefaultMaskParser extends FaweParser<Mask> {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<String> args = entry.getValue();
|
||||
String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " "));
|
||||
try {
|
||||
List<String> args = entry.getValue();
|
||||
String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " "));
|
||||
try {
|
||||
mask = (Mask) dispatcher.call(command + cmdArgs, locals, new String[0]);
|
||||
} catch (SuggestInputParseException rethrow) {
|
||||
throw rethrow;
|
||||
@ -239,6 +239,6 @@ public class DefaultMaskParser extends FaweParser<Mask> {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,7 @@ public class AnnotatedBindings extends Bindings {
|
||||
* @param modifiers the list of modifiers to scan
|
||||
* @throws InputParseException on a validation error
|
||||
*/
|
||||
private static String validate(String string, Annotation... modifiers)
|
||||
{
|
||||
private static String validate(String string, Annotation... modifiers) {
|
||||
if (string != null) {
|
||||
for (Annotation modifier : modifiers) {
|
||||
if (modifier instanceof Validate) {
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.extent;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.object.HistoryExtent;
|
||||
import com.boydti.fawe.object.changeset.FaweChangeSet;
|
||||
@ -35,11 +37,8 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A base class for {@link Extent}s that merely passes extents onto another.
|
||||
*/
|
||||
@ -79,7 +78,7 @@ public class AbstractDelegateExtent implements Extent, LightingExtent {
|
||||
if (!(extent instanceof ForgetfulExtentBuffer)) { // placeholder
|
||||
extent.disableQueue();
|
||||
}
|
||||
} catch (FaweException disableQueue) {}
|
||||
} catch (FaweException ignored) {}
|
||||
if (extent instanceof AbstractDelegateExtent) {
|
||||
Extent next = ((AbstractDelegateExtent) extent).getExtent();
|
||||
new ExtentTraverser(this).setNext(next);
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package com.sk89q.worldedit.extent.clipboard;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard;
|
||||
import com.boydti.fawe.object.clipboard.FaweClipboard;
|
||||
import com.boydti.fawe.object.clipboard.FaweClipboard.ClipboardEntity;
|
||||
import com.boydti.fawe.object.clipboard.MemoryOptimizedClipboard;
|
||||
import com.boydti.fawe.object.extent.LightingExtent;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
@ -41,13 +40,12 @@ import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.Closeable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Stores block data as a multi-dimensional array of {@link BlockState}s and
|
||||
@ -55,7 +53,7 @@ import java.util.UUID;
|
||||
*/
|
||||
public class BlockArrayClipboard implements Clipboard, Closeable {
|
||||
|
||||
private Region region;
|
||||
private Region region;
|
||||
private BlockVector3 origin;
|
||||
public FaweClipboard IMP;
|
||||
private BlockVector3 size;
|
||||
@ -204,7 +202,7 @@ public class BlockArrayClipboard implements Clipboard, Closeable {
|
||||
int z = position.getBlockZ() - mz;
|
||||
return IMP.getBlock(x, y, z);
|
||||
}
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.extent.clipboard.io;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.clipboard.LazyClipboardHolder;
|
||||
@ -26,8 +28,6 @@ import com.boydti.fawe.object.clipboard.MultiClipboardHolder;
|
||||
import com.boydti.fawe.object.clipboard.URIClipboardHolder;
|
||||
import com.boydti.fawe.object.io.FastByteArrayOutputStream;
|
||||
import com.boydti.fawe.util.MainUtil;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Multimaps;
|
||||
@ -36,8 +36,6 @@ import com.google.common.io.Files;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -59,6 +57,7 @@ import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ClipboardFormats {
|
||||
|
||||
@ -130,15 +129,15 @@ public class ClipboardFormats {
|
||||
*/
|
||||
@Nullable
|
||||
public static ClipboardFormat findByExtension(String extension) {
|
||||
checkNotNull(extension);
|
||||
checkNotNull(extension);
|
||||
|
||||
Collection<Entry<String, ClipboardFormat>> entries = getFileExtensionMap().entries();
|
||||
for(Map.Entry<String, ClipboardFormat> entry : entries) {
|
||||
if(entry.getKey().equalsIgnoreCase(extension)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
Collection<Entry<String, ClipboardFormat>> entries = getFileExtensionMap().entries();
|
||||
for(Map.Entry<String, ClipboardFormat> entry : entries) {
|
||||
if(entry.getKey().equalsIgnoreCase(extension)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class BlockReplace implements RegionFunction {
|
||||
|
||||
@Override
|
||||
public boolean apply(BlockVector3 position) throws WorldEditException {
|
||||
return pattern.apply(extent, position, position);
|
||||
return pattern.apply(extent, position, position);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,9 +9,7 @@ import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class BackwardsExtentBlockCopy implements Operation {
|
||||
private final Region region;
|
||||
@ -34,7 +32,7 @@ public class BackwardsExtentBlockCopy implements Operation {
|
||||
CuboidRegion destRegion = transform(this.transform, this.region);
|
||||
Transform inverse = this.transform.inverse();
|
||||
for (BlockVector3 pt : destRegion) {
|
||||
BlockVector3 copyFrom = transform(inverse, pt);
|
||||
BlockVector3 copyFrom = transform(inverse, pt);
|
||||
if (region.contains(copyFrom)) {
|
||||
function.apply(pt);
|
||||
}
|
||||
@ -43,14 +41,14 @@ public class BackwardsExtentBlockCopy implements Operation {
|
||||
}
|
||||
|
||||
private CuboidRegion transform(Transform transform, Region region) {
|
||||
BlockVector3 min = BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
BlockVector3 max = BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
|
||||
BlockVector3 pos1 = region.getMinimumPoint();
|
||||
BlockVector3 pos2 = region.getMaximumPoint();
|
||||
BlockVector3 min = BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
BlockVector3 max = BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
|
||||
BlockVector3 pos1 = region.getMinimumPoint();
|
||||
BlockVector3 pos2 = region.getMaximumPoint();
|
||||
for (int x : new int[] { pos1.getBlockX(), pos2.getBlockX() }) {
|
||||
for (int y : new int[] { pos1.getBlockY(), pos2.getBlockY() }) {
|
||||
for (int z : new int[] { pos1.getBlockZ(), pos2.getBlockZ() }) {
|
||||
BlockVector3 pt = transform(transform, BlockVector3.at(x, y, z));
|
||||
BlockVector3 pt = transform(transform, BlockVector3.at(x, y, z));
|
||||
min = min.getMinimum(pt);
|
||||
max = max.getMaximum(pt);
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ package com.sk89q.worldedit.function.visitor;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.example.MappedIQueueExtent;
|
||||
import com.boydti.fawe.object.collection.BlockVectorSet;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
@ -37,8 +36,6 @@ import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Performs a breadth-first search starting from points added with
|
||||
* {@link #visit(BlockVector3)}. The search continues
|
||||
@ -67,7 +64,7 @@ public abstract class BreadthFirstSearch implements Operation {
|
||||
for (int y = -1; y <= 1; y++) {
|
||||
for (int z = -1; z <= 1; z++) {
|
||||
if (x != 0 || y != 0 || z != 0) {
|
||||
BlockVector3 pos = BlockVector3.at(x, y, z);
|
||||
BlockVector3 pos = BlockVector3.at(x, y, z);
|
||||
if (!list.contains(pos)) {
|
||||
list.add(pos);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class HeightMap {
|
||||
invalid = new boolean[data.length];
|
||||
|
||||
if (layers) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
int bx = min.getBlockX();
|
||||
int bz = min.getBlockZ();
|
||||
Iterable<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion();
|
||||
|
@ -52,21 +52,21 @@ public final class IncendoPaste implements Paster{
|
||||
this.pasteApplication = pasteApplication;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Callable<URL> paste(String content) {
|
||||
return new PasteTask(content);
|
||||
}
|
||||
@Override
|
||||
public Callable<URL> paste(String content) {
|
||||
return new PasteTask(content);
|
||||
}
|
||||
|
||||
private final class PasteTask implements Callable<URL>{
|
||||
private final class PasteTask implements Callable<URL>{
|
||||
|
||||
private PasteTask(String content) {}
|
||||
private PasteTask(String content) {}
|
||||
|
||||
@Override
|
||||
public URL call() throws Exception {
|
||||
return new URL(debugPaste());
|
||||
}
|
||||
@Override
|
||||
public URL call() throws Exception {
|
||||
return new URL(debugPaste());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an immutable collection containing all the files that have been added to this paster
|
||||
|
@ -20,22 +20,21 @@
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.TileEntityBlock;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.ABlockMask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.registry.state.PropertyKey;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a "snapshot" of a block with NBT Data.
|
||||
@ -71,7 +70,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
* @param blockState The blockstate
|
||||
*/
|
||||
public BaseBlock(BlockState blockState) {
|
||||
this.blockState = blockState;
|
||||
this.blockState = blockState;
|
||||
nbtData = null;
|
||||
}
|
||||
|
||||
@ -244,31 +243,31 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
set.setFullBlock(extent, this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock withPropertyId(int propertyId) {
|
||||
return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData());
|
||||
}
|
||||
@Override
|
||||
public BaseBlock withPropertyId(int propertyId) {
|
||||
return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalBlockTypeId() {
|
||||
return toImmutableState().getInternalBlockTypeId();
|
||||
}
|
||||
@Override
|
||||
public int getInternalBlockTypeId() {
|
||||
return toImmutableState().getInternalBlockTypeId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalPropertiesId() {
|
||||
return toImmutableState().getInternalPropertiesId();
|
||||
}
|
||||
@Override
|
||||
public int getInternalPropertiesId() {
|
||||
return toImmutableState().getInternalPropertiesId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> BaseBlock with(PropertyKey property, V value) {
|
||||
return toImmutableState().with(property, value).toBaseBlock(getNbtData());
|
||||
}
|
||||
@Override
|
||||
public <V> BaseBlock with(PropertyKey property, V value) {
|
||||
return toImmutableState().with(property, value).toBaseBlock(getNbtData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock toBaseBlock(CompoundTag compoundTag) {
|
||||
|
@ -338,13 +338,13 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
|
||||
return new BaseBlock(this, compoundTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalId() {
|
||||
return internalId;
|
||||
}
|
||||
@Override
|
||||
public int getInternalId() {
|
||||
return internalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockMaterial getMaterial() {
|
||||
@Override
|
||||
public BlockMaterial getMaterial() {
|
||||
if (this.material == null) {
|
||||
if (blockType == BlockTypes.__RESERVED__) {
|
||||
return this.material = blockType.getMaterial();
|
||||
@ -352,7 +352,7 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
|
||||
this.material = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this);
|
||||
}
|
||||
return material;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getOrdinal() {
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
@ -35,19 +36,16 @@ import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockType implements FawePattern, Keyed {
|
||||
private final String id;
|
||||
private final String id;
|
||||
private final BlockTypes.Settings settings;
|
||||
|
||||
private boolean initItemType;
|
||||
@ -61,7 +59,7 @@ public class BlockType implements FawePattern, Keyed {
|
||||
|
||||
@Deprecated
|
||||
public int getMaxStateId() {
|
||||
return settings.permutations;
|
||||
return settings.permutations;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -248,7 +246,7 @@ public class BlockType implements FawePattern, Keyed {
|
||||
* @return The material
|
||||
*/
|
||||
public BlockMaterial getMaterial() {
|
||||
return this.settings.blockMaterial;
|
||||
return this.settings.blockMaterial;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -272,7 +270,7 @@ public class BlockType implements FawePattern, Keyed {
|
||||
* @return internal id
|
||||
*/
|
||||
public int getInternalId() {
|
||||
return this.settings.internalId;
|
||||
return this.settings.internalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,14 +107,14 @@ public class ItemType implements RegistryItem, Keyed {
|
||||
}
|
||||
|
||||
public void setBlockType(BlockType blockType) {
|
||||
this.blockType = blockType;
|
||||
this.blockType = blockType;
|
||||
}
|
||||
|
||||
public BaseItem getDefaultState() {
|
||||
if (defaultState == null) {
|
||||
this.defaultState = new BaseItemStack(this);
|
||||
}
|
||||
return this.defaultState;
|
||||
return this.defaultState;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -245,26 +245,26 @@ public final class LegacyMapper {
|
||||
}
|
||||
|
||||
public BaseBlock getBaseBlockFromPlotBlock(PlotBlock plotBlock) {
|
||||
if(plotBlock instanceof StringPlotBlock) {
|
||||
try {
|
||||
return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock();
|
||||
} catch (Throwable failed) {
|
||||
log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!");
|
||||
failed.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}else if(plotBlock instanceof LegacyPlotBlock) {
|
||||
try {
|
||||
return BaseBlock.getState(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()).toBaseBlock();
|
||||
} catch (Throwable failed) {
|
||||
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
|
||||
failed.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}else {
|
||||
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
|
||||
return null;
|
||||
}
|
||||
if(plotBlock instanceof StringPlotBlock) {
|
||||
try {
|
||||
return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock();
|
||||
} catch (Throwable failed) {
|
||||
log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!");
|
||||
failed.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}else if(plotBlock instanceof LegacyPlotBlock) {
|
||||
try {
|
||||
return BaseBlock.getState(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()).toBaseBlock();
|
||||
} catch (Throwable failed) {
|
||||
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
|
||||
failed.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}else {
|
||||
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static LegacyMapper getInstance() {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren