3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-09-16 13:01:24 +02:00

fixed compile errors

Dieser Commit ist enthalten in:
MattBDev 2020-03-20 21:39:40 -04:00
Ursprung 45ac55185f
Commit ae57dd5d61
4 geänderte Dateien mit 55 neuen und 113 gelöschten Zeilen

Datei anzeigen

@ -133,61 +133,6 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
return super.getBlock(position);
}
@Override
public int getBlockLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.OUTSIDE_REGION);
}
return 0;
}
return super.getBlockLight(x, y, z);
}
@Override
public int getBrightness(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.OUTSIDE_REGION);
}
return 0;
}
return super.getBrightness(x, y, z);
}
@Override
public int getLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.OUTSIDE_REGION);
}
return 0;
}
return super.getLight(x, y, z);
}
@Override
public int getOpacity(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.OUTSIDE_REGION);
}
return 0;
}
return super.getOpacity(x, y, z);
}
@Override
public int getSkyLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweCache.OUTSIDE_REGION);
}
return 0;
}
return super.getSkyLight(x, y, z);
}
@Nullable
@Override
public Entity createEntity(Location location, BaseEntity entity) {

Datei anzeigen

@ -1,13 +1,12 @@
package com.boydti.fawe.object.extent;
import com.sk89q.worldedit.extent.PassthroughExtent;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.PassthroughExtent;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
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 com.sk89q.worldedit.world.block.BlockTypes;
@ -41,14 +40,6 @@ public class TemporalExtent extends PassthroughExtent {
this.biome = biome;
}
@Override
public int getBrightness(int x, int y, int z) {
if (this.x == x && this.y == y && this.z == z) {
return Math.min(15, block.getBlockType().getMaterial().getLightValue());
}
return super.getBrightness(x, y, z);
}
@Override
public BlockState getBlock(BlockVector3 position) {
if (position.getX() == x && position.getY() == y && position.getZ() == z) {

Datei anzeigen

@ -19,14 +19,20 @@
package com.sk89q.worldedit;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.sk89q.worldedit.regions.Regions.asFlatRegion;
import static com.sk89q.worldedit.regions.Regions.maximumBlockY;
import static com.sk89q.worldedit.regions.Regions.minimumBlockY;
import com.boydti.fawe.FaweCache;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.FaweLimit;
import com.boydti.fawe.object.RegionWrapper;
import com.boydti.fawe.object.RunnableVal;
import com.boydti.fawe.object.changeset.BlockBagChangeSet;
import com.boydti.fawe.object.changeset.AbstractChangeSet;
import com.boydti.fawe.object.changeset.BlockBagChangeSet;
import com.boydti.fawe.object.collection.LocalBlockVectorSet;
import com.boydti.fawe.object.extent.FaweRegionExtent;
import com.boydti.fawe.object.extent.ProcessedWEExtent;
@ -42,8 +48,6 @@ import com.boydti.fawe.util.MathMan;
import com.boydti.fawe.util.TaskManager;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Watchdog;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.ChangeSetExtent;
import com.sk89q.worldedit.extent.Extent;
@ -126,10 +130,6 @@ 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.registry.LegacyMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
@ -139,14 +139,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.sk89q.worldedit.regions.Regions.asFlatRegion;
import static com.sk89q.worldedit.regions.Regions.maximumBlockY;
import static com.sk89q.worldedit.regions.Regions.minimumBlockY;
import org.jetbrains.annotations.Range;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An {@link Extent} that handles history, {@link BlockBag}s, change limits,
@ -1473,10 +1468,10 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
BlockVector3 size = region.getMaximumPoint().subtract(region.getMinimumPoint()).add(1, 1, 1);
BlockVector3 to = region.getMinimumPoint();
ForwardExtentCopy copy = new ForwardExtentCopy(this, region, this, to);
copy.setCopyingEntities(copyEntities);
copy.setCopyingBiomes(copyBiomes);
copy.setRepetitions(count);
copy.setTransform(new AffineTransform().translate(dir.multiply(size)));
copy.setCopyingEntities(copyEntities);
copy.setCopyingBiomes(copyBiomes);
mask = MaskIntersection.of(getSourceMask(), mask).optimize();
if (mask != Masks.alwaysTrue()) {
setSourceMask(null);
@ -1486,8 +1481,20 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
return this.changes = copy.getAffected();
}
public int moveRegion(Region region, BlockVector3 dir, int distance, boolean copyAir,
boolean moveEntities, boolean copyBiomes, Pattern replacement) throws MaxChangedBlocksException {
/**
* Move the blocks in a region a certain direction.
*
* @param region the region to move
* @param dir the direction
* @param distance the distance to move
* @param copyAir true to copy air blocks
* @param moveEntities true to move entities
* @param copyBiomes true to copy biomes
* @param replacement the replacement pattern to fill in after moving, or null to use air
* @return number of blocks moved
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
public int moveRegion(Region region, BlockVector3 dir, int distance, boolean copyAir, boolean moveEntities, boolean copyBiomes, Pattern replacement) throws MaxChangedBlocksException {
Mask mask = null;
if (!copyAir) {
mask = new ExistingBlockMask(this);
@ -2506,7 +2513,6 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
outer: for (BlockVector3 position : region) {
for (BlockVector3 recurseDirection : recurseDirections) {
BlockVector3 neighbor = position.add(recurseDirection);
if (outside.contains(neighbor)) {
continue outer;
}

Datei anzeigen

@ -151,25 +151,25 @@ public class RegionCommands {
// player.print(Caption.of("fawe.info.lighting.propagate.selection" , count));
}
@Command(
name = "/getlighting",
desc = "Get the light at a position"
)
@CommandPermissions("worldedit.light.fix")
public void getLighting(Player player, EditSession editSession) throws WorldEditException {
final Location loc = player.getLocation();
int block = editSession.getBlockLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
int sky = editSession.getSkyLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
player.print(TextComponent.of("Light: " + block + " | " + sky));
}
// @Command(
// name = "/getlighting",
// desc = "Get the light at a position"
// )
// @CommandPermissions("worldedit.light.fix")
// public void getLighting(Player player, EditSession editSession) throws WorldEditException {
// final Location loc = player.getLocation();
// int block = editSession.getBlockLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
// int sky = editSession.getSkyLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
// player.print(TextComponent.of("Light: " + block + " | " + sky));
// }
@Command(
name = "/removelighting",
desc = "Removing lighting in a selection"
)
@CommandPermissions("worldedit.light.remove")
public void removeLighting(Player player) {
player.print(TextComponent.of("Temporarily not working"));
// @Command(
// name = "/removelighting",
// desc = "Removing lighting in a selection"
// )
// @CommandPermissions("worldedit.light.remove")
// public void removeLighting(Player player) {
// player.print(TextComponent.of("Temporarily not working"));
// Region selection = player.getSelection();
// if (selection == null) {
// final int cx = player.getLocation().getBlockX() >> 4;
@ -178,7 +178,7 @@ public class RegionCommands {
// }
// int count = FaweAPI.fixLighting(player.getWorld(), selection, null);
// player.print(Caption.of("fawe.info.updated.lighting.selection" , count));
}
// }
@Command(
name = "/nbtinfo",