From fa8139f4b3327c078344419293e0159d91626f3e Mon Sep 17 00:00:00 2001 From: wizjany Date: Fri, 5 Apr 2019 14:46:29 -0400 Subject: [PATCH 01/24] Transfer Request to evaluation thread for Expressions. --- .../worldedit/internal/expression/Expression.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java index 944fd97d8..0e82a4750 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java @@ -32,6 +32,7 @@ import com.sk89q.worldedit.internal.expression.runtime.Functions; import com.sk89q.worldedit.internal.expression.runtime.RValue; import com.sk89q.worldedit.internal.expression.runtime.ReturnException; import com.sk89q.worldedit.internal.expression.runtime.Variable; +import com.sk89q.worldedit.session.request.Request; import java.util.HashMap; import java.util.List; @@ -142,7 +143,18 @@ public class Expression { } private double evaluateRootTimed(int timeout) throws EvaluationException { - Future result = evalThread.submit(this::evaluateRoot); + Request request = Request.request(); + Future result = evalThread.submit(() -> { + Request local = Request.request(); + local.setSession(request.getSession()); + local.setWorld(request.getWorld()); + local.setEditSession(request.getEditSession()); + try { + return Expression.this.evaluateRoot(); + } finally { + Request.reset(); + } + }); try { return result.get(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { From dcfb769d96bc4524e098e7da11811d404d41c93c Mon Sep 17 00:00:00 2001 From: wizjany Date: Sat, 6 Apr 2019 13:22:20 -0400 Subject: [PATCH 02/24] Fix TrueZip region stores. I think. Someone tell me if this breaks their setup with truezip, but it works for me now and didn't before. I'm assuming people using .zip just used the normal zip store anyway. --- .../worldedit/world/storage/TrueZipMcRegionChunkStore.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java index a22818c77..8d7c03e93 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java @@ -93,11 +93,11 @@ public class TrueZipMcRegionChunkStore extends McRegionChunkStore { } else { Pattern pattern = Pattern.compile(".*\\.mc[ra]$"); // World pattern - Pattern worldPattern = Pattern.compile(worldName + "\\$"); + Pattern worldPattern = Pattern.compile(worldName + "[\\\\/].*"); for (Enumeration e = zip.entries(); e.hasMoreElements(); ) { ZipEntry testEntry = e.nextElement(); // Check for world - if (worldPattern.matcher(worldName).matches()) { + if (worldPattern.matcher(testEntry.getName()).matches()) { // Check for file if (pattern.matcher(testEntry.getName()).matches()) { folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf('/')); From ec0422d682b8e5fb4e223358102e40d1e6b06b07 Mon Sep 17 00:00:00 2001 From: wizjany Date: Sat, 6 Apr 2019 21:26:52 -0400 Subject: [PATCH 03/24] Avoid atan2 in Location cinit. @kashike --- .../src/main/java/com/sk89q/worldedit/util/Location.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java index ea161111b..0fa58a71f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java @@ -48,7 +48,7 @@ public class Location { * @param extent the extent */ public Location(Extent extent) { - this(extent, Vector3.ZERO, Vector3.ZERO); + this(extent, Vector3.ZERO, 0f, 90f); } /** @@ -61,7 +61,7 @@ public class Location { * @param z the Z coordinate */ public Location(Extent extent, double x, double y, double z) { - this(extent, Vector3.at(x, y, z), Vector3.ZERO); + this(extent, Vector3.at(x, y, z), 0f, 90f); } /** @@ -72,7 +72,7 @@ public class Location { * @param position the position vector */ public Location(Extent extent, Vector3 position) { - this(extent, position, Vector3.ZERO); + this(extent, position, 0f, 90f); } /** From b5e1f3dbc30db4f3fc9e59e5178589ac3332bf5d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 11 Apr 2019 12:39:56 +1000 Subject: [PATCH 04/24] Remove the system property check for uuidOverride (#459) as it caused a server timeout... https://pastebin.com/z5ktU8r3 --- .../java/com/sk89q/worldedit/session/SessionManager.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java index 138c5f5df..e393fe115 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java @@ -243,12 +243,7 @@ public class SessionManager { * @return the key object */ protected UUID getKey(SessionKey key) { - String forcedKey = System.getProperty("worldedit.session.uuidOverride"); - if (forcedKey != null) { - return UUID.fromString(forcedKey); - } else { - return key.getUniqueId(); - } + return key.getUniqueId(); } /** From 3e4004ad9e3376c4a30ab7d53a29eb4a4228cb54 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 14 Apr 2019 19:33:44 +1000 Subject: [PATCH 05/24] Start work on improving the formatting system. May switch to Kashike's as Bukkit is shit --- .../worldedit/bukkit/BukkitCommandSender.java | 7 ++ .../sk89q/worldedit/bukkit/BukkitPlayer.java | 7 ++ .../worldedit/extension/platform/Actor.java | 8 ++ .../extension/platform/PlayerProxy.java | 6 ++ .../util/formatting/ColorCodeBuilder.java | 3 + .../worldedit/util/formatting/Fragment.java | 31 +++++++- .../worldedit/util/formatting/Style.java | 4 +- .../worldedit/util/formatting/StyleSet.java | 75 ++++++++++++++++++- .../util/formatting/StyledFragment.java | 31 +------- .../util/formatting/component/Error.java | 37 +++++++++ 10 files changed, 173 insertions(+), 36 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java index 55929af02..7f48b193d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java @@ -26,6 +26,7 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.auth.AuthorizationException; +import com.sk89q.worldedit.util.formatting.Fragment; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -91,6 +92,12 @@ public class BukkitCommandSender implements Actor { } } + @Override + public void print(Fragment fragment) { + // TODO Bukkit is bad and the API is somewhat lacking + printRaw(fragment.toString()); + } + @Override public boolean canDestroyBedrock() { return true; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index d814cc7ba..8ef240f2c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -31,6 +31,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; +import com.sk89q.worldedit.util.formatting.Fragment; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; @@ -125,6 +126,12 @@ public class BukkitPlayer extends AbstractPlayerActor { } } + @Override + public void print(Fragment fragment) { + // TODO Bukkit is bad and the API is somewhat lacking + printRaw(fragment.toString()); + } + @Override public void setPosition(Vector3 pos, float pitch, float yaw) { player.teleport(new Location(player.getWorld(), pos.getX(), pos.getY(), diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java index cf64b5974..c5fb1b6b1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.auth.Subject; +import com.sk89q.worldedit.util.formatting.Fragment; import java.io.File; @@ -75,6 +76,13 @@ public interface Actor extends Identifiable, SessionOwner, Subject { */ void printError(String msg); + /** + * Print a {@link Fragment}. + * + * @param fragment The fragment to print + */ + void print(Fragment fragment); + /** * Returns true if the actor can destroy bedrock. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 48173abbc..54700aeea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -31,6 +31,7 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.formatting.Fragment; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.gamemode.GameMode; @@ -132,6 +133,11 @@ class PlayerProxy extends AbstractPlayerActor { basePlayer.printError(msg); } + @Override + public void print(Fragment fragment) { + basePlayer.print(fragment); + } + @Override public String[] getGroups() { return permActor.getGroups(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java index dbaa904ce..14e8ddbca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java @@ -90,6 +90,9 @@ public class ColorCodeBuilder { if (style.isStrikethrough()) { builder.append(Style.STRIKETHROUGH); } + if (style.isObfuscated()) { + builder.append(Style.OBFUSCATED); + } return builder.toString(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java index 3d1add7f4..e49d7c678 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java @@ -19,16 +19,45 @@ package com.sk89q.worldedit.util.formatting; +import java.util.ArrayList; +import java.util.List; + /** * A fragment of text. */ public class Fragment { private final StringBuilder builder = new StringBuilder(); - + private final List children = new ArrayList<>(); + private Fragment lastText; + Fragment() { } + public List getChildren() { + return children; + } + + protected Fragment lastText() { + Fragment text; + if (!children.isEmpty()) { + text = children.get(children.size() - 1); + if (text == lastText) { + return text; + } + } + + text = new Fragment(); + this.lastText = text; + children.add(text); + return text; + } + + public Fragment append(Fragment fragment) { + children.add(fragment); + return this; + } + public Fragment append(String str) { builder.append(Style.stripColor(str)); return this; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java index d6c70eeb8..d81774009 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java @@ -29,8 +29,6 @@ import java.util.regex.Pattern; /** * All supported color values for chat. - * - *

From Bukkit.

*/ public enum Style { /** @@ -100,7 +98,7 @@ public enum Style { /** * Represents magical characters that change around randomly */ - RANDOMIZE('k', 0x10, true), + OBFUSCATED('k', 0x10, true), /** * Makes the text bold. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java index 408dc1e43..2a1c0cf46 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.formatting; +import java.util.Objects; + /** * Represents set of styles, such as color, bold, etc. */ @@ -28,6 +30,8 @@ public class StyleSet { private Boolean italic; private Boolean underline; private Boolean strikethrough; + private Boolean obfuscated; + private String insertion; private Style color; /** @@ -55,6 +59,8 @@ public class StyleSet { underline = true; } else if (style == Style.STRIKETHROUGH) { strikethrough = true; + } else if (style == Style.OBFUSCATED) { + obfuscated = true; } } } @@ -167,6 +173,60 @@ public class StyleSet { this.strikethrough = strikethrough; } + /** + * Get whether this style set is obfuscated. + * + * @return true, false, or null if unset + */ + public Boolean getObfuscated() { + return obfuscated; + } + + /** + * Get whether this style set is obfuscated. + * + * @return true if there is obfuscation applied + */ + public boolean isObfuscated() { + return getObfuscated() != null && getObfuscated(); + } + + /** + * Set whether the text is obfuscated. + * + * @param obfuscated false, or null to unset + */ + public void setObfuscated(Boolean obfuscated) { + this.obfuscated = obfuscated; + } + + /** + * Get this style set's insertion, if present. + * + * @return the insertion, or null if unset + */ + public String getInsertion() { + return insertion; + } + + /** + * Get whether this style set has an insertion. + * + * @return true if there is an insertion + */ + public boolean hasInsertion() { + return insertion != null; + } + + /** + * Set the style set's insertion. + * + * @param insertion the insertion, or null to unset + */ + public void setInsertion(String insertion) { + this.insertion = insertion; + } + /** * Get the color of the text. * @@ -192,7 +252,8 @@ public class StyleSet { */ public boolean hasFormatting() { return getBold() != null || getItalic() != null - || getUnderline() != null || getStrikethrough() != null; + || getUnderline() != null || getStrikethrough() != null + || getObfuscated() != null || getInsertion() != null; } /** @@ -205,7 +266,9 @@ public class StyleSet { public boolean hasEqualFormatting(StyleSet other) { return getBold() == other.getBold() && getItalic() == other.getItalic() && getUnderline() == other.getUnderline() && - getStrikethrough() == other.getStrikethrough(); + getStrikethrough() == other.getStrikethrough() && + getObfuscated() == other.getObfuscated() && + Objects.equals(getInsertion(), other.getInsertion()); } /** @@ -229,6 +292,12 @@ public class StyleSet { if (style.getStrikethrough() != null) { newStyle.setStrikethrough(style.getStrikethrough()); } + if (style.getObfuscated() != null) { + newStyle.setObfuscated(style.getObfuscated()); + } + if (style.getInsertion() != null) { + newStyle.setInsertion(style.getInsertion()); + } if (style.getColor() != null) { newStyle.setColor(style.getColor()); } @@ -242,6 +311,8 @@ public class StyleSet { style.setItalic(getItalic()); style.setUnderline(getUnderline()); style.setStrikethrough(getStrikethrough()); + style.setObfuscated(getObfuscated()); + style.setInsertion(getInsertion()); style.setColor(getColor()); return style; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java index 9ef38446b..ec0578d47 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java @@ -19,18 +19,13 @@ package com.sk89q.worldedit.util.formatting; -import java.util.ArrayList; -import java.util.List; - /** * A fragment of text that can be styled. */ public class StyledFragment extends Fragment { - private final List children = new ArrayList<>(); private StyleSet style; - private Fragment lastText; - + public StyledFragment() { style = new StyleSet(); } @@ -51,36 +46,12 @@ public class StyledFragment extends Fragment { this.style = style; } - public List getChildren() { - return children; - } - - protected Fragment lastText() { - Fragment text; - if (!children.isEmpty()) { - text = children.get(children.size() - 1); - if (text == lastText) { - return text; - } - } - - text = new Fragment(); - this.lastText = text; - children.add(text); - return text; - } - public StyledFragment createFragment(Style... styles) { StyledFragment fragment = new StyledFragment(styles); append(fragment); return fragment; } - public StyledFragment append(StyledFragment fragment) { - children.add(fragment); - return this; - } - @Override public StyledFragment append(String str) { lastText().append(str); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java new file mode 100644 index 000000000..056c99c18 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java @@ -0,0 +1,37 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.util.formatting.component; + +import com.sk89q.worldedit.util.formatting.Style; +import com.sk89q.worldedit.util.formatting.StyledFragment; + +/** + * Represents a fragment representing an error. + */ +public class Error extends StyledFragment { + + /** + * Create a new instance. + */ + public Error() { + super(Style.RED); + } + +} From 2a1fdf470f9fd52a9c20b09e6c755ba9bd105491 Mon Sep 17 00:00:00 2001 From: wizjany Date: Sun, 14 Apr 2019 11:16:49 -0400 Subject: [PATCH 06/24] Implement getMaxY for ForgeWorld. Should play nicer with things like CubicChunks. Note that there is no way to get the min point in Minecraft itself, so this only supports going up, not down. --- .../src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 43a9399b9..5dbdc09f6 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -426,6 +426,11 @@ public class ForgeWorld extends AbstractWorld { } } + @Override + public int getMaxY() { + return getWorld().getHeight(); + } + @Override public BlockVector3 getSpawnPosition() { return ForgeAdapter.adapt(getWorld().getSpawnPoint()); From 99da55dc944524536065f3fd5b1dc5bb5275dd72 Mon Sep 17 00:00:00 2001 From: wizjany Date: Mon, 15 Apr 2019 20:44:02 -0400 Subject: [PATCH 07/24] Fix building above bounds. --- .../src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 5dbdc09f6..152b1ac7d 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -428,7 +428,7 @@ public class ForgeWorld extends AbstractWorld { @Override public int getMaxY() { - return getWorld().getHeight(); + return getWorld().getHeight() - 1; } @Override From 477e78bd17f3f6a12caffb2ac723f6a83e13584f Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Wed, 17 Apr 2019 00:15:05 -0700 Subject: [PATCH 08/24] [Forge] Update to latest forge for keyevent fixes --- worldedit-forge/build.gradle | 4 ++-- .../main/java/com/sk89q/worldedit/forge/KeyHandler.java | 6 ++---- .../java/com/sk89q/worldedit/forge/proxy/ServerProxy.java | 8 -------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index 8fe3fb9af..8569d8506 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -14,7 +14,7 @@ buildscript { apply plugin: 'net.minecraftforge.gradle' def minecraftVersion = "1.13.2" -def forgeVersion = "25.0.76" +def forgeVersion = "25.0.146" dependencies { compile project(':worldedit-core') @@ -29,7 +29,7 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 minecraft { - mappings channel: 'snapshot', version: '20190311-1.13.2' + mappings channel: 'snapshot', version: '20190415-1.13.2' runs { client = { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java index 06c59eb7f..bf18bd29f 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.forge.gui.GuiReferenceCard; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; +import net.minecraftforge.client.event.InputEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.client.registry.ClientRegistry; -import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent; import org.lwjgl.glfw.GLFW; public class KeyHandler { @@ -37,11 +37,9 @@ public class KeyHandler { } @SubscribeEvent - public void onKey(KeyInputEvent evt) { + public void onKey(InputEvent.KeyInputEvent evt) { if (mc.player != null && mc.world != null && mainKey.isPressed()) { mc.displayGuiScreen(new GuiReferenceCard()); - // TODO Seems GuiHandlers don't work on client right now -// NetworkHooks.openGui(mc.player, new ResourceLocationInteractionObject(ServerProxy.REFERENCE_GUI)); } } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/proxy/ServerProxy.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/proxy/ServerProxy.java index 9ec84e328..a3375aa6f 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/proxy/ServerProxy.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/proxy/ServerProxy.java @@ -25,16 +25,8 @@ import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.DEDICATED_SERVER) public class ServerProxy implements CommonProxy { -// public static ResourceLocation REFERENCE_GUI = new ResourceLocation("worldedit", "resource_gui"); - @Override public void registerHandlers() { -// ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.GUIFACTORY, () -> openContainer -> { -// if (openContainer.getId().equals(REFERENCE_GUI)) { -// return new GuiReferenceCard(); -// } -// return null; -// }); } } From 55348346e92a6ec548a70aed29084396f461054c Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 19 Apr 2019 14:49:29 +1000 Subject: [PATCH 09/24] Shade in Kashike's lib --- build.gradle | 3 +++ config/checkstyle/import-control.xml | 1 + worldedit-bukkit/build.gradle | 1 + .../com/sk89q/worldedit/bukkit/BukkitCommandSender.java | 8 ++++---- .../java/com/sk89q/worldedit/bukkit/BukkitPlayer.java | 9 ++++----- worldedit-core/build.gradle | 3 ++- .../com/sk89q/worldedit/extension/platform/Actor.java | 8 ++++---- .../sk89q/worldedit/extension/platform/PlayerProxy.java | 6 +++--- worldedit-forge/build.gradle | 1 + .../main/java/com/sk89q/worldedit/forge/ForgePlayer.java | 6 ++++++ worldedit-sponge/build.gradle | 1 + .../com/sk89q/worldedit/sponge/SpongeCommandSender.java | 7 +++++++ .../java/com/sk89q/worldedit/sponge/SpongePlayer.java | 7 +++++++ 13 files changed, 44 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 8bdb1a122..57570e2ff 100644 --- a/build.gradle +++ b/build.gradle @@ -142,6 +142,9 @@ subprojects { include(dependency('com.sk89q:jchronic:0.2.4a')) include(dependency('com.thoughtworks.paranamer:paranamer:2.6')) include(dependency('com.sk89q.lib:jlibnoise:1.0.0')) + relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting') { + include(dependency('net.kyori:text-api:2.0.0')) + } } exclude 'GradleStart**' exclude '.cache' diff --git a/config/checkstyle/import-control.xml b/config/checkstyle/import-control.xml index 28ccad1e4..b4a2f4808 100644 --- a/config/checkstyle/import-control.xml +++ b/config/checkstyle/import-control.xml @@ -16,6 +16,7 @@ + diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 335b96c0a..af7f00114 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -15,6 +15,7 @@ dependencies { compile 'org.bstats:bstats-bukkit:1.4' compile "io.papermc:paperlib:1.0.1" compile 'org.slf4j:slf4j-jdk14:1.7.26' + compile 'net.kyori:text-adapter-bukkit:1.0.3' testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java index 7f48b193d..21d08d726 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java @@ -26,7 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.auth.AuthorizationException; -import com.sk89q.worldedit.util.formatting.Fragment; +import net.kyori.text.TextComponent; +import net.kyori.text.adapter.bukkit.TextAdapter; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -93,9 +94,8 @@ public class BukkitCommandSender implements Actor { } @Override - public void print(Fragment fragment) { - // TODO Bukkit is bad and the API is somewhat lacking - printRaw(fragment.toString()); + public void print(TextComponent component) { + TextAdapter.sendComponent(sender, component); } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 8ef240f2c..ca15daa91 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -31,14 +31,14 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; -import com.sk89q.worldedit.util.formatting.Fragment; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; - +import net.kyori.text.TextComponent; +import net.kyori.text.adapter.bukkit.TextAdapter; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -127,9 +127,8 @@ public class BukkitPlayer extends AbstractPlayerActor { } @Override - public void print(Fragment fragment) { - // TODO Bukkit is bad and the API is somewhat lacking - printRaw(fragment.toString()); + public void print(TextComponent component) { + TextAdapter.sendComponent(player, component); } @Override diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index f91186083..e47c27f02 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -13,6 +13,7 @@ dependencies { compile 'com.sk89q.lib:jlibnoise:1.0.0' compile 'com.googlecode.json-simple:json-simple:1.1.1' compile 'org.slf4j:slf4j-api:1.7.26' + compile 'net.kyori:text-api:2.0.0' //compile 'net.sf.trove4j:trove4j:3.0.3' testCompile 'org.mockito:mockito-core:1.9.0-rc1' } @@ -29,4 +30,4 @@ sourceSets { } } -build.dependsOn(shadowJar) +build.dependsOn(shadowJar { classifier = null }) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java index c5fb1b6b1..86bae5934 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.auth.Subject; -import com.sk89q.worldedit.util.formatting.Fragment; +import net.kyori.text.TextComponent; import java.io.File; @@ -77,11 +77,11 @@ public interface Actor extends Identifiable, SessionOwner, Subject { void printError(String msg); /** - * Print a {@link Fragment}. + * Print a {@link TextComponent}. * - * @param fragment The fragment to print + * @param component The component to print */ - void print(Fragment fragment); + void print(TextComponent component); /** * Returns true if the actor can destroy bedrock. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 54700aeea..5211e1380 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -31,10 +31,10 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.util.formatting.Fragment; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.gamemode.GameMode; +import net.kyori.text.TextComponent; import java.util.UUID; @@ -134,8 +134,8 @@ class PlayerProxy extends AbstractPlayerActor { } @Override - public void print(Fragment fragment) { - basePlayer.print(fragment); + public void print(TextComponent component) { + basePlayer.print(component); } @Override diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index 8fe3fb9af..41c798310 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -19,6 +19,7 @@ def forgeVersion = "25.0.76" dependencies { compile project(':worldedit-core') compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.2' + compile 'net.kyori:text-serializer-gson:2.0.0' minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}" diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 5b3b2ca84..57734f43a 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -34,6 +34,7 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; +import net.kyori.text.TextComponent; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; @@ -141,6 +142,11 @@ public class ForgePlayer extends AbstractPlayerActor { sendColorized(msg, TextFormatting.RED); } + @Override + public void print(TextComponent component) { + // TODO + } + private void sendColorized(String msg, TextFormatting formatting) { for (String part : msg.split("\n")) { TextComponentString component = new TextComponentString(part); diff --git a/worldedit-sponge/build.gradle b/worldedit-sponge/build.gradle index 0ef1e5361..f65952c91 100644 --- a/worldedit-sponge/build.gradle +++ b/worldedit-sponge/build.gradle @@ -19,6 +19,7 @@ dependencies { compile project(':worldedit-core') compile 'org.spongepowered:spongeapi:7.1.0' compile 'org.bstats:bstats-sponge:1.4' + compile 'net.kyori:text-adapter-spongeapi:1.0.3' testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1' } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java index bf1ceb7bd..fe5c626a3 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java @@ -26,6 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.auth.AuthorizationException; +import net.kyori.text.TextComponent; +import net.kyori.text.adapter.spongeapi.TextAdapter; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.Text; @@ -89,6 +91,11 @@ public class SpongeCommandSender implements Actor { sendColorized(msg, TextColors.RED); } + @Override + public void print(TextComponent component) { + TextAdapter.sendComponent(sender, component); + } + private void sendColorized(String msg, TextColor formatting) { for (String part : msg.split("\n")) { sender.sendMessage(Text.of(formatting, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(part))); diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 3793ffb87..10b1f47e8 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -36,6 +36,8 @@ import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.item.ItemTypes; +import net.kyori.text.TextComponent; +import net.kyori.text.adapter.spongeapi.TextAdapter; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.entity.living.player.Player; @@ -149,6 +151,11 @@ public class SpongePlayer extends AbstractPlayerActor { sendColorized(msg, TextColors.RED); } + @Override + public void print(TextComponent component) { + TextAdapter.sendComponent(player, component); + } + private void sendColorized(String msg, TextColor formatting) { for (String part : msg.split("\n")) { this.player.sendMessage(Text.of(formatting, TextSerializers.FORMATTING_CODE.deserialize(part))); From d56cd962829b2a323ed05aad09bf145202d8403a Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 19 Apr 2019 16:38:33 +1000 Subject: [PATCH 10/24] Fixed builds --- build.gradle | 2 +- worldedit-core/build.gradle | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 57570e2ff..f31f5b6a8 100644 --- a/build.gradle +++ b/build.gradle @@ -142,7 +142,7 @@ subprojects { include(dependency('com.sk89q:jchronic:0.2.4a')) include(dependency('com.thoughtworks.paranamer:paranamer:2.6')) include(dependency('com.sk89q.lib:jlibnoise:1.0.0')) - relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting') { + relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text') { include(dependency('net.kyori:text-api:2.0.0')) } } diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index e47c27f02..a83565dfc 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -1,3 +1,5 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + apply plugin: 'eclipse' apply plugin: 'idea' @@ -30,4 +32,7 @@ sourceSets { } } -build.dependsOn(shadowJar { classifier = null }) +task jar(type: ShadowJar, overwrite: true) { + from sourceSets.main.output + configurations = [project.configurations.runtime] +} \ No newline at end of file From 5b1573a24ebff8d1e11ba3255336fdf4ba8af1db Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 19 Apr 2019 23:06:00 +1000 Subject: [PATCH 11/24] Replace the message system --- build.gradle | 8 +- worldedit-bukkit/build.gradle | 1 + worldedit-core/build.gradle | 2 + .../worldedit/command/SelectionCommands.java | 12 +- .../worldedit/command/UtilityCommands.java | 23 +- .../extension/platform/CommandManager.java | 3 +- .../util/formatting/ColorCodeBuilder.java | 274 --------------- .../worldedit/util/formatting/Fragment.java | 121 ------- .../worldedit/util/formatting/Style.java | 274 --------------- .../worldedit/util/formatting/StyleSet.java | 320 ------------------ .../util/formatting/StyledFragment.java | 121 ------- .../util/formatting/component/Code.java | 10 +- .../formatting/component/CommandListBox.java | 10 +- .../formatting/component/CommandUsageBox.java | 22 +- .../util/formatting/component/Error.java | 10 +- .../util/formatting/component/Label.java | 10 +- .../util/formatting/component/MessageBox.java | 29 +- .../util/formatting/component/Subtle.java | 10 +- worldedit-forge/build.gradle | 1 + worldedit-sponge/build.gradle | 1 + 20 files changed, 82 insertions(+), 1180 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java diff --git a/build.gradle b/build.gradle index f31f5b6a8..090626cc5 100644 --- a/build.gradle +++ b/build.gradle @@ -142,9 +142,11 @@ subprojects { include(dependency('com.sk89q:jchronic:0.2.4a')) include(dependency('com.thoughtworks.paranamer:paranamer:2.6')) include(dependency('com.sk89q.lib:jlibnoise:1.0.0')) - relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text') { - include(dependency('net.kyori:text-api:2.0.0')) - } + include(dependency('net.kyori:text-api:2.0.0')) + include(dependency("net.kyori:text-serializer-gson:2.0.0")) + include(dependency("net.kyori:text-serializer-legacy:2.0.0")) + + relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text') } exclude 'GradleStart**' exclude '.cache' diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index af7f00114..67ca5e43b 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -43,6 +43,7 @@ shadowJar { include(dependency(':worldedit-core')) include(dependency('org.slf4j:slf4j-api')) include(dependency("org.slf4j:slf4j-jdk14")) + include(dependency("net.kyori:text-adapter-bukkit:1.0.3")) relocate ("org.bstats", "com.sk89q.worldedit.bukkit.bstats") { include(dependency("org.bstats:bstats-bukkit:1.4")) } diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index a83565dfc..9d8176407 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -16,6 +16,8 @@ dependencies { compile 'com.googlecode.json-simple:json-simple:1.1.1' compile 'org.slf4j:slf4j-api:1.7.26' compile 'net.kyori:text-api:2.0.0' + compile 'net.kyori:text-serializer-gson:2.0.0' + compile 'net.kyori:text-serializer-legacy:2.0.0' //compile 'net.sf.trove4j:trove4j:3.0.3' testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 24e92070b..ee93e847c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -55,15 +55,14 @@ import com.sk89q.worldedit.regions.selector.SphereRegionSelector; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.Countable; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; -import com.sk89q.worldedit.util.formatting.Style; -import com.sk89q.worldedit.util.formatting.StyledFragment; import com.sk89q.worldedit.util.formatting.component.CommandListBox; +import com.sk89q.worldedit.util.formatting.component.Subtle; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.storage.ChunkStore; +import net.kyori.text.Component; import java.util.ArrayList; import java.util.List; @@ -754,9 +753,8 @@ public class SelectionCommands { limit.ifPresent(integer -> player.print(integer + " points maximum.")); } else { CommandListBox box = new CommandListBox("Selection modes"); - StyledFragment contents = box.getContents(); - StyledFragment tip = contents.createFragment(Style.RED); - tip.append("Select one of the modes below:").newLine(); + Component contents = box.getContents(); + contents.append(new Subtle("Select one of the modes below:").append(Component.newline())); box.appendCommand("cuboid", "Select two corners of a cuboid"); box.appendCommand("extend", "Fast cuboid selection mode"); @@ -766,7 +764,7 @@ public class SelectionCommands { box.appendCommand("cyl", "Select a cylinder"); box.appendCommand("convex", "Select a convex polyhedral"); - player.printRaw(ColorCodeBuilder.asColorCodes(box)); + player.print(box); return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 8768be6c8..e8ee6275f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -58,15 +58,16 @@ import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; import com.sk89q.worldedit.util.command.binding.Text; -import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; -import com.sk89q.worldedit.util.formatting.Style; -import com.sk89q.worldedit.util.formatting.StyledFragment; import com.sk89q.worldedit.util.formatting.component.Code; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; +import com.sk89q.worldedit.util.formatting.component.Error; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockTypes; +import net.kyori.text.Component; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; import java.util.ArrayList; import java.util.List; @@ -669,17 +670,17 @@ public class UtilityCommands { // Box CommandListBox box = new CommandListBox(String.format("Help: page %d/%d ", page + 1, pageTotal)); - StyledFragment contents = box.getContents(); - StyledFragment tip = contents.createFragment(Style.GRAY); + Component contents = box.getContents(); + Component tip = contents.append(TextComponent.of("", TextColor.GRAY)); if (offset >= aliases.size()) { - tip.createFragment(Style.RED).append(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal)).newLine(); + tip.append(new Error(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal))).append(Component.newline()); } else { List list = aliases.subList(offset, Math.min(offset + perPage, aliases.size())); - tip.append("Type "); - tip.append(new Code().append("//help ").append(" []")); - tip.append(" for more information.").newLine(); + tip.append(TextComponent.of("Type ")); + tip.append(new Code("//help ").append(TextComponent.of(" []"))); + tip.append(TextComponent.of(" for more information.")).append(Component.newline()); // Add each command for (CommandMapping mapping : list) { @@ -696,10 +697,10 @@ public class UtilityCommands { } } - actor.printRaw(ColorCodeBuilder.asColorCodes(box)); + actor.print(box); } else { CommandUsageBox box = new CommandUsageBox(callable, Joiner.on(" ").join(visited)); - actor.printRaw(ColorCodeBuilder.asColorCodes(box)); + actor.print(box); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index a0be07b65..11257efdf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -77,7 +77,6 @@ import com.sk89q.worldedit.util.command.parametric.ExceptionConverter; import com.sk89q.worldedit.util.command.parametric.LegacyCommandsHandler; import com.sk89q.worldedit.util.command.parametric.ParametricBuilder; import com.sk89q.worldedit.util.eventbus.Subscribe; -import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; import com.sk89q.worldedit.util.logging.DynamicStreamHandler; import com.sk89q.worldedit.util.logging.LogFormat; @@ -300,7 +299,7 @@ public final class CommandManager { actor.printError("You are not permitted to do that. Are you in the right mode?"); } catch (InvalidUsageException e) { if (e.isFullHelpSuggested()) { - actor.printRaw(ColorCodeBuilder.asColorCodes(new CommandUsageBox(e.getCommand(), e.getCommandUsed("/", ""), locals))); + actor.print(new CommandUsageBox(e.getCommand(), e.getCommandUsed("/", ""), locals)); String message = e.getMessage(); if (message != null) { actor.printError(message); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java deleted file mode 100644 index 14e8ddbca..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/ColorCodeBuilder.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.util.formatting; - -import com.google.common.base.Joiner; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -public class ColorCodeBuilder { - - private static final ColorCodeBuilder instance = new ColorCodeBuilder(); - private static final Joiner newLineJoiner = Joiner.on("\n"); - public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH = 47; - - /** - * Convert a message into color-coded text. - * - * @param message the message - * @return a list of lines - */ - public String[] build(StyledFragment message) { - StringBuilder builder = new StringBuilder(); - buildFragment(builder, message, message.getStyle(), new StyleSet()); - return builder.toString().split("\r?\n"); - } - - /** - * Build a fragment. - * - * @param builder the string builder - * @param message the message - * @param parentStyle the parent style - * @param lastStyle the last style - * @return the last style used - */ - private StyleSet buildFragment(StringBuilder builder, StyledFragment message, StyleSet parentStyle, StyleSet lastStyle) { - for (Fragment node : message.getChildren()) { - if (node instanceof StyledFragment) { - StyledFragment fragment = (StyledFragment) node; - lastStyle = buildFragment( - builder, fragment, - parentStyle.extend(message.getStyle()), lastStyle); - } else { - StyleSet style = parentStyle.extend(message.getStyle()); - builder.append(getAdditive(style, lastStyle)); - builder.append(node); - lastStyle = style; - } - } - - return lastStyle; - } - - /** - * Get the formatting codes. - * - * @param style the style - * @return the color codes - */ - public static String getFormattingCode(StyleSet style) { - StringBuilder builder = new StringBuilder(); - if (style.isBold()) { - builder.append(Style.BOLD); - } - if (style.isItalic()) { - builder.append(Style.ITALIC); - } - if (style.isUnderline()) { - builder.append(Style.UNDERLINE); - } - if (style.isStrikethrough()) { - builder.append(Style.STRIKETHROUGH); - } - if (style.isObfuscated()) { - builder.append(Style.OBFUSCATED); - } - return builder.toString(); - } - - /** - * Get the formatting and color codes. - * - * @param style the style - * @return the color codes - */ - public static String getCode(StyleSet style) { - StringBuilder builder = new StringBuilder(); - builder.append(getFormattingCode(style)); - if (style.getColor() != null) { - builder.append(style.getColor()); - } - return builder.toString(); - } - - /** - * Get the additional color codes needed to set the given style when the current - * style is the other given one. - * - * @param resetTo the style to reset to - * @param resetFrom the style to reset from - * @return the color codes - */ - public static String getAdditive(StyleSet resetTo, StyleSet resetFrom) { - if (!resetFrom.hasFormatting() && resetTo.hasFormatting()) { - StringBuilder builder = new StringBuilder(); - builder.append(getFormattingCode(resetTo)); - if (resetFrom.getColor() != resetTo.getColor()) { - builder.append(resetTo.getColor()); - } - return builder.toString(); - } else if (!resetFrom.hasEqualFormatting(resetTo) || - (resetFrom.getColor() != null && resetTo.getColor() == null)) { - // Have to set reset code and add back all the formatting codes - return Style.RESET + getCode(resetTo); - } else { - if (resetFrom.getColor() != resetTo.getColor()) { - return String.valueOf(resetTo.getColor()); - } - } - - return ""; - } - - /** - * Word wrap the given text and maintain color codes throughout lines. - * - *

This is borrowed from Bukkit.

- * - * @param rawString the raw string - * @param lineLength the maximum line length - * @return a list of lines - */ - private String[] wordWrap(String rawString, int lineLength) { - // A null string is a single line - if (rawString == null) { - return new String[] {""}; - } - - // A string shorter than the lineWidth is a single line - if (rawString.length() <= lineLength && !rawString.contains("\n")) { - return new String[] {rawString}; - } - - char[] rawChars = (rawString + ' ').toCharArray(); // add a trailing space to trigger pagination - StringBuilder word = new StringBuilder(); - StringBuilder line = new StringBuilder(); - List lines = new LinkedList<>(); - int lineColorChars = 0; - - for (int i = 0; i < rawChars.length; i++) { - char c = rawChars[i]; - - // skip chat color modifiers - if (c == Style.COLOR_CHAR) { - word.append(Style.getByChar(rawChars[i + 1])); - lineColorChars += 2; - i++; // Eat the next character as we have already processed it - continue; - } - - if (c == ' ' || c == '\n') { - if (line.length() == 0 && word.length() > lineLength) { // special case: extremely long word begins a line - String wordStr = word.toString(); - String transformed; - if ((transformed = transform(wordStr)) != null) { - line.append(transformed); - } else { - lines.addAll(Arrays.asList(word.toString().split("(?<=\\G.{" + lineLength + "})"))); - } - } else if (line.length() + word.length() - lineColorChars == lineLength) { // Line exactly the correct length...newline - line.append(' '); - line.append(word); - lines.add(line.toString()); - line = new StringBuilder(); - lineColorChars = 0; - } else if (line.length() + 1 + word.length() - lineColorChars > lineLength) { // Line too long...break the line - String wordStr = word.toString(); - String transformed; - if (word.length() > lineLength && (transformed = transform(wordStr)) != null) { - if (line.length() + 1 + transformed.length() - lineColorChars > lineLength) { - lines.add(line.toString()); - line = new StringBuilder(transformed); - lineColorChars = 0; - } else { - if (line.length() > 0) { - line.append(' '); - } - line.append(transformed); - } - } else { - for (String partialWord : wordStr.split("(?<=\\G.{" + lineLength + "})")) { - lines.add(line.toString()); - line = new StringBuilder(partialWord); - } - lineColorChars = 0; - } - } else { - if (line.length() > 0) { - line.append(' '); - } - line.append(word); - } - word = new StringBuilder(); - - if (c == '\n') { // Newline forces the line to flush - lines.add(line.toString()); - line = new StringBuilder(); - } - } else { - word.append(c); - } - } - - if(line.length() > 0) { // Only add the last line if there is anything to add - lines.add(line.toString()); - } - - // Iterate over the wrapped lines, applying the last color from one line to the beginning of the next - if (lines.get(0).isEmpty() || lines.get(0).charAt(0) != Style.COLOR_CHAR) { - lines.set(0, Style.WHITE + lines.get(0)); - } - for (int i = 1; i < lines.size(); i++) { - final String pLine = lines.get(i-1); - final String subLine = lines.get(i); - - char color = pLine.charAt(pLine.lastIndexOf(Style.COLOR_CHAR) + 1); - if (subLine.isEmpty() || subLine.charAt(0) != Style.COLOR_CHAR) { - lines.set(i, Style.getByChar(color) + subLine); - } - } - - return lines.toArray(new String[lines.size()]); - } - - /** - * Callback for transforming a word, such as a URL. - * - * @param word the word - * @return the transformed value, or null to do nothing - */ - protected String transform(String word) { - return null; - } - - /** - * Convert the given styled fragment into color codes. - * - * @param fragment the fragment - * @return color codes - */ - public static String asColorCodes(StyledFragment fragment) { - return newLineJoiner.join(instance.build(fragment)); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java deleted file mode 100644 index e49d7c678..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.util.formatting; - -import java.util.ArrayList; -import java.util.List; - -/** - * A fragment of text. - */ -public class Fragment { - - private final StringBuilder builder = new StringBuilder(); - private final List children = new ArrayList<>(); - private Fragment lastText; - - Fragment() { - } - - public List getChildren() { - return children; - } - - protected Fragment lastText() { - Fragment text; - if (!children.isEmpty()) { - text = children.get(children.size() - 1); - if (text == lastText) { - return text; - } - } - - text = new Fragment(); - this.lastText = text; - children.add(text); - return text; - } - - public Fragment append(Fragment fragment) { - children.add(fragment); - return this; - } - - public Fragment append(String str) { - builder.append(Style.stripColor(str)); - return this; - } - - public Fragment append(Object obj) { - append(String.valueOf(obj)); - return this; - } - - public Fragment append(StringBuffer sb) { - append(String.valueOf(sb)); - return this; - } - - public Fragment append(CharSequence s) { - append(String.valueOf(s)); - return this; - } - - public Fragment append(boolean b) { - append(String.valueOf(b)); - return this; - } - - public Fragment append(char c) { - append(String.valueOf(c)); - return this; - } - - public Fragment append(int i) { - append(String.valueOf(i)); - return this; - } - - public Fragment append(long lng) { - append(String.valueOf(lng)); - return this; - } - - public Fragment append(float f) { - append(String.valueOf(f)); - return this; - } - - public Fragment append(double d) { - append(String.valueOf(d)); - return this; - } - - public Fragment newLine() { - append("\n"); - return this; - } - - @Override - public String toString() { - return builder.toString(); - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java deleted file mode 100644 index d81774009..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.util.formatting; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.collect.Maps; - -import java.util.Map; -import java.util.regex.Pattern; - -/** - * All supported color values for chat. - */ -public enum Style { - /** - * Represents black - */ - BLACK('0', 0x00), - /** - * Represents dark blue - */ - BLUE_DARK('1', 0x1), - /** - * Represents dark green - */ - GREEN_DARK('2', 0x2), - /** - * Represents dark blue (aqua) - */ - CYAN_DARK('3', 0x3), - /** - * Represents dark red - */ - RED_DARK('4', 0x4), - /** - * Represents dark purple - */ - PURPLE_DARK('5', 0x5), - /** - * Represents gold - */ - YELLOW_DARK('6', 0x6), - /** - * Represents gray - */ - GRAY('7', 0x7), - /** - * Represents dark gray - */ - GRAY_DARK('8', 0x8), - /** - * Represents blue - */ - BLUE('9', 0x9), - /** - * Represents green - */ - GREEN('a', 0xA), - /** - * Represents aqua - */ - CYAN('b', 0xB), - /** - * Represents red - */ - RED('c', 0xC), - /** - * Represents light purple - */ - PURPLE('d', 0xD), - /** - * Represents yellow - */ - YELLOW('e', 0xE), - /** - * Represents white - */ - WHITE('f', 0xF), - /** - * Represents magical characters that change around randomly - */ - OBFUSCATED('k', 0x10, true), - /** - * Makes the text bold. - */ - BOLD('l', 0x11, true), - /** - * Makes a line appear through the text. - */ - STRIKETHROUGH('m', 0x12, true), - /** - * Makes the text appear underlined. - */ - UNDERLINE('n', 0x13, true), - /** - * Makes the text italic. - */ - ITALIC('o', 0x14, true), - /** - * Resets all previous chat colors or formats. - */ - RESET('r', 0x15); - - /** - * The special character which prefixes all chat color codes. Use this if you need to dynamically - * convert color codes from your custom format. - */ - public static final char COLOR_CHAR = '\u00A7'; - private static final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + COLOR_CHAR + "[0-9A-FK-OR]"); - - private final int intCode; - private final char code; - private final boolean isFormat; - private final String toString; - private final static Map BY_ID = Maps.newHashMap(); - private final static Map BY_CHAR = Maps.newHashMap(); - - Style(char code, int intCode) { - this(code, intCode, false); - } - - Style(char code, int intCode, boolean isFormat) { - this.code = code; - this.intCode = intCode; - this.isFormat = isFormat; - this.toString = new String(new char[] {COLOR_CHAR, code}); - } - - /** - * Gets the char value associated with this color - * - * @return A char value of this color code - */ - public char getChar() { - return code; - } - - @Override - public String toString() { - return toString; - } - - /** - * Checks if this code is a format code as opposed to a color code. - * - * @return the if the code is a formatting code - */ - public boolean isFormat() { - return isFormat; - } - - /** - * Checks if this code is a color code as opposed to a format code. - * - * @return the if the code is a color - */ - public boolean isColor() { - return !isFormat && this != RESET; - } - - /** - * Gets the color represented by the specified color code - * - * @param code Code to check - * @return Associative Style with the given code, or null if it doesn't exist - */ - public static Style getByChar(char code) { - return BY_CHAR.get(code); - } - - /** - * Gets the color represented by the specified color code - * - * @param code Code to check - * @return Associative Style with the given code, or null if it doesn't exist - */ - public static Style getByChar(String code) { - checkNotNull(code); - checkArgument(!code.isEmpty(), "Code must have at least one character"); - - return BY_CHAR.get(code.charAt(0)); - } - - /** - * Strips the given message of all color codes - * - * @param input String to strip of color - * @return A copy of the input string, without any coloring - */ - public static String stripColor(final String input) { - if (input == null) { - return null; - } - - return STRIP_COLOR_PATTERN.matcher(input).replaceAll(""); - } - - /** - * Translates a string using an alternate color code character into a string that uses the internal - * ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced - * if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r. - * - * @param altColorChar The alternate color code character to replace. Ex: & - * @param textToTranslate Text containing the alternate color code character. - * @return Text containing the ChatColor.COLOR_CODE color code character. - */ - public static String translateAlternateColorCodes(char altColorChar, String textToTranslate) { - char[] b = textToTranslate.toCharArray(); - for (int i = 0; i < b.length - 1; i++) { - if (b[i] == altColorChar && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[i+1]) > -1) { - b[i] = Style.COLOR_CHAR; - b[i+1] = Character.toLowerCase(b[i+1]); - } - } - return new String(b); - } - - /** - * Gets the ChatColors used at the end of the given input string. - * - * @param input Input string to retrieve the colors from. - * @return Any remaining ChatColors to pass onto the next line. - */ - public static String getLastColors(String input) { - String result = ""; - int length = input.length(); - - // Search backwards from the end as it is faster - for (int index = length - 1; index > -1; index--) { - char section = input.charAt(index); - if (section == COLOR_CHAR && index < length - 1) { - char c = input.charAt(index + 1); - Style color = getByChar(c); - - if (color != null) { - result = color + result; - - // Once we find a color or reset we can stop searching - if (color.isColor() || color == RESET) { - break; - } - } - } - } - - return result; - } - - static { - for (Style color : values()) { - BY_ID.put(color.intCode, color); - BY_CHAR.put(color.code, color); - } - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java deleted file mode 100644 index 2a1c0cf46..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyleSet.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.util.formatting; - -import java.util.Objects; - -/** - * Represents set of styles, such as color, bold, etc. - */ -public class StyleSet { - - private Boolean bold; - private Boolean italic; - private Boolean underline; - private Boolean strikethrough; - private Boolean obfuscated; - private String insertion; - private Style color; - - /** - * Create a new style set with no properties set. - */ - public StyleSet() { - } - - /** - * Create a new style set with the given styles. - * - *

{@link Style#RESET} will be ignored if provided.

- * - * @param styles a list of styles - */ - public StyleSet(Style... styles) { - for (Style style : styles) { - if (style.isColor()) { - color = style; - } else if (style == Style.BOLD) { - bold = true; - } else if (style == Style.ITALIC) { - italic = true; - } else if (style == Style.UNDERLINE) { - underline = true; - } else if (style == Style.STRIKETHROUGH) { - strikethrough = true; - } else if (style == Style.OBFUSCATED) { - obfuscated = true; - } - } - } - - /** - * Get whether this style set is bold. - * - * @return true, false, or null if unset - */ - public Boolean getBold() { - return bold; - } - - /** - * Get whether the text is bold. - * - * @return true if bold - */ - public boolean isBold() { - return getBold() != null && getBold(); - } - - /** - * Set whether the text is bold. - * - * @param bold true, false, or null to unset - */ - public void setBold(Boolean bold) { - this.bold = bold; - } - - /** - * Get whether this style set is italicized. - * - * @return true, false, or null if unset - */ - public Boolean getItalic() { - return italic; - } - - /** - * Get whether the text is italicized. - * - * @return true if italicized - */ - public boolean isItalic() { - return getItalic() != null && getItalic(); - } - - /** - * Set whether the text is italicized. - * - * @param italic false, or null to unset - */ - public void setItalic(Boolean italic) { - this.italic = italic; - } - - /** - * Get whether this style set is underlined. - * - * @return true, false, or null if unset - */ - public Boolean getUnderline() { - return underline; - } - - /** - * Get whether the text is underlined. - * - * @return true if underlined - */ - public boolean isUnderline() { - return getUnderline() != null && getUnderline(); - } - - /** - * Set whether the text is underline. - * - * @param underline false, or null to unset - */ - public void setUnderline(Boolean underline) { - this.underline = underline; - } - - /** - * Get whether this style set is stricken through. - * - * @return true, false, or null if unset - */ - public Boolean getStrikethrough() { - return strikethrough; - } - - /** - * Get whether the text is stricken through. - * - * @return true if there is strikethrough applied - */ - public boolean isStrikethrough() { - return getStrikethrough() != null && getStrikethrough(); - } - - /** - * Set whether the text is stricken through. - * - * @param strikethrough false, or null to unset - */ - public void setStrikethrough(Boolean strikethrough) { - this.strikethrough = strikethrough; - } - - /** - * Get whether this style set is obfuscated. - * - * @return true, false, or null if unset - */ - public Boolean getObfuscated() { - return obfuscated; - } - - /** - * Get whether this style set is obfuscated. - * - * @return true if there is obfuscation applied - */ - public boolean isObfuscated() { - return getObfuscated() != null && getObfuscated(); - } - - /** - * Set whether the text is obfuscated. - * - * @param obfuscated false, or null to unset - */ - public void setObfuscated(Boolean obfuscated) { - this.obfuscated = obfuscated; - } - - /** - * Get this style set's insertion, if present. - * - * @return the insertion, or null if unset - */ - public String getInsertion() { - return insertion; - } - - /** - * Get whether this style set has an insertion. - * - * @return true if there is an insertion - */ - public boolean hasInsertion() { - return insertion != null; - } - - /** - * Set the style set's insertion. - * - * @param insertion the insertion, or null to unset - */ - public void setInsertion(String insertion) { - this.insertion = insertion; - } - - /** - * Get the color of the text. - * - * @return true, false, or null if unset - */ - public Style getColor() { - return color; - } - - /** - * Set the color of the text. - * - * @param color the color - */ - public void setColor(Style color) { - this.color = color; - } - - /** - * Return whether text formatting (bold, italics, underline, strikethrough) is set. - * - * @return true if formatting is set - */ - public boolean hasFormatting() { - return getBold() != null || getItalic() != null - || getUnderline() != null || getStrikethrough() != null - || getObfuscated() != null || getInsertion() != null; - } - - /** - * Return where the text formatting of the given style set is different from - * that assigned to this one. - * - * @param other the other style set - * @return true if there is a difference - */ - public boolean hasEqualFormatting(StyleSet other) { - return getBold() == other.getBold() && getItalic() == other.getItalic() - && getUnderline() == other.getUnderline() && - getStrikethrough() == other.getStrikethrough() && - getObfuscated() == other.getObfuscated() && - Objects.equals(getInsertion(), other.getInsertion()); - } - - /** - * Create a new instance with styles inherited from this one but with new styles - * from the given style set. - * - * @param style the style set - * @return a new style set instance - */ - public StyleSet extend(StyleSet style) { - StyleSet newStyle = clone(); - if (style.getBold() != null) { - newStyle.setBold(style.getBold()); - } - if (style.getItalic() != null) { - newStyle.setItalic(style.getItalic()); - } - if (style.getUnderline() != null) { - newStyle.setUnderline(style.getUnderline()); - } - if (style.getStrikethrough() != null) { - newStyle.setStrikethrough(style.getStrikethrough()); - } - if (style.getObfuscated() != null) { - newStyle.setObfuscated(style.getObfuscated()); - } - if (style.getInsertion() != null) { - newStyle.setInsertion(style.getInsertion()); - } - if (style.getColor() != null) { - newStyle.setColor(style.getColor()); - } - return newStyle; - } - - @Override - public StyleSet clone() { - StyleSet style = new StyleSet(); - style.setBold(getBold()); - style.setItalic(getItalic()); - style.setUnderline(getUnderline()); - style.setStrikethrough(getStrikethrough()); - style.setObfuscated(getObfuscated()); - style.setInsertion(getInsertion()); - style.setColor(getColor()); - return style; - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java deleted file mode 100644 index ec0578d47..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/StyledFragment.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.util.formatting; - -/** - * A fragment of text that can be styled. - */ -public class StyledFragment extends Fragment { - - private StyleSet style; - - public StyledFragment() { - style = new StyleSet(); - } - - public StyledFragment(StyleSet style) { - this.style = style; - } - - public StyledFragment(Style... styles) { - this.style = new StyleSet(styles); - } - - public StyleSet getStyle() { - return style; - } - - public void setStyles(StyleSet style) { - this.style = style; - } - - public StyledFragment createFragment(Style... styles) { - StyledFragment fragment = new StyledFragment(styles); - append(fragment); - return fragment; - } - - @Override - public StyledFragment append(String str) { - lastText().append(str); - return this; - } - - @Override - public StyledFragment append(Object obj) { - append(String.valueOf(obj)); - return this; - } - - @Override - public StyledFragment append(StringBuffer sb) { - append(String.valueOf(sb)); - return this; - } - - @Override - public StyledFragment append(CharSequence s) { - append(String.valueOf(s)); - return this; - } - - @Override - public StyledFragment append(boolean b) { - append(String.valueOf(b)); - return this; - } - - @Override - public StyledFragment append(char c) { - append(String.valueOf(c)); - return this; - } - - @Override - public StyledFragment append(int i) { - append(String.valueOf(i)); - return this; - } - - @Override - public StyledFragment append(long lng) { - append(String.valueOf(lng)); - return this; - } - - @Override - public StyledFragment append(float f) { - append(String.valueOf(f)); - return this; - } - - @Override - public StyledFragment append(double d) { - append(String.valueOf(d)); - return this; - } - - @Override - public StyledFragment newLine() { - append("\n"); - return this; - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java index 953d83fe3..ec9164c72 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java @@ -19,19 +19,19 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.Style; -import com.sk89q.worldedit.util.formatting.StyledFragment; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; /** * Represents a fragment representing a command that is to be typed. */ -public class Code extends StyledFragment { +public class Code extends TextComponent { /** * Create a new instance. */ - public Code() { - super(Style.CYAN); + public Code(String message) { + super(builder(message).color(TextColor.AQUA)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java index 145b6baca..2767ff920 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java @@ -19,7 +19,9 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.Style; +import net.kyori.text.Component; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; public class CommandListBox extends MessageBox { @@ -36,10 +38,10 @@ public class CommandListBox extends MessageBox { public CommandListBox appendCommand(String alias, String description) { if (!first) { - getContents().newLine(); + getContents().append(Component.newline()); } - getContents().createFragment(Style.YELLOW_DARK).append(alias).append(": "); - getContents().append(description); + getContents().append(TextComponent.of(alias, TextColor.GOLD).append(TextComponent.of(": "))); + getContents().append(TextComponent.of(description)); first = false; return this; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java index 00a16c24e..fb0cc5c60 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java @@ -28,7 +28,8 @@ import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Description; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; -import com.sk89q.worldedit.util.formatting.StyledFragment; +import net.kyori.text.Component; +import net.kyori.text.TextComponent; import java.util.ArrayList; import java.util.List; @@ -38,7 +39,7 @@ import javax.annotation.Nullable; /** * A box to describe usage of a command. */ -public class CommandUsageBox extends StyledFragment { +public class CommandUsageBox extends TextComponent { /** * Create a new usage box. @@ -58,6 +59,7 @@ public class CommandUsageBox extends StyledFragment { * @param locals list of locals to use */ public CommandUsageBox(CommandCallable command, String commandString, @Nullable CommandLocals locals) { + super(builder()); checkNotNull(command); checkNotNull(commandString); if (command instanceof Dispatcher) { @@ -85,23 +87,23 @@ public class CommandUsageBox extends StyledFragment { private void attachCommandUsage(Description description, String commandString) { MessageBox box = new MessageBox("Help for " + commandString); - StyledFragment contents = box.getContents(); + Component contents = box.getContents(); if (description.getUsage() != null) { - contents.append(new Label().append("Usage: ")); - contents.append(description.getUsage()); + contents.append(new Label("Usage: ")); + contents.append(TextComponent.of(description.getUsage())); } else { - contents.append(new Subtle().append("Usage information is not available.")); + contents.append(new Subtle("Usage information is not available.")); } - contents.newLine(); + contents.append(Component.newline()); if (description.getHelp() != null) { - contents.append(description.getHelp()); + contents.append(TextComponent.of(description.getHelp())); } else if (description.getDescription() != null) { - contents.append(description.getDescription()); + contents.append(TextComponent.of(description.getDescription())); } else { - contents.append(new Subtle().append("No further help is available.")); + contents.append(new Subtle("No further help is available.")); } append(box); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java index 056c99c18..5042a3804 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java @@ -19,19 +19,19 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.Style; -import com.sk89q.worldedit.util.formatting.StyledFragment; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; /** * Represents a fragment representing an error. */ -public class Error extends StyledFragment { +public class Error extends TextComponent { /** * Create a new instance. */ - public Error() { - super(Style.RED); + public Error(String message) { + super(builder(message).color(TextColor.RED)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java index 8a59732b0..bc0e46527 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java @@ -19,19 +19,19 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.Style; -import com.sk89q.worldedit.util.formatting.StyledFragment; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; /** * Represents a fragment representing a label. */ -public class Label extends StyledFragment { +public class Label extends TextComponent { /** * Create a new instance. */ - public Label() { - super(Style.YELLOW); + public Label(String message) { + super(builder(message).color(TextColor.YELLOW)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java index 086ce05e9..7b2dcc72e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java @@ -21,36 +21,39 @@ package com.sk89q.worldedit.util.formatting.component; import static com.google.common.base.Preconditions.checkNotNull; -import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; -import com.sk89q.worldedit.util.formatting.Style; -import com.sk89q.worldedit.util.formatting.StyledFragment; +import net.kyori.text.Component; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; /** * Makes for a box with a border above and below. */ -public class MessageBox extends StyledFragment { +public class MessageBox extends TextComponent { - private final StyledFragment contents = new StyledFragment(); + public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH = 47; + + private final Component contents = Component.empty(); /** * Create a new box. */ public MessageBox(String title) { + super(builder()); checkNotNull(title); - int leftOver = ColorCodeBuilder.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH - title.length() - 2; + int leftOver = GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH - title.length() - 2; int leftSide = (int) Math.floor(leftOver * 1.0/3); int rightSide = (int) Math.floor(leftOver * 2.0/3); if (leftSide > 0) { - createFragment(Style.YELLOW).append(createBorder(leftSide)); + append(TextComponent.of(createBorder(leftSide), TextColor.YELLOW)); } - append(" "); - append(title); - append(" "); + append(Component.space()); + append(TextComponent.of(title)); + append(Component.space()); if (rightSide > 0) { - createFragment(Style.YELLOW).append(createBorder(rightSide)); + append(TextComponent.of(createBorder(rightSide), TextColor.YELLOW)); } - newLine(); + append(Component.newline()); append(contents); } @@ -67,7 +70,7 @@ public class MessageBox extends StyledFragment { * * @return the contents */ - public StyledFragment getContents() { + public Component getContents() { return contents; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java index 34316c087..68600f0a3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java @@ -19,19 +19,19 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.Style; -import com.sk89q.worldedit.util.formatting.StyledFragment; +import net.kyori.text.TextComponent; +import net.kyori.text.format.TextColor; /** * Represents a subtle part of the message. */ -public class Subtle extends StyledFragment { +public class Subtle extends TextComponent { /** * Create a new instance. */ - public Subtle() { - super(Style.GRAY); + public Subtle(String message) { + super(builder(message).color(TextColor.GRAY)); } } diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index 41c798310..c1ce166c1 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -91,6 +91,7 @@ shadowJar { include(dependency(':worldedit-core')) include(dependency('org.slf4j:slf4j-api')) include(dependency("org.apache.logging.log4j:log4j-slf4j-impl")) + include(dependency("net.kyori:text-serializer-gson:2.0.0")) } } diff --git a/worldedit-sponge/build.gradle b/worldedit-sponge/build.gradle index f65952c91..762557b6e 100644 --- a/worldedit-sponge/build.gradle +++ b/worldedit-sponge/build.gradle @@ -43,6 +43,7 @@ shadowJar { dependencies { include(dependency(':worldedit-core')) include(dependency('org.bstats:bstats-sponge:1.4')) + include(dependency("net.kyori:text-adapter-spongeapi:1.0.3")) } } From a9926328f11bc60dd8442cb844658c693d38db8a Mon Sep 17 00:00:00 2001 From: wizjany Date: Sat, 20 Apr 2019 12:13:46 -0400 Subject: [PATCH 12/24] Stop trying to redo when history runs out. --- .../main/java/com/sk89q/worldedit/command/HistoryCommands.java | 1 + 1 file changed, 1 insertion(+) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java index b960dfbe4..773916d59 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java @@ -110,6 +110,7 @@ public class HistoryCommands { worldEdit.flushBlockBag(player, redone); } else { player.printError("Nothing left to redo."); + break; } } } From 1e7b4fc835ac202dc3b0d4e8a44362b2251ed692 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sat, 20 Apr 2019 23:11:39 -0700 Subject: [PATCH 13/24] Move shaded libraries to their own artifacts --- build.gradle | 44 ++++----- settings.gradle | 7 +- worldedit-bukkit/build.gradle | 3 +- .../worldedit/bukkit/BukkitCommandSender.java | 4 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 4 +- worldedit-core/build.gradle | 7 +- .../worldedit/command/SelectionCommands.java | 10 +- .../worldedit/command/UtilityCommands.java | 10 +- .../worldedit/extension/platform/Actor.java | 2 +- .../extension/platform/PlayerProxy.java | 2 +- .../util/formatting/component/Code.java | 4 +- .../formatting/component/CommandListBox.java | 6 +- .../formatting/component/CommandUsageBox.java | 4 +- .../util/formatting/component/Error.java | 4 +- .../util/formatting/component/Label.java | 4 +- .../util/formatting/component/MessageBox.java | 8 +- .../util/formatting/component/Subtle.java | 4 +- .../sk89q/worldedit/forge/ForgePlayer.java | 2 +- worldedit-libs/build.gradle | 97 +++++++++++++++++++ worldedit-sponge/build.gradle | 3 +- .../worldedit/sponge/SpongeCommandSender.java | 4 +- .../sk89q/worldedit/sponge/SpongePlayer.java | 4 +- 22 files changed, 165 insertions(+), 72 deletions(-) create mode 100644 worldedit-libs/build.gradle diff --git a/build.gradle b/build.gradle index 090626cc5..16fd983db 100644 --- a/build.gradle +++ b/build.gradle @@ -82,6 +82,14 @@ artifactory { artifactoryPublish.skip = true subprojects { + repositories { + mavenCentral() + maven { url "http://maven.sk89q.com/repo/" } + maven { url "http://repo.maven.apache.org/maven2" } + } +} + +configure(['core', 'bukkit', 'forge', 'sponge'].collect { project(":worldedit-$it") }) { apply plugin: 'java' apply plugin: 'maven' apply plugin: 'checkstyle' @@ -97,12 +105,6 @@ subprojects { checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml") checkstyle.toolVersion = '7.6.1' - repositories { - mavenCentral() - maven { url "http://maven.sk89q.com/repo/" } - maven { url "http://repo.maven.apache.org/maven2" } - } - if (JavaVersion.current().isJava8Compatible()) { // Java 8 turns on doclint which we fail tasks.withType(Javadoc) { @@ -136,23 +138,6 @@ subprojects { build.dependsOn(checkstyleTest) build.dependsOn(javadocJar) - shadowJar { - classifier 'dist' - dependencies { - include(dependency('com.sk89q:jchronic:0.2.4a')) - include(dependency('com.thoughtworks.paranamer:paranamer:2.6')) - include(dependency('com.sk89q.lib:jlibnoise:1.0.0')) - include(dependency('net.kyori:text-api:2.0.0')) - include(dependency("net.kyori:text-serializer-gson:2.0.0")) - include(dependency("net.kyori:text-serializer-legacy:2.0.0")) - - relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text') - } - exclude 'GradleStart**' - exclude '.cache' - exclude 'LICENSE*' - } - artifactoryPublish { publishConfigs('archives') } @@ -162,3 +147,16 @@ subprojects { include '**/*.java' } } + +configure(['bukkit', 'forge', 'sponge'].collect { project(":worldedit-$it") }) { + shadowJar { + classifier 'dist' + dependencies { + include(project(":worldedit-libs")) + include(project(":worldedit-core")) + } + exclude 'GradleStart**' + exclude '.cache' + exclude 'LICENSE*' + } +} diff --git a/settings.gradle b/settings.gradle index 576283ecc..efbda026f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,8 @@ rootProject.name = 'worldedit' -include 'worldedit-core', 'worldedit-bukkit', 'worldedit-forge', 'worldedit-sponge' \ No newline at end of file +include 'worldedit-libs' + +['bukkit', 'core', 'forge', 'sponge'].forEach { + include "worldedit-libs:$it" + include "worldedit-$it" +} \ No newline at end of file diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 67ca5e43b..79ec8f5c5 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -10,12 +10,11 @@ repositories { dependencies { compile project(':worldedit-core') + compile project(':worldedit-libs:bukkit') compile 'com.sk89q:dummypermscompat:1.10' compile 'org.bukkit:bukkit:1.13.2-R0.1-SNAPSHOT' // zzz - compile 'org.bstats:bstats-bukkit:1.4' compile "io.papermc:paperlib:1.0.1" compile 'org.slf4j:slf4j-jdk14:1.7.26' - compile 'net.kyori:text-adapter-bukkit:1.0.3' testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java index 21d08d726..b82dfe458 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java @@ -26,8 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.auth.AuthorizationException; -import net.kyori.text.TextComponent; -import net.kyori.text.adapter.bukkit.TextAdapter; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index ca15daa91..71941a69d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -37,8 +37,8 @@ import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; -import net.kyori.text.TextComponent; -import net.kyori.text.adapter.bukkit.TextAdapter; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index 9d8176407..c401d5b06 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -4,20 +4,15 @@ apply plugin: 'eclipse' apply plugin: 'idea' dependencies { + compile project(':worldedit-libs:core') compile 'de.schlichtherle:truezip:6.8.3' compile 'rhino:js:1.7R2' compile 'org.yaml:snakeyaml:1.9' compile 'com.google.guava:guava:21.0' - compile 'com.sk89q:jchronic:0.2.4a' compile 'com.google.code.findbugs:jsr305:1.3.9' - compile 'com.thoughtworks.paranamer:paranamer:2.6' compile 'com.google.code.gson:gson:2.8.0' - compile 'com.sk89q.lib:jlibnoise:1.0.0' compile 'com.googlecode.json-simple:json-simple:1.1.1' compile 'org.slf4j:slf4j-api:1.7.26' - compile 'net.kyori:text-api:2.0.0' - compile 'net.kyori:text-serializer-gson:2.0.0' - compile 'net.kyori:text-serializer-legacy:2.0.0' //compile 'net.sf.trove4j:trove4j:3.0.3' testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index ee93e847c..7c1b1889c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -62,7 +62,7 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.storage.ChunkStore; -import net.kyori.text.Component; +import com.sk89q.worldedit.util.formatting.text.Component; import java.util.ArrayList; import java.util.List; @@ -75,7 +75,7 @@ import java.util.Set; public class SelectionCommands { private final WorldEdit we; - + public SelectionCommands(WorldEdit we) { this.we = we; } @@ -294,7 +294,7 @@ public class SelectionCommands { ) @CommandPermissions("worldedit.wand.toggle") public void toggleWand(Player player, LocalSession session, CommandContext args) throws WorldEditException { - + session.setToolControl(!session.isToolControlEnabled()); if (session.isToolControlEnabled()) { @@ -393,7 +393,7 @@ public class SelectionCommands { session.getRegionSelector(player.getWorld()).learnChanges(); int newSize = region.getArea(); - + session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session); player.print("Region expanded " + (newSize - oldSize) + " blocks."); @@ -464,7 +464,7 @@ public class SelectionCommands { } session.getRegionSelector(player.getWorld()).learnChanges(); int newSize = region.getArea(); - + session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index e8ee6275f..989fbad6b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -65,9 +65,9 @@ import com.sk89q.worldedit.util.formatting.component.Error; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockTypes; -import net.kyori.text.Component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; +import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; import java.util.ArrayList; import java.util.List; @@ -207,7 +207,7 @@ public class UtilityCommands { @CommandPermissions("worldedit.removeabove") @Logging(PLACEMENT) public void removeAbove(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - + int size = args.argsLength() > 0 ? Math.max(1, args.getInteger(0)) : 1; we.checkMaxRadius(size); World world = player.getWorld(); @@ -275,7 +275,7 @@ public class UtilityCommands { @CommandPermissions("worldedit.replacenear") @Logging(PLACEMENT) public void replaceNear(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { - + int size = Math.max(1, args.getInteger(0)); we.checkMaxRadius(size); int affected; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java index 86bae5934..45160de66 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.auth.Subject; -import net.kyori.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import java.io.File; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 5211e1380..2159a2fce 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -34,7 +34,7 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.gamemode.GameMode; -import net.kyori.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import java.util.UUID; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java index ec9164c72..a1491551e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.util.formatting.component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing a command that is to be typed. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java index 2767ff920..9e6ec3295 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit.util.formatting.component; -import net.kyori.text.Component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; +import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; public class CommandListBox extends MessageBox { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java index fb0cc5c60..13eee701c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java @@ -28,8 +28,8 @@ import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Description; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; -import net.kyori.text.Component; -import net.kyori.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import java.util.ArrayList; import java.util.List; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java index 5042a3804..52d9d7044 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.util.formatting.component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing an error. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java index bc0e46527..a38adc7bb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.util.formatting.component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing a label. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java index 7b2dcc72e..b32c00995 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java @@ -21,9 +21,9 @@ package com.sk89q.worldedit.util.formatting.component; import static com.google.common.base.Preconditions.checkNotNull; -import net.kyori.text.Component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; +import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Makes for a box with a border above and below. @@ -67,7 +67,7 @@ public class MessageBox extends TextComponent { /** * Get the internal contents. - * + * * @return the contents */ public Component getContents() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java index 68600f0a3..a512138d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.util.formatting.component; -import net.kyori.text.TextComponent; -import net.kyori.text.format.TextColor; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a subtle part of the message. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 57734f43a..5dc11aaf6 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -34,7 +34,7 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; -import net.kyori.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; diff --git a/worldedit-libs/build.gradle b/worldedit-libs/build.gradle new file mode 100644 index 000000000..51b307019 --- /dev/null +++ b/worldedit-libs/build.gradle @@ -0,0 +1,97 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +subprojects { + apply plugin: 'maven' + apply plugin: 'com.github.johnrengelman.shadow' + apply plugin: 'com.jfrog.artifactory' + configurations { + create("shade") + } + + group = rootProject.group + ".worldedit-libs" + + tasks.register("jar", ShadowJar) { + configurations = [project.configurations.shade] + classifier = "" + + relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text') + } + def altConfigFiles = { String artifactType -> + def deps = configurations.shade.incoming.dependencies + .collect { it.copy() } + .collect { dependency -> + dependency.artifact { artifact -> + artifact.name = dependency.name + artifact.type = artifactType + artifact.extension = 'jar' + artifact.classifier = artifactType + } + dependency + } + + return files(configurations.detachedConfiguration(deps as Dependency[]) + .resolvedConfiguration.lenientConfiguration.getArtifacts() + .findAll { it.classifier == artifactType } + .collect { zipTree(it.file) }) + } + tasks.register("sourcesJar", Jar) { + from { + altConfigFiles('sources') + } + def filePattern = ~'(.*)net/kyori/text((?:/|$).*)' + def textPattern = ~/net\.kyori\.text/ + eachFile { + it.filter { String line -> + line.replaceFirst(textPattern, 'com.sk89q.worldedit.util.formatting.text') + } + it.path = it.path.replaceFirst(filePattern, '$1com/sk89q/worldedit/util/formatting/text$2') + } + classifier = "sources" + } + + artifacts { + add("default", jar) + add("default", sourcesJar) + } + + tasks.register("install", Upload) { + configuration = configurations.default + repositories.mavenInstaller { + pom.version = project.version + pom.artifactId = project.name + } + } + + artifactoryPublish { + publishConfigs('default') + } + + build.dependsOn(jar, sourcesJar) +} + +project("core") { + dependencies { + shade 'net.kyori:text-api:2.0.0' + shade 'net.kyori:text-serializer-gson:2.0.0' + shade 'net.kyori:text-serializer-legacy:2.0.0' + shade 'com.sk89q:jchronic:0.2.4a' + shade 'com.thoughtworks.paranamer:paranamer:2.6' + shade 'com.sk89q.lib:jlibnoise:1.0.0' + } +} +project("bukkit") { + dependencies { + shade 'net.kyori:text-adapter-bukkit:1.0.3' + shade 'org.bstats:bstats-bukkit:1.4' + } +} +project("sponge") { + dependencies { + shade 'net.kyori:text-adapter-spongeapi:1.0.3' + shade 'org.bstats:bstats-sponge:1.4' + } +} + +tasks.register("build") { + dependsOn(subprojects.collect { it.tasks.named("build") }) +} diff --git a/worldedit-sponge/build.gradle b/worldedit-sponge/build.gradle index 762557b6e..422913966 100644 --- a/worldedit-sponge/build.gradle +++ b/worldedit-sponge/build.gradle @@ -17,9 +17,8 @@ repositories { dependencies { compile project(':worldedit-core') + compile project(':worldedit-libs:sponge') compile 'org.spongepowered:spongeapi:7.1.0' - compile 'org.bstats:bstats-sponge:1.4' - compile 'net.kyori:text-adapter-spongeapi:1.0.3' testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1' } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java index fe5c626a3..e44146b3c 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java @@ -26,8 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.auth.AuthorizationException; -import net.kyori.text.TextComponent; -import net.kyori.text.adapter.spongeapi.TextAdapter; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.adapter.spongeapi.TextAdapter; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.Text; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 10b1f47e8..099780b3d 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -36,8 +36,8 @@ import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.item.ItemTypes; -import net.kyori.text.TextComponent; -import net.kyori.text.adapter.spongeapi.TextAdapter; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.adapter.spongeapi.TextAdapter; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.entity.living.player.Player; From 5c19866809a7c5a4856eb2e1ed079fdb86e1a9d5 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sat, 20 Apr 2019 23:33:54 -0700 Subject: [PATCH 14/24] Some fixes for new libs shading --- build.gradle | 3 ++- worldedit-bukkit/build.gradle | 1 + worldedit-core/build.gradle | 7 ------- worldedit-forge/build.gradle | 2 -- worldedit-libs/build.gradle | 11 ++++++----- worldedit-sponge/build.gradle | 11 ++++------- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 16fd983db..eaa4a49b5 100644 --- a/build.gradle +++ b/build.gradle @@ -152,7 +152,8 @@ configure(['bukkit', 'forge', 'sponge'].collect { project(":worldedit-$it") }) { shadowJar { classifier 'dist' dependencies { - include(project(":worldedit-libs")) + include(project(":worldedit-libs:core")) + include(project(":worldedit-libs:${project.name.replace("worldedit-", "")}")) include(project(":worldedit-core")) } exclude 'GradleStart**' diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 79ec8f5c5..14550bdb5 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -15,6 +15,7 @@ dependencies { compile 'org.bukkit:bukkit:1.13.2-R0.1-SNAPSHOT' // zzz compile "io.papermc:paperlib:1.0.1" compile 'org.slf4j:slf4j-jdk14:1.7.26' + compile 'org.bstats:bstats-bukkit:1.4' testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index c401d5b06..828833d9a 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -1,5 +1,3 @@ -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar - apply plugin: 'eclipse' apply plugin: 'idea' @@ -28,8 +26,3 @@ sourceSets { } } } - -task jar(type: ShadowJar, overwrite: true) { - from sourceSets.main.output - configurations = [project.configurations.runtime] -} \ No newline at end of file diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index c1ce166c1..d398d05d1 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -88,10 +88,8 @@ shadowJar { relocate "org.slf4j", "com.sk89q.worldedit.slf4j" relocate "org.apache.logging.slf4j", "com.sk89q.worldedit.log4jbridge" - include(dependency(':worldedit-core')) include(dependency('org.slf4j:slf4j-api')) include(dependency("org.apache.logging.log4j:log4j-slf4j-impl")) - include(dependency("net.kyori:text-serializer-gson:2.0.0")) } } diff --git a/worldedit-libs/build.gradle b/worldedit-libs/build.gradle index 51b307019..983d2dc41 100644 --- a/worldedit-libs/build.gradle +++ b/worldedit-libs/build.gradle @@ -6,6 +6,7 @@ subprojects { apply plugin: 'com.jfrog.artifactory' configurations { create("shade") + getByName("archives").extendsFrom(getByName("default")) } group = rootProject.group + ".worldedit-libs" @@ -51,11 +52,11 @@ subprojects { artifacts { add("default", jar) - add("default", sourcesJar) + add("archives", sourcesJar) } tasks.register("install", Upload) { - configuration = configurations.default + configuration = configurations.archives repositories.mavenInstaller { pom.version = project.version pom.artifactId = project.name @@ -74,7 +75,9 @@ project("core") { shade 'net.kyori:text-api:2.0.0' shade 'net.kyori:text-serializer-gson:2.0.0' shade 'net.kyori:text-serializer-legacy:2.0.0' - shade 'com.sk89q:jchronic:0.2.4a' + shade('com.sk89q:jchronic:0.2.4a') { + exclude(group: "junit", module: "junit") + } shade 'com.thoughtworks.paranamer:paranamer:2.6' shade 'com.sk89q.lib:jlibnoise:1.0.0' } @@ -82,13 +85,11 @@ project("core") { project("bukkit") { dependencies { shade 'net.kyori:text-adapter-bukkit:1.0.3' - shade 'org.bstats:bstats-bukkit:1.4' } } project("sponge") { dependencies { shade 'net.kyori:text-adapter-spongeapi:1.0.3' - shade 'org.bstats:bstats-sponge:1.4' } } diff --git a/worldedit-sponge/build.gradle b/worldedit-sponge/build.gradle index 422913966..6d75c4d84 100644 --- a/worldedit-sponge/build.gradle +++ b/worldedit-sponge/build.gradle @@ -19,6 +19,7 @@ dependencies { compile project(':worldedit-core') compile project(':worldedit-libs:sponge') compile 'org.spongepowered:spongeapi:7.1.0' + compile 'org.bstats:bstats-sponge:1.4' testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1' } @@ -40,16 +41,12 @@ jar { shadowJar { dependencies { - include(dependency(':worldedit-core')) - include(dependency('org.bstats:bstats-sponge:1.4')) - include(dependency("net.kyori:text-adapter-spongeapi:1.0.3")) + relocate ("org.bstats", "com.sk89q.worldedit.sponge.bstats") { + include(dependency('org.bstats:bstats-sponge:1.4')) + } } } -artifacts { - archives shadowJar -} - if (project.hasProperty("signing")) { apply plugin: 'signing' From 73d56819269eeb730fb99373f482513f75aeb1b9 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sat, 20 Apr 2019 23:36:44 -0700 Subject: [PATCH 15/24] Add a note about which libraries get shaded where --- worldedit-libs/build.gradle | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/worldedit-libs/build.gradle b/worldedit-libs/build.gradle index 983d2dc41..81d44c28c 100644 --- a/worldedit-libs/build.gradle +++ b/worldedit-libs/build.gradle @@ -1,5 +1,17 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +/* +This project shades API libraries, i.e. those libraries +whose classes are publicly referenced from `-core` classes. + +This project does not shade implementation libraries, i.e. +those libraries whose classes are internally depended on. + +This is because the main reason for shading those libraries is for +their internal usage in each platform, not because we need them available to +dependents of `-core` to compile and work with WorldEdit's API. + + */ subprojects { apply plugin: 'maven' apply plugin: 'com.github.johnrengelman.shadow' From 5a18ed275ff3ab3707c39cf8b9e76e5ad4f746e9 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 21 Apr 2019 00:01:06 -0700 Subject: [PATCH 16/24] Drop provided / compileOnly dependencies from shadow --- worldedit-libs/build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/worldedit-libs/build.gradle b/worldedit-libs/build.gradle index 81d44c28c..f0a2359b5 100644 --- a/worldedit-libs/build.gradle +++ b/worldedit-libs/build.gradle @@ -27,6 +27,12 @@ subprojects { configurations = [project.configurations.shade] classifier = "" + dependencies { + exclude(dependency("com.google.guava:guava")) + exclude(dependency("com.google.code.gson:gson")) + exclude(dependency("org.checkerframework:checker-qual")) + } + relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text') } def altConfigFiles = { String artifactType -> From c52eb59d7f702dbcc90c47ad9aae7fedacf72e1b Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 22 Apr 2019 22:05:20 +1000 Subject: [PATCH 17/24] Get it all working --- build.gradle | 1 + worldedit-bukkit/build.gradle | 1 - .../worldedit/command/SelectionCommands.java | 21 +++++---- .../worldedit/command/UtilityCommands.java | 20 ++++---- .../extension/platform/CommandManager.java | 2 +- .../util/formatting/component/Code.java | 5 +- .../formatting/component/CommandListBox.java | 16 ++++++- .../formatting/component/CommandUsageBox.java | 17 ++++--- .../util/formatting/component/Error.java | 5 +- .../util/formatting/component/Label.java | 5 +- .../util/formatting/component/MessageBox.java | 22 +++++---- .../util/formatting/component/Subtle.java | 5 +- .../component/TextComponentProducer.java | 47 +++++++++++++++++++ worldedit-libs/build.gradle | 4 +- 14 files changed, 116 insertions(+), 55 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java diff --git a/build.gradle b/build.gradle index eaa4a49b5..63b4d9537 100644 --- a/build.gradle +++ b/build.gradle @@ -86,6 +86,7 @@ subprojects { mavenCentral() maven { url "http://maven.sk89q.com/repo/" } maven { url "http://repo.maven.apache.org/maven2" } + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } } } diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 14550bdb5..975aee9d9 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -43,7 +43,6 @@ shadowJar { include(dependency(':worldedit-core')) include(dependency('org.slf4j:slf4j-api')) include(dependency("org.slf4j:slf4j-jdk14")) - include(dependency("net.kyori:text-adapter-bukkit:1.0.3")) relocate ("org.bstats", "com.sk89q.worldedit.bukkit.bstats") { include(dependency("org.bstats:bstats-bukkit:1.4")) } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 7c1b1889c..cd15be1ff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -57,6 +57,7 @@ import com.sk89q.worldedit.util.Countable; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.util.formatting.component.Subtle; +import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; @@ -753,18 +754,18 @@ public class SelectionCommands { limit.ifPresent(integer -> player.print(integer + " points maximum.")); } else { CommandListBox box = new CommandListBox("Selection modes"); - Component contents = box.getContents(); - contents.append(new Subtle("Select one of the modes below:").append(Component.newline())); + TextComponentProducer contents = box.getContents(); + contents.append(new Subtle("Select one of the modes below:").append(Component.newline()).create()); - box.appendCommand("cuboid", "Select two corners of a cuboid"); - box.appendCommand("extend", "Fast cuboid selection mode"); - box.appendCommand("poly", "Select a 2D polygon with height"); - box.appendCommand("ellipsoid", "Select an ellipsoid"); - box.appendCommand("sphere", "Select a sphere"); - box.appendCommand("cyl", "Select a cylinder"); - box.appendCommand("convex", "Select a convex polyhedral"); + box.appendCommand("cuboid", "Select two corners of a cuboid", "//sel cuboid"); + box.appendCommand("extend", "Fast cuboid selection mode", "//sel extend"); + box.appendCommand("poly", "Select a 2D polygon with height", "//sel poly"); + box.appendCommand("ellipsoid", "Select an ellipsoid", "//sel ellipsoid"); + box.appendCommand("sphere", "Select a sphere", "//sel sphere"); + box.appendCommand("cyl", "Select a cylinder", "//sel cyl"); + box.appendCommand("convex", "Select a convex polyhedral", "//sel convex"); - player.print(box); + player.print(box.create()); return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 989fbad6b..bd0c8ba53 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -62,12 +62,13 @@ import com.sk89q.worldedit.util.formatting.component.Code; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; import com.sk89q.worldedit.util.formatting.component.Error; +import com.sk89q.worldedit.util.formatting.component.Subtle; +import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; +import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.util.formatting.text.Component; -import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.format.TextColor; import java.util.ArrayList; import java.util.List; @@ -670,16 +671,16 @@ public class UtilityCommands { // Box CommandListBox box = new CommandListBox(String.format("Help: page %d/%d ", page + 1, pageTotal)); - Component contents = box.getContents(); - Component tip = contents.append(TextComponent.of("", TextColor.GRAY)); + TextComponentProducer tip = new Subtle(""); + TextComponentProducer contents = box.getContents(); if (offset >= aliases.size()) { - tip.append(new Error(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal))).append(Component.newline()); + tip.append(new Error(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal)).create()).append(Component.newline()); } else { List list = aliases.subList(offset, Math.min(offset + perPage, aliases.size())); tip.append(TextComponent.of("Type ")); - tip.append(new Code("//help ").append(TextComponent.of(" []"))); + tip.append(new Code("//help ").append(TextComponent.of(" []")).create()); tip.append(TextComponent.of(" for more information.")).append(Component.newline()); // Add each command @@ -697,10 +698,11 @@ public class UtilityCommands { } } - actor.print(box); + contents.append(tip.create()); + actor.print(box.create()); } else { CommandUsageBox box = new CommandUsageBox(callable, Joiner.on(" ").join(visited)); - actor.print(box); + actor.print(box.create()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index 11257efdf..45b5265bb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -299,7 +299,7 @@ public final class CommandManager { actor.printError("You are not permitted to do that. Are you in the right mode?"); } catch (InvalidUsageException e) { if (e.isFullHelpSuggested()) { - actor.print(new CommandUsageBox(e.getCommand(), e.getCommandUsed("/", ""), locals)); + actor.print(new CommandUsageBox(e.getCommand(), e.getCommandUsed("/", ""), locals).create()); String message = e.getMessage(); if (message != null) { actor.printError(message); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java index a1491551e..6cbad7f3a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java @@ -19,19 +19,18 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing a command that is to be typed. */ -public class Code extends TextComponent { +public class Code extends TextComponentProducer { /** * Create a new instance. */ public Code(String message) { - super(builder(message).color(TextColor.AQUA)); + getBuilder().content(message).color(TextColor.AQUA); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java index 9e6ec3295..846d08853 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java @@ -21,6 +21,8 @@ package com.sk89q.worldedit.util.formatting.component; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; +import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; public class CommandListBox extends MessageBox { @@ -33,14 +35,24 @@ public class CommandListBox extends MessageBox { * @param title the title */ public CommandListBox(String title) { - super(title); + super(title, new TextComponentProducer()); } public CommandListBox appendCommand(String alias, String description) { + return appendCommand(alias, description, null); + } + + public CommandListBox appendCommand(String alias, String description, String insertion) { if (!first) { getContents().append(Component.newline()); } - getContents().append(TextComponent.of(alias, TextColor.GOLD).append(TextComponent.of(": "))); + TextComponent commandName = TextComponent.of(alias, TextColor.GOLD); + if (insertion != null) { + commandName = commandName + .clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, insertion)) + .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to select"))); + } + getContents().append(commandName.append(TextComponent.of(": "))); getContents().append(TextComponent.of(description)); first = false; return this; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java index 13eee701c..e15d862cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java @@ -39,7 +39,7 @@ import javax.annotation.Nullable; /** * A box to describe usage of a command. */ -public class CommandUsageBox extends TextComponent { +public class CommandUsageBox extends TextComponentProducer { /** * Create a new usage box. @@ -59,7 +59,6 @@ public class CommandUsageBox extends TextComponent { * @param locals list of locals to use */ public CommandUsageBox(CommandCallable command, String commandString, @Nullable CommandLocals locals) { - super(builder()); checkNotNull(command); checkNotNull(commandString); if (command instanceof Dispatcher) { @@ -82,18 +81,17 @@ public class CommandUsageBox extends TextComponent { } } - append(box); + append(box.create()); } private void attachCommandUsage(Description description, String commandString) { - MessageBox box = new MessageBox("Help for " + commandString); - Component contents = box.getContents(); + TextComponentProducer contents = new TextComponentProducer(); if (description.getUsage() != null) { - contents.append(new Label("Usage: ")); + contents.append(new Label("Usage: ").create()); contents.append(TextComponent.of(description.getUsage())); } else { - contents.append(new Subtle("Usage information is not available.")); + contents.append(new Subtle("Usage information is not available.").create()); } contents.append(Component.newline()); @@ -103,10 +101,11 @@ public class CommandUsageBox extends TextComponent { } else if (description.getDescription() != null) { contents.append(TextComponent.of(description.getDescription())); } else { - contents.append(new Subtle("No further help is available.")); + contents.append(new Subtle("No further help is available.").create()); } - append(box); + MessageBox box = new MessageBox("Help for " + commandString, contents); + append(box.create()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java index 52d9d7044..50cef22f2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java @@ -19,19 +19,18 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing an error. */ -public class Error extends TextComponent { +public class Error extends TextComponentProducer { /** * Create a new instance. */ public Error(String message) { - super(builder(message).color(TextColor.RED)); + getBuilder().content(message).color(TextColor.RED); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java index a38adc7bb..02d438f8d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java @@ -19,19 +19,18 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing a label. */ -public class Label extends TextComponent { +public class Label extends TextComponentProducer { /** * Create a new instance. */ public Label(String message) { - super(builder(message).color(TextColor.YELLOW)); + getBuilder().content(message).color(TextColor.YELLOW); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java index b32c00995..5193f0e6b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java @@ -28,17 +28,16 @@ import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Makes for a box with a border above and below. */ -public class MessageBox extends TextComponent { +public class MessageBox extends TextComponentProducer { - public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH = 47; + private static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH = 47; - private final Component contents = Component.empty(); + private final TextComponentProducer contents; /** * Create a new box. */ - public MessageBox(String title) { - super(builder()); + public MessageBox(String title, TextComponentProducer contents) { checkNotNull(title); int leftOver = GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH - title.length() - 2; @@ -54,7 +53,7 @@ public class MessageBox extends TextComponent { append(TextComponent.of(createBorder(rightSide), TextColor.YELLOW)); } append(Component.newline()); - append(contents); + this.contents = contents; } private String createBorder(int count) { @@ -66,12 +65,17 @@ public class MessageBox extends TextComponent { } /** - * Get the internal contents. + * Gets the message box contents producer. * - * @return the contents + * @return The contents producer */ - public Component getContents() { + public TextComponentProducer getContents() { return contents; } + @Override + public TextComponent create() { + append(contents.create()); + return super.create(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java index a512138d4..609824838 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java @@ -19,19 +19,18 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a subtle part of the message. */ -public class Subtle extends TextComponent { +public class Subtle extends TextComponentProducer { /** * Create a new instance. */ public Subtle(String message) { - super(builder(message).color(TextColor.GRAY)); + getBuilder().color(TextColor.GRAY).content(message); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java new file mode 100644 index 000000000..2c3228ee2 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java @@ -0,0 +1,47 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.util.formatting.component; + +import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; + +public class TextComponentProducer { + + private TextComponent.Builder builder = TextComponent.builder().content(""); + + public TextComponent.Builder getBuilder() { + return builder; + } + + /** + * Adds a component as a child to this Producer + * + * @param component The component + * @return The producer, for chaining + */ + public TextComponentProducer append(Component component) { + getBuilder().append(component); + return this; + } + + public TextComponent create() { + return builder.build(); + } +} diff --git a/worldedit-libs/build.gradle b/worldedit-libs/build.gradle index f0a2359b5..b05c601e8 100644 --- a/worldedit-libs/build.gradle +++ b/worldedit-libs/build.gradle @@ -102,12 +102,12 @@ project("core") { } project("bukkit") { dependencies { - shade 'net.kyori:text-adapter-bukkit:1.0.3' + shade 'net.kyori:text-adapter-bukkit:2.0.0-SNAPSHOT' } } project("sponge") { dependencies { - shade 'net.kyori:text-adapter-spongeapi:1.0.3' + shade 'net.kyori:text-adapter-spongeapi:2.0.0-SNAPSHOT' } } From 0434bcf48cd1eaa32eed5f841d0ffe7a8cff3354 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 22 Apr 2019 23:59:31 +1000 Subject: [PATCH 18/24] Remove unnecessary gradle entries --- build.gradle | 1 - worldedit-forge/build.gradle | 1 - 2 files changed, 2 deletions(-) diff --git a/build.gradle b/build.gradle index 63b4d9537..41de17bb8 100644 --- a/build.gradle +++ b/build.gradle @@ -85,7 +85,6 @@ subprojects { repositories { mavenCentral() maven { url "http://maven.sk89q.com/repo/" } - maven { url "http://repo.maven.apache.org/maven2" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } } } diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index d398d05d1..2cbab094f 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -19,7 +19,6 @@ def forgeVersion = "25.0.76" dependencies { compile project(':worldedit-core') compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.2' - compile 'net.kyori:text-serializer-gson:2.0.0' minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}" From 6415d0d9645b7520d1dd21158acf605b5bd33040 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sun, 21 Apr 2019 05:09:51 +0200 Subject: [PATCH 19/24] Fix typo --- .../java/com/sk89q/worldedit/function/mask/NoiseFilter.java | 2 +- .../java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java index ee9b6e44d..c870d4786 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java @@ -80,7 +80,7 @@ public class NoiseFilter extends AbstractMask { */ public void setDensity(double density) { checkArgument(density >= 0, "density must be >= 0"); - checkArgument(density <= 1, "density must be >= 1"); + checkArgument(density <= 1, "density must be <= 1"); this.density = density; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java index a64889f54..f7a2c992e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java @@ -78,7 +78,7 @@ public class NoiseFilter2D extends AbstractMask2D { */ public void setDensity(double density) { checkArgument(density >= 0, "density must be >= 0"); - checkArgument(density <= 1, "density must be >= 1"); + checkArgument(density <= 1, "density must be <= 1"); this.density = density; } From 5606e752c2ead3f3904d1c45afb48f6388409f78 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 25 Apr 2019 19:11:58 +1000 Subject: [PATCH 20/24] Use wrappers for the Format-type components --- config/checkstyle/import-control.xml | 1 - .../worldedit/command/SelectionCommands.java | 4 ++-- .../worldedit/command/UtilityCommands.java | 19 ++++++++------- .../component/{Code.java => CodeFormat.java} | 24 ++++++++++++++----- .../formatting/component/CommandListBox.java | 5 ++-- .../formatting/component/CommandUsageBox.java | 13 +++++----- .../{Error.java => ErrorFormat.java} | 21 +++++++++++++--- .../{Label.java => LabelFormat.java} | 21 +++++++++++++--- .../util/formatting/component/MessageBox.java | 4 ++-- .../{Subtle.java => SubtleFormat.java} | 21 +++++++++++++--- .../component/TextComponentProducer.java | 23 +++++++++++++++++- 11 files changed, 117 insertions(+), 39 deletions(-) rename worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/{Code.java => CodeFormat.java} (66%) rename worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/{Error.java => ErrorFormat.java} (65%) rename worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/{Label.java => LabelFormat.java} (65%) rename worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/{Subtle.java => SubtleFormat.java} (65%) diff --git a/config/checkstyle/import-control.xml b/config/checkstyle/import-control.xml index b4a2f4808..28ccad1e4 100644 --- a/config/checkstyle/import-control.xml +++ b/config/checkstyle/import-control.xml @@ -16,7 +16,6 @@ - diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index cd15be1ff..3c1be05fd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -56,7 +56,7 @@ import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.Countable; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.formatting.component.CommandListBox; -import com.sk89q.worldedit.util.formatting.component.Subtle; +import com.sk89q.worldedit.util.formatting.component.SubtleFormat; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; @@ -755,7 +755,7 @@ public class SelectionCommands { } else { CommandListBox box = new CommandListBox("Selection modes"); TextComponentProducer contents = box.getContents(); - contents.append(new Subtle("Select one of the modes below:").append(Component.newline()).create()); + contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline(); box.appendCommand("cuboid", "Select two corners of a cuboid", "//sel cuboid"); box.appendCommand("extend", "Fast cuboid selection mode", "//sel extend"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index bd0c8ba53..2e2defc19 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -58,14 +58,15 @@ import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; import com.sk89q.worldedit.util.command.binding.Text; -import com.sk89q.worldedit.util.formatting.component.Code; +import com.sk89q.worldedit.util.formatting.component.CodeFormat; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; -import com.sk89q.worldedit.util.formatting.component.Error; -import com.sk89q.worldedit.util.formatting.component.Subtle; +import com.sk89q.worldedit.util.formatting.component.ErrorFormat; +import com.sk89q.worldedit.util.formatting.component.SubtleFormat; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockTypes; @@ -671,17 +672,19 @@ public class UtilityCommands { // Box CommandListBox box = new CommandListBox(String.format("Help: page %d/%d ", page + 1, pageTotal)); - TextComponentProducer tip = new Subtle(""); + TextComponentProducer tip = new TextComponentProducer(); + tip.getBuilder().content("").color(TextColor.GRAY); TextComponentProducer contents = box.getContents(); if (offset >= aliases.size()) { - tip.append(new Error(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal)).create()).append(Component.newline()); + tip.append(ErrorFormat.wrap(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal))).newline(); } else { List list = aliases.subList(offset, Math.min(offset + perPage, aliases.size())); - tip.append(TextComponent.of("Type ")); - tip.append(new Code("//help ").append(TextComponent.of(" []")).create()); - tip.append(TextComponent.of(" for more information.")).append(Component.newline()); + tip.append("Type "); + tip.append(CodeFormat.wrap("//help ")); + tip.append(" [] for more information."); + tip.newline(); // Add each command for (CommandMapping mapping : list) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CodeFormat.java similarity index 66% rename from worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CodeFormat.java index 6cbad7f3a..134239546 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Code.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CodeFormat.java @@ -19,18 +19,30 @@ package com.sk89q.worldedit.util.formatting.component; +import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing a command that is to be typed. */ -public class Code extends TextComponentProducer { +public class CodeFormat extends TextComponentProducer { - /** - * Create a new instance. - */ - public Code(String message) { - getBuilder().content(message).color(TextColor.AQUA); + private CodeFormat() { + getBuilder().content("").color(TextColor.AQUA); } + /** + * Creates a CodeFormat with the given message. + * + * @param texts The text + * @return The Component + */ + public static Component wrap(String ... texts) { + CodeFormat code = new CodeFormat(); + for (String text: texts) { + code.append(text); + } + + return code.create(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java index 846d08853..ac360e99c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java @@ -19,7 +19,6 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; @@ -44,7 +43,7 @@ public class CommandListBox extends MessageBox { public CommandListBox appendCommand(String alias, String description, String insertion) { if (!first) { - getContents().append(Component.newline()); + getContents().newline(); } TextComponent commandName = TextComponent.of(alias, TextColor.GOLD); if (insertion != null) { @@ -53,7 +52,7 @@ public class CommandListBox extends MessageBox { .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to select"))); } getContents().append(commandName.append(TextComponent.of(": "))); - getContents().append(TextComponent.of(description)); + getContents().append(description); first = false; return this; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java index e15d862cc..04a31df3b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java @@ -29,7 +29,6 @@ import com.sk89q.worldedit.util.command.Description; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; import com.sk89q.worldedit.util.formatting.text.Component; -import com.sk89q.worldedit.util.formatting.text.TextComponent; import java.util.ArrayList; import java.util.List; @@ -88,20 +87,20 @@ public class CommandUsageBox extends TextComponentProducer { TextComponentProducer contents = new TextComponentProducer(); if (description.getUsage() != null) { - contents.append(new Label("Usage: ").create()); - contents.append(TextComponent.of(description.getUsage())); + contents.append(LabelFormat.wrap("Usage: ")); + contents.append(description.getUsage()); } else { - contents.append(new Subtle("Usage information is not available.").create()); + contents.append(SubtleFormat.wrap("Usage information is not available.")); } contents.append(Component.newline()); if (description.getHelp() != null) { - contents.append(TextComponent.of(description.getHelp())); + contents.append(description.getHelp()); } else if (description.getDescription() != null) { - contents.append(TextComponent.of(description.getDescription())); + contents.append(description.getDescription()); } else { - contents.append(new Subtle("No further help is available.").create()); + contents.append(SubtleFormat.wrap("No further help is available.")); } MessageBox box = new MessageBox("Help for " + commandString, contents); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/ErrorFormat.java similarity index 65% rename from worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/ErrorFormat.java index 50cef22f2..b30ad8324 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Error.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/ErrorFormat.java @@ -19,18 +19,33 @@ package com.sk89q.worldedit.util.formatting.component; +import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing an error. */ -public class Error extends TextComponentProducer { +public class ErrorFormat extends TextComponentProducer { /** * Create a new instance. */ - public Error(String message) { - getBuilder().content(message).color(TextColor.RED); + private ErrorFormat() { + getBuilder().content("").color(TextColor.RED); } + /** + * Creates an ErrorFormat with the given message. + * + * @param texts The text + * @return The Component + */ + public static Component wrap(String ... texts) { + ErrorFormat error = new ErrorFormat(); + for (String component : texts) { + error.append(component); + } + + return error.create(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/LabelFormat.java similarity index 65% rename from worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/LabelFormat.java index 02d438f8d..4dda69349 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Label.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/LabelFormat.java @@ -19,18 +19,33 @@ package com.sk89q.worldedit.util.formatting.component; +import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a fragment representing a label. */ -public class Label extends TextComponentProducer { +public class LabelFormat extends TextComponentProducer { /** * Create a new instance. */ - public Label(String message) { - getBuilder().content(message).color(TextColor.YELLOW); + private LabelFormat() { + getBuilder().content("").color(TextColor.YELLOW); } + /** + * Creates a LabelFormat with the given message. + * + * @param texts The text + * @return The Component + */ + public static Component wrap(String ... texts) { + LabelFormat label = new LabelFormat(); + for (String component : texts) { + label.append(component); + } + + return label.create(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java index 5193f0e6b..6828589bc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java @@ -47,12 +47,12 @@ public class MessageBox extends TextComponentProducer { append(TextComponent.of(createBorder(leftSide), TextColor.YELLOW)); } append(Component.space()); - append(TextComponent.of(title)); + append(title); append(Component.space()); if (rightSide > 0) { append(TextComponent.of(createBorder(rightSide), TextColor.YELLOW)); } - append(Component.newline()); + newline(); this.contents = contents; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SubtleFormat.java similarity index 65% rename from worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java rename to worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SubtleFormat.java index 609824838..5987675f7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/Subtle.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SubtleFormat.java @@ -19,18 +19,33 @@ package com.sk89q.worldedit.util.formatting.component; +import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** * Represents a subtle part of the message. */ -public class Subtle extends TextComponentProducer { +public class SubtleFormat extends TextComponentProducer { /** * Create a new instance. */ - public Subtle(String message) { - getBuilder().color(TextColor.GRAY).content(message); + private SubtleFormat() { + getBuilder().content("").color(TextColor.GRAY); } + /** + * Creates a SubtleFormat with the given message. + * + * @param texts The text + * @return The Component + */ + public static Component wrap(String ... texts) { + SubtleFormat subtle = new SubtleFormat(); + for (String component : texts) { + subtle.append(component); + } + + return subtle.create(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java index 2c3228ee2..32a9f8d30 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java @@ -31,7 +31,7 @@ public class TextComponentProducer { } /** - * Adds a component as a child to this Producer + * Adds a component as a child to this Producer. * * @param component The component * @return The producer, for chaining @@ -41,6 +41,27 @@ public class TextComponentProducer { return this; } + /** + * Adds a string as a child to this Producer. + * + * @param string The text + * @return The producer, for chaining + */ + public TextComponentProducer append(String string) { + getBuilder().append(TextComponent.of(string)); + return this; + } + + /** + * Adds a newline as a child to this Producer. + * + * @return The producer, for chaining + */ + public TextComponentProducer newline() { + getBuilder().append(Component.newline()); + return this; + } + public TextComponent create() { return builder.build(); } From b1e43b7561906c9cbab24b04095b314412353bbe Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 25 Apr 2019 19:20:29 +1000 Subject: [PATCH 21/24] wrap to TextComponent --- .../sk89q/worldedit/util/formatting/component/CodeFormat.java | 4 ++-- .../worldedit/util/formatting/component/ErrorFormat.java | 4 ++-- .../worldedit/util/formatting/component/LabelFormat.java | 4 ++-- .../worldedit/util/formatting/component/SubtleFormat.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CodeFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CodeFormat.java index 134239546..a92590bac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CodeFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CodeFormat.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** @@ -37,7 +37,7 @@ public class CodeFormat extends TextComponentProducer { * @param texts The text * @return The Component */ - public static Component wrap(String ... texts) { + public static TextComponent wrap(String ... texts) { CodeFormat code = new CodeFormat(); for (String text: texts) { code.append(text); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/ErrorFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/ErrorFormat.java index b30ad8324..35343ca56 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/ErrorFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/ErrorFormat.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** @@ -40,7 +40,7 @@ public class ErrorFormat extends TextComponentProducer { * @param texts The text * @return The Component */ - public static Component wrap(String ... texts) { + public static TextComponent wrap(String ... texts) { ErrorFormat error = new ErrorFormat(); for (String component : texts) { error.append(component); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/LabelFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/LabelFormat.java index 4dda69349..f0a487114 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/LabelFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/LabelFormat.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** @@ -40,7 +40,7 @@ public class LabelFormat extends TextComponentProducer { * @param texts The text * @return The Component */ - public static Component wrap(String ... texts) { + public static TextComponent wrap(String ... texts) { LabelFormat label = new LabelFormat(); for (String component : texts) { label.append(component); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SubtleFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SubtleFormat.java index 5987675f7..310cc4e01 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SubtleFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SubtleFormat.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit.util.formatting.component; -import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; /** @@ -40,7 +40,7 @@ public class SubtleFormat extends TextComponentProducer { * @param texts The text * @return The Component */ - public static Component wrap(String ... texts) { + public static TextComponent wrap(String ... texts) { SubtleFormat subtle = new SubtleFormat(); for (String component : texts) { subtle.append(component); From 4f5f9c8a5df016734b4500c28864984a47eb6104 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 25 Apr 2019 19:38:32 +1000 Subject: [PATCH 22/24] Add forge support to the text system. --- .../java/com/sk89q/worldedit/forge/ForgePlayer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 5dc11aaf6..edc5275ab 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -31,10 +31,11 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.serializer.gson.GsonComponentSerializer; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; - -import com.sk89q.worldedit.util.formatting.text.TextComponent; +import io.netty.buffer.Unpooled; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; @@ -43,6 +44,7 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; @@ -50,8 +52,6 @@ import java.util.UUID; import javax.annotation.Nullable; -import io.netty.buffer.Unpooled; - public class ForgePlayer extends AbstractPlayerActor { private final EntityPlayerMP player; @@ -144,7 +144,7 @@ public class ForgePlayer extends AbstractPlayerActor { @Override public void print(TextComponent component) { - // TODO + this.player.sendMessage(ITextComponent.Serializer.fromJson(GsonComponentSerializer.INSTANCE.serialize(component))); } private void sendColorized(String msg, TextFormatting formatting) { From f70557e3dac50d7796c0d24869275c84278378d4 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 25 Apr 2019 22:48:15 +1000 Subject: [PATCH 23/24] Provide a warning when an invalid property is entered rather than failing. Fixes WorldEdit entirely failing on new MC versions. --- .../bukkit/adapter/BukkitImplLoader.java | 2 +- .../factory/parser/DefaultBlockParser.java | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java index a03a9f229..612290995 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java @@ -52,7 +52,7 @@ public class BukkitImplLoader { "**\n" + "** When working with blocks or undoing, chests will be empty, signs\n" + "** will be blank, and so on. There will be no support for entity\n" + - "** and biome-related functions.\n" + + "** and block property-related functions.\n" + "**\n" + "** Please see http://wiki.sk89q.com/wiki/WorldEdit/Bukkit_adapters\n" + "**********************************************\n"; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java index 4f3793adb..72bf195da 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser; +import com.google.common.collect.Maps; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.NotABlockException; import com.sk89q.worldedit.WorldEdit; @@ -38,6 +39,7 @@ import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.HandSide; +import com.sk89q.worldedit.util.formatting.component.ErrorFormat; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; @@ -148,7 +150,7 @@ public class DefaultBlockParser extends InputParser { } } - private static Map, Object> parseProperties(BlockType type, String[] stateProperties) throws NoMatchException { + private static Map, Object> parseProperties(BlockType type, String[] stateProperties, ParserContext context) throws NoMatchException { Map, Object> blockStates = new HashMap<>(); if (stateProperties.length > 0) { // Block data not yet detected @@ -163,7 +165,14 @@ public class DefaultBlockParser extends InputParser { @SuppressWarnings("unchecked") Property propertyKey = (Property) type.getPropertyMap().get(parts[0]); if (propertyKey == null) { - throw new NoMatchException("Unknown property " + parts[0] + " for block " + type.getName()); + if (context.getActor() != null) { + context.getActor().print(ErrorFormat.wrap("Unknown property ", parts[0], " for block ", type.getName(), + ". Defaulting to base.")); + } else { + WorldEdit.logger.warn("Unknown property " + parts[0] + " for block " + type.getName()); +// throw new NoMatchException("Unknown property " + parts[0] + " for block " + type.getName()); + } + return Maps.newHashMap(); } if (blockStates.containsKey(propertyKey)) { throw new NoMatchException("Duplicate property " + parts[0]); @@ -222,7 +231,7 @@ public class DefaultBlockParser extends InputParser { typeString = blockAndExtraData[0].substring(0, stateStart); stateString = blockAndExtraData[0].substring(stateStart + 1, blockAndExtraData[0].length() - 1); } - if (typeString == null || typeString.isEmpty()) { + if (typeString.isEmpty()) { throw new InputParseException("Invalid format"); } String[] stateProperties = EMPTY_STRING_ARRAY; @@ -270,7 +279,7 @@ public class DefaultBlockParser extends InputParser { } } - blockStates.putAll(parseProperties(blockType, stateProperties)); + blockStates.putAll(parseProperties(blockType, stateProperties, context)); if (!context.isPreferringWildcard()) { // No wildcards allowed => eliminate them. (Start with default state) From c325b789b2588e9ce303cc5e10ca5752156d5135 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 25 Apr 2019 23:15:09 +1000 Subject: [PATCH 24/24] Revert lighting changes and add a 1.14 adapter --- .../bukkit/adapter/impl/Spigot_v1_13_R1.class | Bin 25386 -> 25466 bytes .../bukkit/adapter/impl/Spigot_v1_13_R2.class | Bin 25408 -> 25488 bytes .../adapter/impl/Spigot_v1_13_R2_2$1.class | Bin 965 -> 965 bytes .../adapter/impl/Spigot_v1_13_R2_2.class | Bin 25474 -> 25554 bytes .../adapter/impl/Spigot_v1_14_R1$1.class | Bin 0 -> 959 bytes .../bukkit/adapter/impl/Spigot_v1_14_R1.class | Bin 0 -> 25746 bytes .../com/sk89q/worldedit/forge/ForgeWorld.java | 2 +- 7 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_14_R1$1.class create mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_14_R1.class diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class index 3890dc4793417efa709a1ca275a10fa7aa4524cc..31b547024c5440aee3a7372b5abbb9891a6239e6 100644 GIT binary patch delta 7848 zcmZu$33wDm)2?H7dow#Z2n4b~5(0r78?Jz$L2g9k5=4X`HzI;4ilE}P;C+h@DiJ|Y z5JeOux|$u<4HV~fLT~&2y8+kQ4<@o0_4-CUyNjI3Q&R}J3v80P68!T zk{XlMm|{~MO0X%F>Z+(`QySH`VH!2iR=Q0giZryLF*P#OSf3fH%2Z>P3K`IZvTbTg z%?#z}v$={EDsoli1u35jYzkAM4b7;fp;k78skKdQsI8$Q8(L{dS=3HNdqZd0)PXvx zI9vOiV@If%IwiolbZ(G3Qx}`MQa4>mcbj@pPeZ+Iv7M*3-r71}{q(VA&;^G2+R%gg zsiuDbFEKR0hTb$#=A;V)I6QzQY8s^T3|4Vb0%p??8^+Vc2{e>0Q86r{a=3~T6(dw! z8l;glDoCSgOpwOXI2Gd!O$fpWy3EkTAdIBTZJI<^sAjUEDTb~zG*zd&%Fxw@rrB^A zU6Tqx*V}Xh-57)^G|SLUiqy@9Zn0r1-KuN4En+C5<7TUvW9W99?w~tum`-=8xZ9?C z1Q4;^t6%#i(0z1&5EjxH4f6ptJg6J-kcx*@JfdQ*ibr(|A4?#Y=IKb3Pi62X%(%u=~Y^ztujNe+3=+Hc|8@FUa{dB{Sq@&Zo_lhtO(Fr8zL!GX~Qzg zP|V*j^rj6fXk7xWrwxWS+O$b2w@E3tNhk*|(`K9AqPGogv7wB%8hXcu*M(z(#=9!E z*-%998G7H)b{p2x4jU?Ir=eYjcH6Ly_SmqV_8R)Y(1$i`qR2-!Y^IM5ePZZS8@A9s z8@AGZL!T*`4%o1b1{(U@&_Nrv(-$`EphJefG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7)Y6mm)ptNso#2Xqdi=(AOeODxrjOI$oGtM&B?+ z=vxtfS3`?uhG+7L92NymGQO^Rq%G& z2Y|j0XddI8cqP7z{^8x2_6?5ZH$e+~ImmBu4)4R=cRzBEcepRVi`@PIkK%(oh2KM} z{ytxiS0njAuVf{CaN@todlCE{fy}pXHu=C%1Nm(UdE_F!pld%!!=X?*)V(XP=O@kr z7PSKy%+)jy9eS{O=zAC{G|-q5{AVcLKdYQjGth5M1Zqu!T)p+OqCc=A)YBM$e;&(Kd(Dl)ypkXbmX zWBGGFf}oZwk+5jA{}-r5+rF$i*i%VWw#07uz2x<%;bXWR9RpFxG2Q}$ZJ?|re?_bK zYq$^ZdWAgPPNTCzzn{B@2uFCAkbG3C?jV*&6W$$UVvaC|clG!KTpFfBNg!+~ zp`>!!EHSesOn-*yuL%7u4O_ins*r}QVLBP1e?+>&>;Ae(cOauW6{gb>IwLK6yq4Y4 zvL{THVT2lcjJDTn=r0X>!>q!rBQ!up?DuBaCk^|~7(u1D#fJhI9*&kse(nBTG zy_{kSBODM~JTy2z%%PZQo_OvCmR8M+e-!ut6XeDH!fcONRe9Jm_K3HX&qeoeibE_WDP$T-Q6`=p719l5 z(PhdhTzr#uHRJ&r=yZU)ARaRVFV|4S9`f z#4oAFyjC?m8!932N&LkOld)$*UF`q3m8>~fMgB`GB(C6tup@eX31Pyqv zS)~E*2EDfUY7M|&a3iPwSJ5r!DT=RFgjc3jiblg(l3wJNbKSGqW-YD zEs7b*!Xupi+JDxX?@f_Rb3HxYjT}8F*Sn=lKKPe6;BRh#X9GAfQ<~!g_yzw;zTc0Z y$@LDst6R|OX7#qZ17fq$jC@HI<2UR%>RL6|t1VU~>T$2OM!lrgRMjGC&Hn&(9T@Wf diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_14_R1$1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_14_R1$1.class new file mode 100644 index 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Nb zn4eYTK#EYKm>K7Mkot-t^%aB3%L4k9I6HAJ=wer(zh*jKm5$fq+%L}kyLfv~qCO*9dTk|$V^c~omcTp^OkM_dvY5YC}^8=I}{*7wZht$X)(Q5vfPUTPN=lm%G zu+JbspVJNe1>MR2q5JqtlnTD0myxx+Z{+2cVSqF!=aUrtyp^AB`Qe3Gt&s7%B zQ#rgq<#Jfryi(=yDJq}OP!6B33iv|Rk8e`_`DQhMZ&8IwMVban_&V}P3l?XdiHj9a zg<8A;I&x6Wo`SZgA<{$Ps-FX08g@^?3jNDip(hgxhwsQfj2WI4lBC{)`!;wXwr77D zock>mdy(*0wEtJc!-|Ft8&*_gED{vz9b=L9{t_L-icpq&7ykf-9BFuZ1bxRn57D!- z9v-?Gg%(PsPe{(d_NXDrt0y=>@B<=1z{!XYp~8nSFbM&MdK2&78%}co&cGxb9L)G| zmVs3gag6Qe;fdgLFz*2YDKjB7UIz0BPhQSNNZ!RG@51mv4Vp)oCA^ShtjX*#0RIk# zWcv)HaTJt9I#qM$J$s=_!CH2%sbCA7Tx5rzf>;e{l661lz43b#c4Cxt56r{ANpT$i zG#CHWgMM5;c}U1Q!dhZ2qLA7R-N-dn5&nsWA!?`^X5QLWhl-iEi`6CSQonZtMtI{k Ht0DgnnvVvQ literal 0 HcmV?d00001 diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 152b1ac7d..3aadc12cc 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -178,7 +178,7 @@ public class ForgeWorld extends AbstractWorld { } if (successful && notifyAndLight) { - //world.checkLight(pos); + world.checkLight(pos); world.markAndNotifyBlock(pos, chunk, old, newState, UPDATE | NOTIFY); }