Fix CFI generation

This commit is contained in:
Jesse Boyd 2019-11-08 22:30:39 +00:00
parent 26f073faa2
commit d61dac5aa5
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
10 changed files with 106 additions and 107 deletions

View File

@ -15,6 +15,7 @@ public class BlockMaterial_1_14 implements BlockMaterial {
private final Material material; private final Material material;
private final boolean isTranslucent; private final boolean isTranslucent;
private final CraftBlockData craftBlockData; private final CraftBlockData craftBlockData;
private final org.bukkit.Material craftMaterial;
public BlockMaterial_1_14(Block block) { public BlockMaterial_1_14(Block block) {
this(block, block.getBlockData()); this(block, block.getBlockData());
@ -25,6 +26,7 @@ public class BlockMaterial_1_14 implements BlockMaterial {
this.defaultState = defaultState; this.defaultState = defaultState;
this.material = defaultState.getMaterial(); this.material = defaultState.getMaterial();
this.craftBlockData = CraftBlockData.fromData(defaultState); this.craftBlockData = CraftBlockData.fromData(defaultState);
this.craftMaterial = craftBlockData.getMaterial();
this.isTranslucent = ReflectionUtil.getField(Block.class, block, "v"); this.isTranslucent = ReflectionUtil.getField(Block.class, block, "v");
} }
@ -51,7 +53,7 @@ public class BlockMaterial_1_14 implements BlockMaterial {
@Override @Override
public boolean isFullCube() { public boolean isFullCube() {
return defaultState.g(); return craftMaterial.isOccluding();
} }
@Override @Override

View File

@ -276,9 +276,6 @@ public class BukkitPlayer extends AbstractPlayerActor {
Player tmp = Bukkit.getPlayer(getUniqueId()); Player tmp = Bukkit.getPlayer(getUniqueId());
if (tmp != null) { if (tmp != null) {
player = tmp; player = tmp;
} else {
System.out.println("Invalid player " + player.getName());
new Exception().printStackTrace();
} }
} }
return player; return player;

View File

@ -156,7 +156,6 @@ public class CFICommands {
settings.setGenerator(generator).bind(); settings.setGenerator(generator).bind();
generator.setImageViewer(Fawe.imp().getImageViewer(player)); generator.setImageViewer(Fawe.imp().getImageViewer(player));
generator.update(); generator.update();
settings.bind();
mainMenu(player); mainMenu(player);
} }
@ -398,26 +397,26 @@ public class CFICommands {
public void paletteblocks(Player player, LocalSession session, @Arg(name = "arg", desc = "String", def = "") String argOpt) throws EmptyClipboardException, InputParseException, FileNotFoundException { public void paletteblocks(Player player, LocalSession session, @Arg(name = "arg", desc = "String", def = "") String argOpt) throws EmptyClipboardException, InputParseException, FileNotFoundException {
if (argOpt == null) { if (argOpt == null) {
TextComponent build = TextComponent.builder("What blocks do you want to color with?") TextComponent build = TextComponent.builder("What blocks do you want to color with?")
.append(newline()) .append(newline())
.append(TextComponent.of("[All]") .append(TextComponent.of("[All]")
.clickEvent(ClickEvent.runCommand("/cfi PaletteBlocks *"))) .clickEvent(ClickEvent.runCommand("/cfi PaletteBlocks *")))
.append(" - All available blocks") .append(" - All available blocks")
.append(newline()) .append(newline())
.append(TextComponent.of("[Clipboard]") .append(TextComponent.of("[Clipboard]")
.clickEvent(ClickEvent.runCommand("/cfi PaletteBlocks #clipboard"))) .clickEvent(ClickEvent.runCommand("/cfi PaletteBlocks #clipboard")))
.append(" - The blocks in your clipboard") .append(" - The blocks in your clipboard")
.append(newline()) .append(newline())
.append(TextComponent.of("[List]") .append(TextComponent.of("[List]")
.clickEvent(ClickEvent.runCommand("/cfi PaletteBlocks stone,gravel"))) .clickEvent(ClickEvent.runCommand("/cfi PaletteBlocks stone,gravel")))
.append(" - A comma separated list of blocks") .append(" - A comma separated list of blocks")
.append(newline()) .append(newline())
.append(TextComponent.of("[Complexity]") .append(TextComponent.of("[Complexity]")
.clickEvent(ClickEvent.runCommand("/cfi Complexity"))) .clickEvent(ClickEvent.runCommand("/cfi Complexity")))
.append(" - Block textures within a complexity range") .append(" - Block textures within a complexity range")
.append(newline()) .append(newline())
.append(TextComponent.of("< [Back]").clickEvent(ClickEvent .append(TextComponent.of("< [Back]").clickEvent(ClickEvent
.runCommand("/cfi coloring"))) .runCommand("/cfi coloring")))
.build(); .build();
player.print(build); player.print(build);
return; return;
} }
@ -881,19 +880,19 @@ public class CFICommands {
String s1 = "/cfi mask <mask>"; String s1 = "/cfi mask <mask>";
String s2 = "/cfi " + settings.getCategory(); String s2 = "/cfi " + settings.getCategory();
TextComponent build = TextComponent.builder(">> Current Settings <<") TextComponent build = TextComponent.builder(">> Current Settings <<")
.append(newline()) .append(newline())
.append("Image Mask ").append( .append("Image Mask ").append(
TextComponent.of("[" + settings.imageMaskArg + "]") TextComponent.of("[" + settings.imageMaskArg + "]")
.hoverEvent(HoverEvent.showText(TextComponent.of(s))) .hoverEvent(HoverEvent.showText(TextComponent.of(s)))
.clickEvent(ClickEvent.suggestCommand("/cfi mask http://"))) .clickEvent(ClickEvent.suggestCommand("/cfi mask http://")))
.append(newline()) .append(newline())
.append("WorldEdit Mask ").append(TextComponent.of("[" + settings.maskArg + "]") .append("WorldEdit Mask ").append(TextComponent.of("[" + settings.maskArg + "]")
.hoverEvent(HoverEvent.showText(TextComponent.of(s1))) .hoverEvent(HoverEvent.showText(TextComponent.of(s1)))
.clickEvent(ClickEvent.suggestCommand(s1))) .clickEvent(ClickEvent.suggestCommand(s1)))
.append(newline()) .append(newline())
.append( .append(
TextComponent.of("< [Back]").hoverEvent(HoverEvent.showText(TextComponent.of(s2))) TextComponent.of("< [Back]").hoverEvent(HoverEvent.showText(TextComponent.of(s2)))
.clickEvent(ClickEvent.runCommand(s2))).build(); .clickEvent(ClickEvent.runCommand(s2))).build();
player.print(build); player.print(build);
} }
@ -917,13 +916,13 @@ public class CFICommands {
String s = cmd + " stone"; String s = cmd + " stone";
String s1 = "/cfi " + settings.getCategory(); String s1 = "/cfi " + settings.getCategory();
TextComponent build = TextComponent.builder(">> Current Settings <<").append(newline()) TextComponent build = TextComponent.builder(">> Current Settings <<").append(newline())
.append("Pattern ").append(TextComponent.of("[Click Here]") .append("Pattern ").append(TextComponent.of("[Click Here]")
.hoverEvent(HoverEvent.showText(TextComponent.of(s))) .hoverEvent(HoverEvent.showText(TextComponent.of(s)))
.clickEvent(ClickEvent.suggestCommand(s))) .clickEvent(ClickEvent.suggestCommand(s)))
.append(newline()) .append(newline())
.append(TextComponent.of("< [Back]") .append(TextComponent.of("< [Back]")
.hoverEvent(HoverEvent.showText(TextComponent.of(s1))) .hoverEvent(HoverEvent.showText(TextComponent.of(s1)))
.clickEvent(ClickEvent.runCommand(s1))).build(); .clickEvent(ClickEvent.runCommand(s1))).build();
player.print(build); player.print(build);
} }
} }
@ -964,11 +963,11 @@ public class CFICommands {
if (image == null) { if (image == null) {
TextComponent build = TextComponent.builder("Please provide an image:") TextComponent build = TextComponent.builder("Please provide an image:")
.append(newline()) .append(newline())
.append("From a URL: ").append(TextComponent.of("[Click Here]").clickEvent(ClickEvent.suggestCommand("/cfi image http://"))) .append("From a URL: ").append(TextComponent.of("[Click Here]").clickEvent(ClickEvent.suggestCommand("/cfi image http://")))
.append(newline()) .append(newline())
.append("From a file: ").append(TextComponent.of("[Click Here]").clickEvent(ClickEvent.suggestCommand("/cfi image file://"))) .append("From a file: ").append(TextComponent.of("[Click Here]").clickEvent(ClickEvent.suggestCommand("/cfi image file://")))
.build(); .build();
player.print(build); player.print(build);
} else { } else {
if (settings.hasGenerator()) { if (settings.hasGenerator()) {
@ -989,12 +988,12 @@ public class CFICommands {
settings.popMessages(player); settings.popMessages(player);
settings.setCategory(this::populate); settings.setCategory(this::populate);
TextComponent build = TextComponent.builder("What would you like to populate?") TextComponent build = TextComponent.builder("What would you like to populate?")
.append(newline()) .append(newline())
.append("(You will need to type these commands)").append(newline()) .append("(You will need to type these commands)").append(newline())
//TODO .cmdOptions("/cfi ", "", "Ores", "Ore", "Caves", "Schematics", "Smooth") //TODO .cmdOptions("/cfi ", "", "Ores", "Ore", "Caves", "Schematics", "Smooth")
.append(newline()) .append(newline())
.append(TextComponent.of("< [Back]").clickEvent(ClickEvent.runCommand("/cfi"))) .append(TextComponent.of("< [Back]").clickEvent(ClickEvent.runCommand("/cfi")))
.build(); .build();
player.print(build); player.print(build);
} }
@ -1038,32 +1037,32 @@ public class CFICommands {
//TODO //TODO
@NotNull Builder msg = TextComponent.builder(">> Current Settings <<").append(newline()) @NotNull Builder msg = TextComponent.builder(">> Current Settings <<").append(newline())
.append("Mask ").append(TextComponent.of("[" + mask + "]") .append("Mask ").append(TextComponent.of("[" + mask + "]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi mask"))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi mask")))
.clickEvent(ClickEvent.runCommand("/cfi mask"))) .clickEvent(ClickEvent.runCommand("/cfi mask")))
.append(newline()) .append(newline())
.append("Pattern ").append(TextComponent.of("[" + pattern + "]") .append("Pattern ").append(TextComponent.of("[" + pattern + "]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi pattern"))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi pattern")))
.clickEvent(ClickEvent.runCommand("/cfi pattern"))) .clickEvent(ClickEvent.runCommand("/cfi pattern")))
.append(newline()) .append(newline())
.append(newline()) .append(newline())
.append(">> Components <<") .append(">> Components <<")
.append(newline()) .append(newline())
.append(TextComponent.of("[Height]") .append(TextComponent.of("[Height]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi height 120"))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi height 120")))
.clickEvent(ClickEvent.suggestCommand("/cfi height 120"))).append(" - Terrain height for whole map") .clickEvent(ClickEvent.suggestCommand("/cfi height 120"))).append(" - Terrain height for whole map")
.append(newline()) .append(newline())
.append(TextComponent.of("[WaterHeight]") .append(TextComponent.of("[WaterHeight]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi waterheight 60"))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi waterheight 60")))
.clickEvent(ClickEvent.suggestCommand("/cfi waterheight 60"))).append(" - Sea level for whole map") .clickEvent(ClickEvent.suggestCommand("/cfi waterheight 60"))).append(" - Sea level for whole map")
.append(newline()) .append(newline())
.append(TextComponent.of("[FloorThickness]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi floorthickness 60"))) .append(TextComponent.of("[FloorThickness]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi floorthickness 60")))
.clickEvent(ClickEvent.suggestCommand("/cfi floorthickness 60"))).append(" - Floor thickness of entire map") .clickEvent(ClickEvent.suggestCommand("/cfi floorthickness 60"))).append(" - Floor thickness of entire map")
.append(newline()) .append(newline())
.append(TextComponent.of("[WorldThickness]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi worldthickness 60"))) .append(TextComponent.of("[WorldThickness]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi worldthickness 60")))
.clickEvent(ClickEvent.suggestCommand("/cfi worldthickness 60"))).append(" - World thickness of entire map") .clickEvent(ClickEvent.suggestCommand("/cfi worldthickness 60"))).append(" - World thickness of entire map")
.append(newline()) .append(newline())
.append(TextComponent.of("[Snow]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi snow" + maskArgs))) .append(TextComponent.of("[Snow]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi snow" + maskArgs)))
.clickEvent(ClickEvent.suggestCommand("/cfi snow" + maskArgs))).append(" - Set snow in the masked areas") .clickEvent(ClickEvent.suggestCommand("/cfi snow" + maskArgs))).append(" - Set snow in the masked areas")
.append(newline()); .append(newline());
if (pattern != null) { if (pattern != null) {
@ -1080,27 +1079,27 @@ public class CFICommands {
msg msg
.append(TextComponent.of("[WaterId]") .append(TextComponent.of("[WaterId]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi waterId " + pattern))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi waterId " + pattern)))
.clickEvent(ClickEvent.runCommand("/cfi waterId " + pattern))) .clickEvent(ClickEvent.runCommand("/cfi waterId " + pattern)))
.append(" - Water id for whole map") .append(" - Water id for whole map")
.append(newline()) .append(newline())
.append(TextComponent.of("[BedrockId]") .append(TextComponent.of("[BedrockId]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi baseId " + pattern))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi baseId " + pattern)))
.clickEvent(ClickEvent.runCommand("/cfi baseId " + pattern))) .clickEvent(ClickEvent.runCommand("/cfi baseId " + pattern)))
.append(TextComponent.of(" - Bedrock id for whole map")) .append(TextComponent.of(" - Bedrock id for whole map"))
.append(newline()) .append(newline())
.append(TextComponent.of("[Floor]") .append(TextComponent.of("[Floor]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi floor " + compArgs))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi floor " + compArgs)))
.clickEvent(ClickEvent.runCommand("/cfi floor " + compArgs))) .clickEvent(ClickEvent.runCommand("/cfi floor " + compArgs)))
.append(TextComponent.of(" - Set the floor in the masked areas")).append(newline()) .append(TextComponent.of(" - Set the floor in the masked areas")).append(newline())
.append(TextComponent.of("[Main]") .append(TextComponent.of("[Main]")
.hoverEvent(HoverEvent.showText(TextComponent.of("/cfi main " + compArgs))) .hoverEvent(HoverEvent.showText(TextComponent.of("/cfi main " + compArgs)))
.clickEvent(ClickEvent.runCommand("/cfi main " + compArgs))) .clickEvent(ClickEvent.runCommand("/cfi main " + compArgs)))
.append(TextComponent.of(" - Set the main block in the masked areas")).append(newline()) .append(TextComponent.of(" - Set the main block in the masked areas")).append(newline())
.append(TextComponent.of("[Column]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi column" + compArgs))) .append(TextComponent.of("[Column]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi column" + compArgs)))
.clickEvent(ClickEvent.runCommand("/cfi column" + compArgs))).append(" - Set the columns in the masked areas").append(newline()) .clickEvent(ClickEvent.runCommand("/cfi column" + compArgs))).append(" - Set the columns in the masked areas").append(newline())
.append(TextComponent.of("[Overlay]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi overlay" + compArgs))) .append(TextComponent.of("[Overlay]").hoverEvent(HoverEvent.showText(TextComponent.of("/cfi overlay" + compArgs)))
.clickEvent(ClickEvent.runCommand("/cfi overlay" + compArgs))).append(" - Set the overlay in the masked areas").append(newline()); .clickEvent(ClickEvent.runCommand("/cfi overlay" + compArgs))).append(" - Set the overlay in the masked areas").append(newline());
} }
msg.append(newline()) msg.append(newline())
@ -1119,7 +1118,10 @@ public class CFICommands {
protected static CFISettings getSettings(Player player) { protected static CFISettings getSettings(Player player) {
CFISettings settings = player.getMeta("CFISettings"); CFISettings settings = player.getMeta("CFISettings");
return settings == null ? new CFISettings(player) : settings; if (settings == null) {
settings = new CFISettings(player);
}
return settings;
} }
public static class CFISettings { public static class CFISettings {
@ -1257,8 +1259,8 @@ public class CFICommands {
String option = options[i]; String option = options[i];
String cmd = prefix + option; String cmd = prefix + option;
producer.append(TextComponent.of(option, TextColor.GREEN) producer.append(TextComponent.of(option, TextColor.GREEN)
.clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND, cmd)) .clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND, cmd))
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of(option)))); .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of(option))));
} }
producer.newline(); producer.newline();
producer.newline().append(TextComponent.of("<> [View]", TextColor.DARK_AQUA) producer.newline().append(TextComponent.of("<> [View]", TextColor.DARK_AQUA)

View File

@ -36,8 +36,7 @@ public class PlotLoader {
() -> autoClaimFromDatabase(player, area, plot.getId(), whenDone)); () -> autoClaimFromDatabase(player, area, plot.getId(), whenDone));
} }
public void load(Actor actor, CFISettings settings, public void load(Actor actor, CFISettings settings, Function<File, Boolean> createTask) throws IOException {
Function<File, Boolean> createTask) throws IOException {
PlotAreaManager manager = PlotSquared.get().getPlotAreaManager(); PlotAreaManager manager = PlotSquared.get().getPlotAreaManager();
if (manager instanceof SinglePlotAreaManager) { if (manager instanceof SinglePlotAreaManager) {
SinglePlotAreaManager sManager = (SinglePlotAreaManager) manager; SinglePlotAreaManager sManager = (SinglePlotAreaManager) manager;

View File

@ -80,6 +80,8 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
protected final DifferentialArray<char[]> floor; protected final DifferentialArray<char[]> floor;
protected final DifferentialArray<char[]> main; protected final DifferentialArray<char[]> main;
protected DifferentialArray<char[]> overlay; protected DifferentialArray<char[]> overlay;
protected Metadatable metaData = new Metadatable();
protected TextureUtil textureUtil;
protected final CFIPrimitives primitives = new CFIPrimitives(); protected final CFIPrimitives primitives = new CFIPrimitives();
private CFIPrimitives oldPrimitives = new CFIPrimitives(); private CFIPrimitives oldPrimitives = new CFIPrimitives();
@ -115,10 +117,6 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
} }
} }
protected Metadatable metaData = new Metadatable();
protected TextureUtil textureUtil;
@Override @Override
public void flushChanges(FaweOutputStream out) throws IOException { public void flushChanges(FaweOutputStream out) throws IOException {
heights.flushChanges(out); heights.flushChanges(out);
@ -301,19 +299,17 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
for (int chunkZ = scz; chunkZ <= ecz; chunkZ++) { for (int chunkZ = scz; chunkZ <= ecz; chunkZ++) {
for (int chunkX = scx; chunkX <= ecx; chunkX++) { for (int chunkX = scx; chunkX <= ecx; chunkX++) {
refreshChunk(world, chunkX, chunkZ); refreshChunk(world, chunkX, chunkZ);
} }
} }
} }
} }
public void refreshChunk(World world, int chunkX, int chunkZ) { public void refreshChunk(World world, int chunkX, int chunkZ) {
Supplier<IBlocks> blocksSupplier = () -> getChunk(chunkX, chunkZ); Supplier<IBlocks> blocksSupplier = () -> getChunk(chunkX, chunkZ);
int realChunkX = chunkX + chunkOffset.getBlockX(); int realChunkX = chunkX + chunkOffset.getBlockX();
int realChunkZ = chunkZ + chunkOffset.getBlockZ(); int realChunkZ = chunkZ + chunkOffset.getBlockZ();
ChunkPacket packet = new ChunkPacket(realChunkX, realChunkZ, blocksSupplier, true); ChunkPacket packet = new ChunkPacket(realChunkX, realChunkZ, blocksSupplier, true);
world.sendFakeChunk(player, packet); world.sendFakeChunk(player, packet);
} }

