fixed compile errors

This commit is contained in:
MattBDev 2020-03-20 21:39:40 -04:00
parent 45ac55185f
commit ae57dd5d61
4 changed files with 55 additions and 113 deletions

View File

@ -133,61 +133,6 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
return super.getBlock(position); 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 @Nullable
@Override @Override
public Entity createEntity(Location location, BaseEntity entity) { public Entity createEntity(Location location, BaseEntity entity) {

View File

@ -1,13 +1,12 @@
package com.boydti.fawe.object.extent; 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.Extent;
import com.sk89q.worldedit.extent.PassthroughExtent;
import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType; 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.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
@ -41,14 +40,6 @@ public class TemporalExtent extends PassthroughExtent {
this.biome = biome; 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 @Override
public BlockState getBlock(BlockVector3 position) { public BlockState getBlock(BlockVector3 position) {
if (position.getX() == x && position.getY() == y && position.getZ() == z) { if (position.getX() == x && position.getY() == y && position.getZ() == z) {

View File

@ -19,14 +19,20 @@
package com.sk89q.worldedit; 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.FaweCache;
import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.FaweLimit; import com.boydti.fawe.object.FaweLimit;
import com.boydti.fawe.object.RegionWrapper; import com.boydti.fawe.object.RegionWrapper;
import com.boydti.fawe.object.RunnableVal; 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.AbstractChangeSet;
import com.boydti.fawe.object.changeset.BlockBagChangeSet;
import com.boydti.fawe.object.collection.LocalBlockVectorSet; import com.boydti.fawe.object.collection.LocalBlockVectorSet;
import com.boydti.fawe.object.extent.FaweRegionExtent; import com.boydti.fawe.object.extent.FaweRegionExtent;
import com.boydti.fawe.object.extent.ProcessedWEExtent; 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.boydti.fawe.util.TaskManager;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.event.extent.EditSessionEvent; 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.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.ChangeSetExtent; import com.sk89q.worldedit.extent.ChangeSetExtent;
import com.sk89q.worldedit.extent.Extent; 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.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.registry.LegacyMapper; 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.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -139,14 +139,9 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.jetbrains.annotations.Nullable;
import static com.google.common.base.Preconditions.checkArgument; import org.slf4j.Logger;
import static com.google.common.base.Preconditions.checkNotNull; import org.slf4j.LoggerFactory;
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;
/** /**
* An {@link Extent} that handles history, {@link BlockBag}s, change limits, * 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 size = region.getMaximumPoint().subtract(region.getMinimumPoint()).add(1, 1, 1);
BlockVector3 to = region.getMinimumPoint(); BlockVector3 to = region.getMinimumPoint();
ForwardExtentCopy copy = new ForwardExtentCopy(this, region, this, to); ForwardExtentCopy copy = new ForwardExtentCopy(this, region, this, to);
copy.setCopyingEntities(copyEntities);
copy.setCopyingBiomes(copyBiomes);
copy.setRepetitions(count); copy.setRepetitions(count);
copy.setTransform(new AffineTransform().translate(dir.multiply(size))); copy.setTransform(new AffineTransform().translate(dir.multiply(size)));
copy.setCopyingEntities(copyEntities);
copy.setCopyingBiomes(copyBiomes);
mask = MaskIntersection.of(getSourceMask(), mask).optimize(); mask = MaskIntersection.of(getSourceMask(), mask).optimize();
if (mask != Masks.alwaysTrue()) { if (mask != Masks.alwaysTrue()) {
setSourceMask(null); setSourceMask(null);
@ -1486,8 +1481,20 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
return this.changes = copy.getAffected(); 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; Mask mask = null;
if (!copyAir) { if (!copyAir) {
mask = new ExistingBlockMask(this); mask = new ExistingBlockMask(this);
@ -2506,7 +2513,6 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
outer: for (BlockVector3 position : region) { outer: for (BlockVector3 position : region) {
for (BlockVector3 recurseDirection : recurseDirections) { for (BlockVector3 recurseDirection : recurseDirections) {
BlockVector3 neighbor = position.add(recurseDirection); BlockVector3 neighbor = position.add(recurseDirection);
if (outside.contains(neighbor)) { if (outside.contains(neighbor)) {
continue outer; continue outer;
} }

View File

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