From 01a42b66b30dd80997b9a5cfce67a39fde9f955a Mon Sep 17 00:00:00 2001 From: dags- Date: Tue, 1 May 2018 11:26:51 +0100 Subject: [PATCH] and the rest --- build.gradle | 2 +- src/main/java/me/dags/textmu/MUParser.java | 4 +--- src/main/java/me/dags/textmu/MarkupPerms.java | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index ad46947..c0ebac5 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens apply plugin: 'java' group 'me.dags' -version '1.0' +version '0.2' def spongeAPI = '7.1.0' def spongeChannel = 'SNAPSHOT' diff --git a/src/main/java/me/dags/textmu/MUParser.java b/src/main/java/me/dags/textmu/MUParser.java index 14d854b..a415d0d 100644 --- a/src/main/java/me/dags/textmu/MUParser.java +++ b/src/main/java/me/dags/textmu/MUParser.java @@ -1,6 +1,5 @@ package me.dags.textmu; -import com.sun.istack.internal.Nullable; import org.spongepowered.api.text.Text; import javax.annotation.Nonnull; @@ -128,7 +127,6 @@ private Text.Builder nextText(boolean root) { * Ends on the close brace ')' * returns null if syntax is incorrect/incomplete */ - @Nullable private Text.Builder nextStatement() { // parse params `[..]` List params = nextParams(); @@ -236,7 +234,7 @@ private Text.Builder appendPlainText(Text.Builder builder) { /** * Adds the 'other' Builder to the main one, lazily creating the main Builder if null */ - private Text.Builder append(@Nullable Text.Builder builder, @Nonnull Text.Builder other) { + private Text.Builder append(Text.Builder builder, @Nonnull Text.Builder other) { if (builder == null) { // lazy create builder builder = Text.builder(); diff --git a/src/main/java/me/dags/textmu/MarkupPerms.java b/src/main/java/me/dags/textmu/MarkupPerms.java index 634bc91..579f30d 100644 --- a/src/main/java/me/dags/textmu/MarkupPerms.java +++ b/src/main/java/me/dags/textmu/MarkupPerms.java @@ -2,6 +2,8 @@ import com.google.common.base.Preconditions; import com.google.common.reflect.TypeToken; +import java.util.HashMap; +import java.util.Map; import ninja.leaping.configurate.ConfigurationNode; import ninja.leaping.configurate.objectmapping.ObjectMappingException; import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer; @@ -14,9 +16,6 @@ import org.spongepowered.api.text.format.TextColor; import org.spongepowered.api.text.format.TextStyle; -import java.util.HashMap; -import java.util.Map; - /** * @author dags */ @@ -137,7 +136,8 @@ public void registerActionPermissions(Object plugin, TextTemplate template) { private void registerPermission(PermissionService service, Object plugin, String node, Text description) { if (!service.getDescription(node).isPresent()) { - service.newDescriptionBuilder(plugin).ifPresent(builder -> builder.id(node).description(description).register()); + service.newDescriptionBuilder(plugin) + .id(node).description(description).register(); } }