Skip to content

Commit

Permalink
Try to fix text component error when using Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
cjburkey01 committed May 19, 2024
1 parent 5351e52 commit 61d1d9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![ClaimChunk Logo](imgs/icon64.png)
![ClaimChunk Title](imgs/logo_carrier.png)

[![Plugin Version](https://img.shields.io/static/v1?label=Version&message=0.0.24&color=blueviolet&style=for-the-badge)](https://github.com/cjburkey01/ClaimChunk/releases)
[![Plugin Version](https://img.shields.io/static/v1?label=Version&message=0.0.24-RC1&color=blueviolet&style=for-the-badge)](https://github.com/cjburkey01/ClaimChunk/releases)
[![Maven Central Version](https://img.shields.io/maven-central/v/com.cjburkey.claimchunk/claimchunk?label=Maven%20Central&color=blueviolet&style=for-the-badge)](https://central.sonatype.com/artifact/com.cjburkey.claimchunk/claimchunk)
[![Minecraft Version](https://img.shields.io/static/v1?label=Spigot&message=1.20.6&color=blueviolet&style=for-the-badge)](https://www.spigotmc.org/resources/claimchunk.44458/)
![Java Version](https://img.shields.io/static/v1?label=Java&message=17&color=blueviolet&style=for-the-badge)
Expand Down Expand Up @@ -85,26 +85,26 @@ Maven:
<dependency>
<groupId>com.cjburkey.claimchunk</groupId>
<artifactId>claimchunk</artifactId>
<version>0.0.24</version>
<version>0.0.24-RC1</version>
</dependency>
```

Gradle (Groovy):

```groovy
implementation 'com.cjburkey.claimchunk:claimchunk:0.0.24'
implementation 'com.cjburkey.claimchunk:claimchunk:0.0.24-RC1'
```

Gradle (Kotlin):

```kotlin
implementation("com.cjburkey.claimchunk:claimchunk:0.0.24")
implementation("com.cjburkey.claimchunk:claimchunk:0.0.24-RC1")
```

Building
--------
[![Automatic Build](https://img.shields.io/github/actions/workflow/status/cjburkey01/ClaimChunk/gradle.yml?branch=main&style=for-the-badge)](https://claimchunk.cjburkey.com/server/Downloads.html#snapshot-downloads)
[![Version Info](https://img.shields.io/static/v1?label=Repository%20Version&message=0.0.24&color=ff5555&style=for-the-badge)](https://github.com/cjburkey01/ClaimChunk/archive/main.zip)
[![Version Info](https://img.shields.io/static/v1?label=Repository%20Version&message=0.0.24-RC2&color=ff5555&style=for-the-badge)](https://github.com/cjburkey01/ClaimChunk/archive/main.zip)

If you want to obtain a version of the plugin that isn't available yet (like a snapshot), you can do so by asking on the
Discord or building it yourself. Here's how to build it yourself:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ plugins {
object DepData {
const val JAVA_VERSION = 17;

const val LIVE_VERSION = "0.0.24";
const val THIS_VERSION = "0.0.24";
const val LIVE_VERSION = "0.0.24-RC1";
const val THIS_VERSION = "0.0.24-RC2";
const val PLUGIN_NAME = "ClaimChunk";
const val ARCHIVES_BASE_NAME = "claimchunk";
const val MAIN_CLASS = "com.cjburkey.claimchunk.ClaimChunk";
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/cjburkey/claimchunk/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ public static String color(String in) {
return ChatColor.translateAlternateColorCodes('&', in);
}

@SuppressWarnings("deprecation")
public static BaseComponent toComponent(@Nullable CommandSender sender, String input) {
var placeholders = claimChunk.getPlaceholderLayer().getPlaceholders();
var str =
placeholders == null
? input
: ClaimChunkPlaceholders.fillPlaceholders(sender, input);
return new TextComponent(TextComponent.fromLegacy(color(str)));
// REVERT TO THIS! PAPER ISN'T PLAYING NICE!
return new TextComponent(TextComponent.fromLegacyText(color(str)));
}

public static void msg(CommandSender to, BaseComponent msg) {
Expand Down

0 comments on commit 61d1d9e

Please sign in to comment.