Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch upstream #1

Merged
merged 63 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a3282a7
Introduce a method by which to directly insert raw replacements.
mbax Dec 29, 2021
0fac57b
chore: Remove parse method
kezz Jan 12, 2022
83ca5ee
text-minimessage: Update tests for parse -> deserialize
zml2008 Jan 13, 2022
7bda0a4
Merge pull request #663 from KyoriPowered/chore/yeet-parse
zml2008 Jan 13, 2022
72a4f5c
Merge pull request #657 from mbax/gordonRamsayItsRaw.gif
zml2008 Jan 13, 2022
9ebd771
text-minimessage: Some cleanup
kashike Jan 16, 2022
6395501
text-minimessage: Add a builder for PlaceholderResolvers
zml2008 Jan 13, 2022
e828094
text-minimessage: Make defensive copies of placeholders passed to res…
zml2008 Jan 13, 2022
65314a2
Merge pull request #665 from KyoriPowered/feature/placeholder-resolve…
zml2008 Jan 16, 2022
096a944
Cleanup examination implementations
kashike Jan 15, 2022
1e681b0
oui
kashike Jan 21, 2022
c2a72a6
build: Suppress Javadoc style errors in internal package
zml2008 Jan 21, 2022
420d998
chore: Rename some static constructer methods
KingOfSquares Dec 22, 2021
4a7f56d
Merge pull request #652 from KingOfSquares/remove-remaining-of
zml2008 Jan 22, 2022
935f846
Update gradle and github actions
renovate-bot Feb 1, 2022
971fb9b
Merge branch 'origin/renovate/gradle-and-github-actions'
zml2008 Feb 4, 2022
4fb2dad
build: update indra to 2.1.0
zml2008 Jan 5, 2022
5970ee4
build: Run tests on Java 17, not 16
zml2008 Jan 29, 2022
502147d
build: Update checkstyle version
zml2008 Jan 29, 2022
6ee5b63
build: Modernize GH Actions workflow
zml2008 Feb 4, 2022
d728136
build: Use checkstyle 9.3
zml2008 Feb 4, 2022
52f6cd5
build: Suppress target version mismatch in build-logic
zml2008 Feb 4, 2022
41d2a9d
Merge pull request #670 from KyoriPowered/feature/indra-update
zml2008 Feb 4, 2022
2734f2a
text-minimessage: Use a Consumer rather than Appendable for debug output
zml2008 Feb 4, 2022
d1d46d0
text-minimessage: Clarify documentation
zml2008 Feb 5, 2022
893e46f
Merge pull request #671 from KyoriPowered/feature/no-longer-appendable
zml2008 Feb 5, 2022
c20f83a
build: Publish with new branch name
zml2008 Feb 5, 2022
bb524cd
feat(api): Internal configuration
kashike Dec 21, 2021
332aa5c
Merge pull request #650 from KyoriPowered/feature/internal-config
kashike Feb 5, 2022
22f8eca
api: misc. cleanup
kashike Jan 23, 2022
112d45a
api: Remove unused import
zml2008 Feb 7, 2022
2e0d1d5
minimessage: Unify transformations and placeholders
zml2008 Jan 23, 2022
fc495ae
text-minimessage: Clean up use of ParsingException
zml2008 Feb 7, 2022
c824c7a
text-minimessage: Add full implementations of Tag classes rather than…
zml2008 Feb 7, 2022
28c1fb4
text-minimessage: Move resolvers into their own package
zml2008 Feb 7, 2022
0df082c
text-minimessage: Begin exposing the node tree to API
zml2008 Feb 7, 2022
e1ae089
text-minimessage: Clean up TagResolver creation
zml2008 Feb 10, 2022
cc621ad
text-minimessage: Add helper methods to Tag.Argument
zml2008 Feb 10, 2022
6738fb9
text-minimessage: Add ArgumentQueue for arg handling
zml2008 Feb 10, 2022
764d553
text-minimessage: Move allowsChildren down to Inserting
zml2008 Feb 12, 2022
2e8b61b
text-minimessage: various nitpicks
zml2008 Feb 12, 2022
236d8d1
text-minimessage: Make sealed class comments fully valid
zml2008 Feb 12, 2022
11af2fa
text-minimessage: nitpicks from review
zml2008 Feb 12, 2022
798ff57
text-minimessage: builtin -> standard
zml2008 Feb 12, 2022
5d12d78
text-minimessage: Add varargs resolver methods for simplicity
zml2008 Feb 12, 2022
6dffa1b
text-minimessage: More renaming
zml2008 Feb 13, 2022
a6be226
text-minimessage: Docs/naming feedback
zml2008 Feb 13, 2022
8ffa467
text-minimessage: Add selfClosingInserting tag factory method
zml2008 Feb 13, 2022
c7f62ee
Merge pull request #672 from KyoriPowered/feature/tag-cleanup
zml2008 Feb 13, 2022
be9eb1a
text-minimessage: add deserialization method returning parsed tree
rymiel Dec 31, 2021
c0038c2
ElementNode is file for internal usage
rymiel Feb 13, 2022
04c3a44
Make deserializeToTree methods symmetric with regular deserialization
rymiel Feb 13, 2022
ca1f48f
Merge pull request #658 from KyoriPowered/feature/mm/deserialize-to-tree
rymiel Feb 13, 2022
4851d17
Update gradle and github actions
renovate-bot Feb 13, 2022
956667f
build: Remove deprecated API use
zml2008 Feb 13, 2022
40e0aa9
fix: Require all input to be non-null
kezz Feb 13, 2022
4e8a0d9
Merge pull request #681 from KyoriPowered/fix/nullability
kezz Feb 13, 2022
bc2f7b5
Merge pull request #675 from KyoriPowered/renovate/gradle-and-github-…
zml2008 Feb 13, 2022
f7c5071
minimessage: Add a reset tag via a parser directive
kezz Feb 13, 2022
90561a8
Merge pull request #682 from KyoriPowered/feature/reset-tag
zml2008 Feb 14, 2022
1a5c78f
chore: Documentation and formatting changes
kezz Feb 14, 2022
33bf939
Merge pull request #683 from KyoriPowered/chore/docs-and-stuff
kezz Feb 14, 2022
96b670a
text-minimessage: Remove unused parsing error consumer
zml2008 Feb 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- https://checkstyle.org/config_javadoc.html#AtclauseOrder -->
<module name="AtclauseOrder">
<property name="violateExecutionOnNonTightHtml" value="true"/>
<property name="tagOrder" value="@author, @deprecated, @exception, @param, @return, @serial, @serialData, @serialField, @throws, @see, @since, @sinceMinecraft, @version"/>
<property name="tagOrder" value="@author, @exception, @param, @return, @serial, @serialData, @serialField, @throws, @see, @since, @sinceMinecraft, @version, @deprecated"/>
</module>

