Skip to content

Commit

Permalink
use newline fixing for item lore and sign_contents
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 5, 2020
1 parent 301e8d6 commit 77c6264
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Expand Up @@ -3307,6 +3307,7 @@ && getBlockState() instanceof CreatureSpawner) {
state.setLine(i, "");
}
ListTag list = mechanism.valueAsType(ListTag.class);
CoreUtilities.fixNewLinesToListSeparation(list);
if (list.size() > 4) {
Debug.echoError("Sign can only hold four lines!");
}
Expand Down
Expand Up @@ -146,11 +146,12 @@ public static void registermainProperties() {
// register core MaterialTag properties
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13)) {
PropertyParser.registerProperty(MaterialAge.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialDrags.class, MaterialTag.class);
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_14)) {
PropertyParser.registerProperty(MaterialCampfire.class, MaterialTag.class);
}
PropertyParser.registerProperty(MaterialCount.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialDirectional.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialDrags.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialFaces.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialHalf.class, MaterialTag.class);
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_14)) {
Expand All @@ -160,7 +161,6 @@ public static void registermainProperties() {
PropertyParser.registerProperty(MaterialLightable.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialMode.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialPersistent.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialCount.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialSlab.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialSnowable.class, MaterialTag.class);
PropertyParser.registerProperty(MaterialSwitchable.class, MaterialTag.class);
Expand Down
Expand Up @@ -134,6 +134,7 @@ public void adjust(Mechanism mechanism) {
if (mechanism.matches("lore")) {
ItemMeta meta = item.getItemStack().getItemMeta();
ListTag lore = mechanism.valueAsType(ListTag.class);
CoreUtilities.fixNewLinesToListSeparation(lore);
if (item.isItemscript()) {
if (!Settings.packetInterception()) {
lore.add(0, ItemScriptHelper.createItemScriptID(item.getScriptName()));
Expand Down
Expand Up @@ -8,6 +8,7 @@
import com.denizenscript.denizencore.objects.properties.Property;
import com.denizenscript.denizencore.tags.Attribute;
import com.denizenscript.denizencore.tags.core.EscapeTagBase;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.block.Sign;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;
Expand Down Expand Up @@ -107,6 +108,7 @@ public void adjust(Mechanism mechanism) {
sign.setLine(i, "");
}
ListTag list = mechanism.valueAsType(ListTag.class);
CoreUtilities.fixNewLinesToListSeparation(list);
if (list.size() > 4) {
Debug.echoError("Sign can only hold four lines!");
}
Expand Down

0 comments on commit 77c6264

Please sign in to comment.