update adventure (used for chat)

This commit is contained in:
nossr50 2020-11-27 16:55:40 -08:00
parent bcd260d9c1
commit 0ce316e428
5 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,6 @@
Version 2.1.159
Fixed a memory leak involving renamed mobs
Updated Adventure library (used in our chat code)
Version 2.1.158
Fixed a bug where Lure level 4 and above would break fishing with the new Master Angler

View File

@ -202,12 +202,12 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
@ -232,7 +232,7 @@
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.8.1</version>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>

View File

@ -56,8 +56,8 @@ public final class MobHealthbarUtils {
/*
* Store the name in metadata
*/
if(target.getMetadata("mcMMO_oldName").size() <= 0 && originalName != null)
target.setMetadata("mcMMO_oldName", new OldName(originalName, plugin));
if(target.getMetadata(TransientMetadataTools.OLD_NAME_METAKEY).size() <= 0 && originalName != null)
target.setMetadata(TransientMetadataTools.OLD_NAME_METAKEY, new OldName(originalName, plugin));
if (oldName == null) {
oldName = "";

View File

@ -4,7 +4,7 @@ import com.gmail.nossr50.mcMMO;
import org.bukkit.entity.LivingEntity;
public class TransientMetadataTools {
public static final String OLD_NAME_METAKEY = "mcMMO_oldName";
public static final String OLD_NAME_METAKEY = TransientMetadataTools.OLD_NAME_METAKEY;
private final mcMMO pluginRef;
public TransientMetadataTools(mcMMO pluginRef) {

View File

@ -448,7 +448,7 @@ public final class CombatUtils {
*/
public static void fixNames(@NotNull LivingEntity entity)
{
List<MetadataValue> metadataValue = entity.getMetadata("mcMMO_oldName");
List<MetadataValue> metadataValue = entity.getMetadata(TransientMetadataTools.OLD_NAME_METAKEY);
if(metadataValue.size() <= 0)
return;