<!-- https://checkstyle.org/config_imports.html#AvoidStarImport -->
Expand Down Expand Up @@ -245,9 +245,6 @@
<!-- https://checkstyle.org/config_whitespace.html#TypecastParenPad -->
<module name="TypecastParenPad"/>

<!-- https://checkstyle.org/config_coding.html#UnnecessaryParentheses -->
<module name="UnnecessaryParentheses"/>

<!-- https://checkstyle.org/config_imports.html#UnusedImports -->
<module name="UnusedImports"/>

Expand Down
8 changes: 4 additions & 4 deletions .checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<!-- let me be excited, checkstyle! -->
<suppress files="api[\\/]src[\\/]main[\\/]java[\\/]net[\\/]kyori[\\/]adventure[\\/]Adventure.java" checks="SummaryJavadoc"/>

<!-- no javadoc on test classes -->
<suppress files="src[\\/](test|jmh)[\\/]java[\\/].*" checks="FilteringWriteTag"/>
<suppress files="src[\\/](test|jmh)[\\/]java[\\/].*" checks="JavadocPackage"/>
<suppress files="src[\\/](test|jmh)[\\/]java[\\/].*" checks="MissingJavadoc.*"/>
<!-- no javadoc on test and internal classes -->
<suppress files="src[\\/](test|jmh)[\\/]java[\\/].*" checks="(FilteringWriteTag|JavadocPackage|MissingJavadoc.*)"/>
<suppress files="api[\\/]src[\\/]main[\\/]java[\\/]net[\\/]kyori[\\/]adventure[\\/]internal[\\/].*" checks="(FilteringWriteTag|JavadocPackage|MissingJavadoc.*)"/>
<suppress files="minimessage[\\/]src[\\/]main[\\/]java[\\/]net[\\/]kyori[\\/]adventure[\\/]text[\\/]minimessage[\\/]parser[\\/].*" checks="(FilteringWriteTag|JavadocPackage|MissingJavadoc.*)"/>