View File

@ -18,6 +18,8 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArraySet; import it.unimi.dsi.fastutil.ints.IntArraySet;
import it.unimi.dsi.fastutil.longs.LongArrayList; import it.unimi.dsi.fastutil.longs.LongArrayList;
import java.awt.Color;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;

View File

@ -716,6 +716,9 @@ public class LocalSession implements TextureHolder {
VirtualWorld tmp; VirtualWorld tmp;
synchronized (dirty) { synchronized (dirty) {
tmp = this.virtual; tmp = this.virtual;
if (tmp == world) {
return;
}
this.virtual = world; this.virtual = world;
} }
if (tmp != null) { if (tmp != null) {

View File

@ -29,12 +29,14 @@ import static com.sk89q.worldedit.regions.Regions.asFlatRegion;
import static com.sk89q.worldedit.regions.Regions.maximumBlockY; import static com.sk89q.worldedit.regions.Regions.maximumBlockY;
import static com.sk89q.worldedit.regions.Regions.minimumBlockY; import static com.sk89q.worldedit.regions.Regions.minimumBlockY;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweAPI; import com.boydti.fawe.FaweAPI;
import com.boydti.fawe.FaweCache; import com.boydti.fawe.FaweCache;
import com.boydti.fawe.beta.implementation.processors.ChunkSendProcessor; import com.boydti.fawe.beta.implementation.processors.ChunkSendProcessor;
import com.boydti.fawe.beta.implementation.processors.NullProcessor; import com.boydti.fawe.beta.implementation.processors.NullProcessor;
import com.boydti.fawe.config.BBC; import com.boydti.fawe.config.BBC;
import com.boydti.fawe.object.FaweLimit; import com.boydti.fawe.object.FaweLimit;
import com.boydti.fawe.util.TextureUtil;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -79,11 +81,14 @@ import com.sk89q.worldedit.util.formatting.text.serializer.legacy.LegacyComponen
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
import java.awt.Color;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.Command;
import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.CommandContainer;
@ -150,13 +155,7 @@ public class RegionCommands {
) )
@CommandPermissions("worldedit.region.test") @CommandPermissions("worldedit.region.test")
@Logging(REGION) @Logging(REGION)
public void test(Player player, @Arg(desc = "hello there") String message) throws WorldEditException { public void test(Player player, @Arg(desc = "hello there")BlockType type) throws WorldEditException {
TextComponent test = LegacyComponentSerializer.legacy().deserialize(message, '&');
player.print(message);
player.print(test);
test = test.hoverEvent(HoverEvent.showText(TextComponent.of("Blah")));
player.print(test);
} }
@Command( @Command(

View File

@ -748,11 +748,9 @@ public final class PlatformCommandManager {
worldEdit.flushBlockBag(actor, editSession); worldEdit.flushBlockBag(actor, editSession);
} }
CFICommands.CFISettings cfi = actor.getMeta("CFISettings");
Optional<CFICommands.CFISettings> cfiOpt = context.injectedValue(Key.of(CFICommands.CFISettings.class)); if (cfi != null) {
if (cfiOpt.isPresent()) { HeightMapMCAGenerator gen = cfi.getGenerator();
CFICommands.CFISettings settings = cfiOpt.get();
HeightMapMCAGenerator gen = settings.getGenerator();
if (gen != null && gen.isModified()) { if (gen != null && gen.isModified()) {
try { try {
gen.update(); gen.update();

View File

@ -56,6 +56,7 @@ public class PlayerProxy extends AbstractPlayerActor {
} }
public PlayerProxy(Player basePlayer, Actor permActor, Actor cuiActor, World world) { public PlayerProxy(Player basePlayer, Actor permActor, Actor cuiActor, World world) {
super(basePlayer.getRawMeta());
checkNotNull(basePlayer); checkNotNull(basePlayer);
checkNotNull(permActor); checkNotNull(permActor);
checkNotNull(cuiActor); checkNotNull(cuiActor);