Add initial interfaces
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: lexikiq <noellekiq@gmail.com>
|
||||||
|
Date: Sun, 2 May 2021 01:04:00 -0400
|
||||||
|
Subject: [PATCH] Use eden-api and ComponentLike interfaces
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/pom.xml b/pom.xml
|
||||||
|
index e5ed07236c358e9ea544f43b41533c92769192dd..96c96b90748b6911568f61ec7d98e93e31d0338b 100644
|
||||||
|
--- a/pom.xml
|
||||||
|
+++ b/pom.xml
|
||||||
|
@@ -47,6 +47,13 @@
|
||||||
|
<!-- Paper end -->
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
+ <!-- Parchment start -->
|
||||||
|
+ <dependency>
|
||||||
|
+ <groupId>me.pugabyte</groupId>
|
||||||
|
+ <artifactId>eden-api</artifactId>
|
||||||
|
+ <version>1.0.0-SNAPSHOT</version>
|
||||||
|
+ </dependency>
|
||||||
|
+ <!-- Parchment end -->
|
||||||
|
<!-- Paper start -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.kyori</groupId>
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
|
index aaf08f8e2cce8c7f7f0520fbe3904d260aafbeb9..38ae0663758d117ec9115ac68848d25f321d203f 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
|
@@ -3,6 +3,7 @@ package org.bukkit.entity;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
+import eden.interfaces.Named;
|
||||||
|
import me.lexikiq.HasHumanEntity;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
@@ -21,7 +22,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
|
/**
|
||||||
|
* Represents a human entity, such as an NPC or a player
|
||||||
|
*/
|
||||||
|
-public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, HasHumanEntity { // Parchment
|
||||||
|
+public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, HasHumanEntity, Named, net.kyori.adventure.text.ComponentLike { // Parchment
|
||||||
|
|
||||||
|
// Parchment start
|
||||||
|
/**
|
||||||
|
@@ -32,6 +33,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder,
|
||||||
|
@NotNull default HumanEntity getPlayer() {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Gets a component corresponding to this human entity
|
||||||
|
+ * @return component with hover text
|
||||||
|
+ */
|
||||||
|
+ @Override
|
||||||
|
+ @NotNull default net.kyori.adventure.text.Component asComponent() {
|
||||||
|
+ return net.kyori.adventure.text.Component.text(getName()).hoverEvent(asHoverEvent());
|
||||||
|
+ };
|
||||||
|
// Parchment end
|
||||||
|
|
||||||
|
/**
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
|
index 5b011eb3795d30f79a7c5ffef7c3a852dfd09c29..1bc5fa56cff7c863097a8ceafefb9eb7693dbe22 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
|
@@ -51,6 +51,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||||
|
@NotNull default Player getPlayer() {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ default @NotNull net.kyori.adventure.text.Component asComponent() {
|
||||||
|
+ return displayName().hoverEvent(asHoverEvent());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
// Parchment end
|
||||||
|
|
||||||
|
// Paper start
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: lexikiq <noellekiq@gmail.com>
|
||||||
|
Date: Sun, 2 May 2021 01:04:00 -0400
|
||||||
|
Subject: [PATCH] Use eden-api and ComponentLike interfaces
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/pom.xml b/pom.xml
|
||||||
|
index 85bf0a229fa8c4e42744f438b71fda4cef67b4e0..20723c2bd92e9c3332d87d9ee01eadf01742f511 100644
|
||||||
|
--- a/pom.xml
|
||||||
|
+++ b/pom.xml
|
||||||
|
@@ -38,6 +38,13 @@
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
+ <!-- Parchment start -->
|
||||||
|
+ <dependency>
|
||||||
|
+ <groupId>me.pugabyte</groupId>
|
||||||
|
+ <artifactId>eden-api</artifactId>
|
||||||
|
+ <version>1.0.0-SNAPSHOT</version>
|
||||||
|
+ </dependency>
|
||||||
|
+ <!-- Parchment end -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.lexikiq</groupId>
|
||||||
|
<artifactId>parchment-api</artifactId>
|
||||||
Reference in New Issue
Block a user