forked from KyoriPowered/adventure-platform-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move API mixins to -fabric exclusive, bring back service loader worka…
…round Fixes non-game layer libs being unable to access adventure classes on NeoForge
- Loading branch information
Showing
15 changed files
with
314 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
plugins { | ||
id 'publishing-conventions' | ||
} |
44 changes: 44 additions & 0 deletions
44
.../kyori/adventure/platform/neoforge/impl/services/ANSIComponentSerializerProviderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* This file is part of adventure-platform-mod, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2020-2024 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.platform.neoforge.impl.services; | ||
|
||
import com.google.auto.service.AutoService; | ||
import java.util.function.Consumer; | ||
import net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@AutoService(ANSIComponentSerializer.Provider.class) | ||
public final class ANSIComponentSerializerProviderImpl implements ANSIComponentSerializer.Provider { | ||
public static ANSIComponentSerializer.Provider DELEGATE; | ||
|
||
@Override | ||
public @NotNull ANSIComponentSerializer ansi() { | ||
return DELEGATE.ansi(); | ||
} | ||
|
||
@Override | ||
public @NotNull Consumer<ANSIComponentSerializer.Builder> builder() { | ||
return DELEGATE.builder(); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...n/java/net/kyori/adventure/platform/neoforge/impl/services/ClickCallbackProviderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* This file is part of adventure-platform-mod, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2023-2024 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.platform.neoforge.impl.services; | ||
|
||
import com.google.auto.service.AutoService; | ||
import net.kyori.adventure.audience.Audience; | ||
import net.kyori.adventure.text.event.ClickCallback; | ||
import net.kyori.adventure.text.event.ClickEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@AutoService(ClickCallback.Provider.class) | ||
public final class ClickCallbackProviderImpl implements ClickCallback.Provider { | ||
public static ClickCallback.Provider DELEGATE; | ||
|
||
@Override | ||
public @NotNull ClickEvent create(final @NotNull ClickCallback<Audience> callback, final ClickCallback.@NotNull Options options) { | ||
return DELEGATE.create(callback, options); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...java/net/kyori/adventure/platform/neoforge/impl/services/ComponentLoggerProviderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* This file is part of adventure-platform-mod, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2020-2024 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.platform.neoforge.impl.services; | ||
|
||
import com.google.auto.service.AutoService; | ||
import net.kyori.adventure.text.logger.slf4j.ComponentLogger; | ||
import net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@AutoService(net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider.class) | ||
public final class ComponentLoggerProviderImpl implements net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider { | ||
public static ComponentLoggerProvider DELEGATE; | ||
|
||
@Override | ||
public @NotNull ComponentLogger logger(final @NotNull LoggerHelper helper, final @NotNull String name) { | ||
return DELEGATE.logger(helper, name); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
.../kyori/adventure/platform/neoforge/impl/services/DataComponentValueConverterProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* This file is part of adventure-platform-mod, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2024 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.platform.neoforge.impl.services; | ||
|
||
import com.google.auto.service.AutoService; | ||
import net.kyori.adventure.key.Key; | ||
import net.kyori.adventure.text.event.DataComponentValueConverterRegistry; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@AutoService(DataComponentValueConverterRegistry.Provider.class) | ||
public final class DataComponentValueConverterProvider implements DataComponentValueConverterRegistry.Provider { | ||
public static DataComponentValueConverterRegistry.Provider DELEGATE; | ||
|
||
@Override | ||
public @NotNull Key id() { | ||
return DELEGATE.id(); | ||
} | ||
|
||
@Override | ||
public @NotNull Iterable<DataComponentValueConverterRegistry.Conversion<?, ?>> conversions() { | ||
return DELEGATE.conversions(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
.../kyori/adventure/platform/neoforge/impl/services/GsonComponentSerializerProviderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* This file is part of adventure-platform-mod, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2020-2024 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.platform.neoforge.impl.services; | ||
|
||
import com.google.auto.service.AutoService; | ||
import java.util.function.Consumer; | ||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@AutoService(GsonComponentSerializer.Provider.class) | ||
public final class GsonComponentSerializerProviderImpl implements GsonComponentSerializer.Provider { | ||
public static GsonComponentSerializer.Provider DELEGATE; | ||
|
||
@Override | ||
public @NotNull GsonComponentSerializer gson() { | ||
return DELEGATE.gson(); | ||
} | ||
|
||
@Override | ||
public @NotNull GsonComponentSerializer gsonLegacy() { | ||
return DELEGATE.gsonLegacy(); | ||
} | ||
|
||
@Override | ||
public @NotNull Consumer<GsonComponentSerializer.Builder> builder() { | ||
return DELEGATE.builder(); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...i/adventure/platform/neoforge/impl/services/PlainTextComponentSerializerProviderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* This file is part of adventure-platform-mod, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2020-2024 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.platform.neoforge.impl.services; | ||
|
||
import com.google.auto.service.AutoService; | ||
import java.util.function.Consumer; | ||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@AutoService(PlainTextComponentSerializer.Provider.class) | ||
public final class PlainTextComponentSerializerProviderImpl implements PlainTextComponentSerializer.Provider { | ||
public static PlainTextComponentSerializer.Provider DELEGATE; | ||
|
||
@Override | ||
public @NotNull PlainTextComponentSerializer plainTextSimple() { | ||
return DELEGATE.plainTextSimple(); | ||
} | ||
|
||
@Override | ||
public @NotNull Consumer<PlainTextComponentSerializer.Builder> plainText() { | ||
return DELEGATE.plainText(); | ||
} | ||
} |
Oops, something went wrong.