<suppress files=".*[\\/]nbt[\\/](List|Compound)BinaryTag.java" checks="MethodName"/>
</suppressions>
31 changes: 23 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: "build"

on: ["pull_request", "push"]
on:
push:
branches: "**"
tags-ignore: ["**"]
pull_request:

concurrency:
group: "${{ github.workflow }}-${{ github.event.number || github.ref }}"
cancel-in-progress: true

env:
RUNTIME_VERSION: 11

jobs:
build:
Expand All @@ -13,17 +24,21 @@ jobs:
steps:
- name: "checkout repository"
uses: "actions/checkout@v2"
- name: "setup jdk 11"
uses: "actions/setup-java@v1"
- name: "setup jdk ${{ env.RUNTIME_VERSION }}"
uses: "actions/setup-java@v2"
with:
distribution: "temurin"
java-version: "${{ env.RUNTIME_VERSION }}"
- name: "run gradle build"
uses: "gradle/gradle-build-action@v2"
with:
java-version: "11"
- name: "build"
run: "./gradlew build"
cache-read-only: "${{ !startsWith(github.ref, 'refs/heads/main/') || github.event_name == 'pull_request' }}"
arguments: "build"
- name: "Archive test results"
if: "${{ always() }}"
uses: "actions/upload-artifact@v2"
with:
name: "test-results"
name: "${{ runner.os }}-test-results"
path: |
build/reports/
*/build/reports/
Expand All @@ -36,7 +51,7 @@ jobs:
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: "publish"
if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}"
if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main/') }}"
run: "./gradlew publish"
env:
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}"
Expand Down
10 changes: 5 additions & 5 deletions api/src/main/java/net/kyori/adventure/bossbar/BossBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ public interface BossBar extends Examinable {
/**
* The minimum value the progress can be.
*
* @deprecated for removal since 4.2.0, use {@link #MIN_PROGRESS}
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #MIN_PROGRESS}
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
float MIN_PERCENT = MIN_PROGRESS;
/**
* The maximum value the progress can be.
*
* @deprecated for removal since 4.2.0, use {@link #MAX_PROGRESS}
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #MAX_PROGRESS}
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
Expand Down Expand Up @@ -209,8 +209,8 @@ public interface BossBar extends Examinable {
* <p>The progress is a value between 0 and 1.</p>
*
* @return the progress
* @deprecated for removal since 4.2.0, use {@link #progress()}
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #progress()}
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
Expand All @@ -226,8 +226,8 @@ default float percent() {
* @param progress the progress
* @return the bossbar
* @throws IllegalArgumentException if progress is less than 0 or greater than 1
* @deprecated for removal since 4.2.0, use {@link #progress(float)}
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #progress(float)}
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract("_ -> this")
Expand Down Expand Up @@ -415,8 +415,8 @@ default void bossBarProgressChanged(final @NotNull BossBar bar, final float oldP
* @param bar the bossbar
* @param oldProgress the old progress
* @param newProgress the new progress
* @deprecated for removal since 4.2.0, use {@link #bossBarProgressChanged(BossBar, float, float)}
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #bossBarProgressChanged(BossBar, float, float)}
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
import java.util.function.BiPredicate;
import java.util.function.Consumer;
import java.util.stream.Stream;
import net.kyori.adventure.internal.Internals;
import net.kyori.adventure.text.Component;
import net.kyori.examination.ExaminableProperty;
import net.kyori.examination.string.StringExaminer;
import org.jetbrains.annotations.NotNull;

import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -262,6 +262,6 @@ private void forEachListener(final @NotNull Consumer<Listener> consumer) {

@Override
public String toString() {
return this.examine(StringExaminer.simpleEscaping());
return Internals.toString(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
package net.kyori.adventure.identity;

import java.util.UUID;
import net.kyori.adventure.internal.Internals;
import net.kyori.examination.Examinable;
import net.kyori.examination.string.StringExaminer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -43,7 +43,7 @@ final class IdentityImpl implements Examinable, Identity {

@Override
public String toString() {
return this.examine(StringExaminer.simpleEscaping());
return Internals.toString(this);
}

@Override
Expand Down
49 changes: 49 additions & 0 deletions api/src/main/java/net/kyori/adventure/internal/Internals.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* This file is part of adventure, licensed under the MIT License.
*
* Copyright (c) 2017-2022 KyoriPowered
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.kyori.adventure.internal;

import net.kyori.examination.Examinable;
import net.kyori.examination.string.StringExaminer;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/**
* Utilities internal to Adventure.
*/
@ApiStatus.Internal
public final class Internals {
private Internals() {
}

/**
* Examines an {@link Examinable} using the {@link StringExaminer}.
*
* @param examinable the examinable
* @return the result from examining
* @since 4.10.0
*/
public static @NotNull String toString(final @NotNull Examinable examinable) {
return examinable.examine(StringExaminer.simpleEscaping());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* SOFTWARE.
*/
/**
* Transformations.
* Internal things, not for public use.
*/
package net.kyori.adventure.text.minimessage.transformation;
@org.jetbrains.annotations.ApiStatus.Internal
package net.kyori.adventure.internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* This file is part of adventure, licensed under the MIT License.
*
* Copyright (c) 2017-2022 KyoriPowered
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.kyori.adventure.internal.properties;

import java.util.function.Function;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* Adventure properties.
*
* @since 4.10.0
*/
@ApiStatus.Internal
public final class AdventureProperties {
/**
* Property for specifying whether debug mode is enabled.
*
* @since 4.10.0
*/
public static final Property<Boolean> DEBUG = property("debug", Boolean::parseBoolean, false);
/**
* Property for specifying the default translation locale.
*
* @since 4.10.0
*/
public static final Property<String> DEFAULT_TRANSLATION_LOCALE = property("defaultTranslationLocale", Function.identity(), null);
/**
* Property for specifying whether service load failures are fatal.
*
* @since 4.10.0
*/
public static final Property<Boolean> SERVICE_LOAD_FAILURES_ARE_FATAL = property("serviceLoadFailuresAreFatal", Boolean::parseBoolean, Boolean.TRUE);
/**
* Property for specifying whether to warn when legacy formatting is detected.
*
* @since 4.10.0
*/
public static final Property<Boolean> TEXT_WARN_WHEN_LEGACY_FORMATTING_DETECTED = property("text.warnWhenLegacyFormattingDetected", Boolean::parseBoolean, Boolean.FALSE);

private AdventureProperties() {
}

/**
* Creates a new property.
*
* @param name the property name
* @param parser the value parser
* @param defaultValue the default value
* @param <T> the value type
* @return a property
* @since 4.10.0
*/
public static <T> @NotNull Property<T> property(final @NotNull String name, final @NotNull Function<String, T> parser, final @Nullable T defaultValue) {
return AdventurePropertiesImpl.property(name, parser, defaultValue);
}

/**
* A property.
*
* @param <T> the value type
* @since 4.10.0
*/
@ApiStatus.Internal
@ApiStatus.NonExtendable
public interface Property<T> {
/**
* Gets the value.
*
* @return the value
* @since 4.10.0
*/
@Nullable T value();
}
}
Loading