wip on FaweQueue

This commit is contained in:
Jesse Boyd
2019-07-19 06:49:29 +10:00
parent 1dcb18ae20
commit e86e4c9c53
91 changed files with 540 additions and 5951 deletions

View File

@ -183,7 +183,7 @@ public class HistoryCommands extends MethodCommands {
// TODO mask the regions bot / top to the bottom and top coord in the allowedRegions
// TODO: then mask the edit to the bot / top
// if (allowedRegions.length != 1 || !allowedRegions[0].isGlobal()) {
// finalQueue = new MaskedFaweQueue(SetQueue.IMP.getNewQueue(fp.getWorld(), true, false), allowedRegions);
// finalQueue = new MaskedIQueueExtent(SetQueue.IMP.getNewQueue(fp.getWorld(), true, false), allowedRegions);
// } else {
// finalQueue = SetQueue.IMP.getNewQueue(fp.getWorld(), true, false);
// }

View File

@ -35,10 +35,10 @@ import com.boydti.fawe.beta.filters.SetFilter;
import com.boydti.fawe.beta.implementation.QueueHandler;
import com.boydti.fawe.beta.filters.DistrFilter;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.example.NMSMappedFaweQueue;
import com.boydti.fawe.example.NMSMappedIQueueExtent;
import com.boydti.fawe.object.FaweLimit;
import com.boydti.fawe.object.FawePlayer;
import com.boydti.fawe.object.FaweQueue;
import com.boydti.fawe.beta.IQueueExtent;
import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.object.visitor.Fast2DIterator;
import com.boydti.fawe.util.MathMan;
@ -166,7 +166,7 @@ public class RegionCommands {
final int cz = loc.getBlockZ() >> 4;
selection = new CuboidRegion(BlockVector3.at(cx - 8, 0, cz - 8).multiply(16), BlockVector3.at(cx + 8, 0, cz + 8).multiply(16));
}
int count = FaweAPI.fixLighting(player.getWorld(), selection,null, FaweQueue.RelightMode.ALL);
int count = FaweAPI.fixLighting(player.getWorld(), selection,null, IQueueExtent.RelightMode.ALL);
BBC.LIGHTING_PROPOGATE_SELECTION.send(fp, count);
}
@ -178,7 +178,7 @@ public class RegionCommands {
public void getlighting(Player player) throws WorldEditException {
FawePlayer fp = FawePlayer.wrap(player);
final Location loc = player.getLocation();
FaweQueue queue = fp.getFaweQueue(false);
IQueueExtent queue = fp.getIQueueExtent(false);
fp.sendMessage("Light: " + queue.getEmmittedLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()) + " | " + queue.getSkyLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
}
@ -195,7 +195,7 @@ public class RegionCommands {
final int cz = player.getLocation().getBlockZ() >> 4;
selection = new CuboidRegion(BlockVector3.at(cx - 8, 0, cz - 8).multiply(16), BlockVector3.at(cx + 8, 0, cz + 8).multiply(16));
}
int count = FaweAPI.fixLighting(player.getWorld(), selection, null, FaweQueue.RelightMode.NONE);
int count = FaweAPI.fixLighting(player.getWorld(), selection, null, IQueueExtent.RelightMode.NONE);
BBC.UPDATED_LIGHTING_SELECTION.send(fp, count);
}
@ -225,7 +225,7 @@ public class RegionCommands {
@CommandPermissions("worldedit.light.set")
public void setlighting(Player player, @Selection Region region, @Range(min = 0, max = 15) int value) {
FawePlayer fp = FawePlayer.wrap(player);
final NMSMappedFaweQueue queue = (NMSMappedFaweQueue) fp.getFaweQueue(false);
final NMSMappedIQueueExtent queue = (NMSMappedIQueueExtent) fp.getIQueueExtent(false);
for (BlockVector3 pt : region) {
queue.setBlockLight(pt.getX(), pt.getY(), pt.getZ(), value);
}
@ -244,7 +244,7 @@ public class RegionCommands {
@CommandPermissions("worldedit.light.set")
public void setskylighting(Player player, @Selection Region region, @Range(min = 0, max = 15) int value) {
FawePlayer fp = FawePlayer.wrap(player);
final NMSMappedFaweQueue queue = (NMSMappedFaweQueue) fp.getFaweQueue(false);
final NMSMappedIQueueExtent queue = (NMSMappedIQueueExtent) fp.getIQueueExtent(false);
for (BlockVector3 pt : region) {
queue.setSkyLight(pt.getX(), pt.getY(), pt.getZ(), value);
}

View File

@ -21,7 +21,7 @@ package com.sk89q.worldedit.command.composition;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.object.FaweChunk;
import com.boydti.fawe.object.FaweQueue;
import com.boydti.fawe.beta.IQueueExtent;
import com.boydti.fawe.object.RegionWrapper;
import com.boydti.fawe.object.RunnableVal;
import com.boydti.fawe.object.extent.FaweRegionExtent;
@ -111,7 +111,7 @@ public class SelectionCommand extends SimpleCommand<Operation> {
Pattern pattern = (Pattern) field.get(replace);
if (pattern instanceof BlockStateHolder) {
BlockStateHolder block = ((BlockStateHolder) pattern);
final FaweQueue queue = editSession.getQueue();
final IQueueExtent queue = editSession.getQueue();
final int minY = cuboid.getMinimumY();
final int maxY = cuboid.getMaximumY();