mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Various
fake chunk packet aliases cfi wip
This commit is contained in:
@ -31,6 +31,8 @@ import static com.sk89q.worldedit.regions.Regions.minimumBlockY;
|
||||
|
||||
import com.boydti.fawe.FaweAPI;
|
||||
import com.boydti.fawe.FaweCache;
|
||||
import com.boydti.fawe.beta.implementation.ChunkSendProcessor;
|
||||
import com.boydti.fawe.beta.implementation.NullProcessor;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.FaweLimit;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
@ -74,8 +76,13 @@ import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
@ -102,15 +109,29 @@ public class RegionCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "/set",
|
||||
desc = "Sets all the blocks in the region"
|
||||
name = "/air",
|
||||
aliases = {"/0"},
|
||||
desc = "Sets all the blocks in the region to air"
|
||||
)
|
||||
@CommandPermissions("worldedit.region.set")
|
||||
@Logging(REGION)
|
||||
public void air(Actor actor, EditSession editSession,
|
||||
@Selection Region region,
|
||||
InjectedValueAccess context) throws WorldEditException {
|
||||
set(actor, editSession, region, BlockTypes.AIR, context);
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "/set",
|
||||
aliases = {"/"},
|
||||
desc = "Sets all the blocks in the region"
|
||||
)
|
||||
@CommandPermissions("worldedit.region.set")
|
||||
@Logging(REGION)
|
||||
public void set(Actor actor, EditSession editSession,
|
||||
@Selection Region region,
|
||||
@Arg(desc = "The pattern of blocks to set")
|
||||
Pattern pattern, InjectedValueAccess context) throws WorldEditException {
|
||||
@Selection Region region,
|
||||
@Arg(desc = "The pattern of blocks to set")
|
||||
Pattern pattern, InjectedValueAccess context) throws WorldEditException {
|
||||
actor.checkConfirmationRegion(() -> {
|
||||
int affected = editSession.setBlocks(region, pattern);
|
||||
if (affected != 0) {
|
||||
@ -121,6 +142,22 @@ public class RegionCommands {
|
||||
}, getArguments(context), region, context);
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "/test",
|
||||
desc = "test region"
|
||||
)
|
||||
@CommandPermissions("worldedit.region.test")
|
||||
@Logging(REGION)
|
||||
public void test(World world, Player player, EditSession editSession,
|
||||
@Selection Region region,
|
||||
@Arg(desc = "The pattern of blocks to set")
|
||||
Pattern pattern, InjectedValueAccess context) throws WorldEditException {
|
||||
editSession.addProcessor(new ChunkSendProcessor(world, () -> Stream.of(player)));
|
||||
editSession.addProcessor(NullProcessor.INSTANCE);
|
||||
editSession.setBlocks(region, pattern);
|
||||
System.out.println("Done");
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "/fixlighting",
|
||||
desc = "Get the light at a position"
|
||||
@ -267,7 +304,7 @@ public class RegionCommands {
|
||||
|
||||
@Command(
|
||||
name = "/replace",
|
||||
aliases = { "/re", "/rep", "/r" },
|
||||
aliases = { "/repl", "/rep" },
|
||||
desc = "Replace all blocks in the selection with another"
|
||||
)
|
||||
@CommandPermissions("worldedit.region.replace")
|
||||
@ -459,6 +496,7 @@ public class RegionCommands {
|
||||
|
||||
@Command(
|
||||
name = "/move",
|
||||
aliases = {"/mv"},
|
||||
desc = "Move the contents of the selection"
|
||||
)
|
||||
@CommandPermissions("worldedit.region.move")
|
||||
|
Reference in New Issue
Block a user