mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
update API
This commit is contained in:
@@ -5,10 +5,10 @@ Subject: [PATCH] Purpur client support
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index f59cbc92334c7b7b20e593a58232fb3c4434f12b..205ddc2abe17781da97fafa06f412b8160cb4427 100644
|
||||
index 5c7a73ea74efe256c695080ba92b8cf698e4cd86..776c271631a2cb519d411892715c1dfa57e2489e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3273,4 +3273,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3278,4 +3278,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Override
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] AFK API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 205ddc2abe17781da97fafa06f412b8160cb4427..fdcbcc9c53d72127b8d1a0072f0f9726f90eb766 100644
|
||||
index 776c271631a2cb519d411892715c1dfa57e2489e..53f509afb6bd7e8afe2d25ec6de23ece8d1c2c18 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3281,5 +3281,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3286,5 +3286,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @return True if Player uses Purpur Client
|
||||
*/
|
||||
public boolean usesPurpurClient();
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Player invulnerabilities
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index fdcbcc9c53d72127b8d1a0072f0f9726f90eb766..407940174a485d082350f01e7e5e2b879fb911b5 100644
|
||||
index 53f509afb6bd7e8afe2d25ec6de23ece8d1c2c18..d8faa01ed7a62ef60c2dded9632f137885a3c82e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3300,5 +3300,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3305,5 +3305,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Reset the idle timer back to 0
|
||||
*/
|
||||
void resetIdleTimer();
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack convenience methods
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 03b47012447430a350e152920f754d993d4023db..3ad843d519e239430c5f4f5754a8da3026ed0f8e 100644
|
||||
index 8a948a61d0bdb06b0b9a6eac8a27baeb35a7d36c..f6e0b39ba9ea34613ecb22c55d5c38d5dcad9a82 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -11047,4 +11047,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
@@ -11050,4 +11050,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isEnabledByFeature(@NotNull World world) {
|
||||
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
||||
}
|
||||
|
||||
@@ -5,18 +5,10 @@ Subject: [PATCH] Potion NamespacedKey
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f026703cb80 100644
|
||||
index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf235eba7e89 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import org.bukkit.Color;
|
||||
+import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.configuration.serialization.SerializableAs;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@@ -31,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -32,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
private static final String AMBIENT = "ambient";
|
||||
private static final String PARTICLES = "has-particles";
|
||||
private static final String ICON = "has-icon";
|
||||
@@ -31,7 +23,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
|
||||
/**
|
||||
* Creates a potion effect.
|
||||
@@ -49,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -50,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
|
||||
*/
|
||||
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
|
||||
@@ -68,7 +60,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
Preconditions.checkArgument(type != null, "effect type cannot be null");
|
||||
this.type = type;
|
||||
this.duration = duration;
|
||||
@@ -56,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -57,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
this.ambient = ambient;
|
||||
this.particles = particles;
|
||||
this.icon = icon;
|
||||
@@ -76,7 +68,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -104,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* @param map the map to deserialize from
|
||||
*/
|
||||
public PotionEffect(@NotNull Map<String, Object> map) {
|
||||
@@ -126,8 +118,8 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
+
|
||||
@NotNull
|
||||
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
|
||||
int type = getInt(map, TYPE);
|
||||
@@ -159,17 +200,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
PotionEffectType effect;
|
||||
@@ -166,17 +206,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return def;
|
||||
}
|
||||
|
||||
@@ -146,21 +138,16 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
@NotNull
|
||||
public Map<String, Object> serialize() {
|
||||
- return ImmutableMap.<String, Object>builder()
|
||||
- .put(TYPE, type.getId())
|
||||
- .put(DURATION, duration)
|
||||
- .put(AMPLIFIER, amplifier)
|
||||
- .put(AMBIENT, ambient)
|
||||
- .put(PARTICLES, particles)
|
||||
- .put(ICON, icon)
|
||||
- .build();
|
||||
+ // Purpur start - add key, don't serialize if null.
|
||||
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.<String, Object>builder()
|
||||
+ .put(TYPE, type.getId())
|
||||
+ .put(DURATION, duration)
|
||||
+ .put(AMPLIFIER, amplifier)
|
||||
+ .put(AMBIENT, ambient)
|
||||
+ .put(PARTICLES, particles)
|
||||
+ .put(ICON, icon);
|
||||
.put(TYPE, type.getKey().toString())
|
||||
.put(DURATION, duration)
|
||||
.put(AMPLIFIER, amplifier)
|
||||
.put(AMBIENT, ambient)
|
||||
.put(PARTICLES, particles)
|
||||
- .put(ICON, icon)
|
||||
- .build();
|
||||
+ .put(ICON, icon);
|
||||
+ if(key != null) {
|
||||
+ builder.put(KEY, key.toString());
|
||||
+ }
|
||||
@@ -169,7 +156,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,7 +250,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -200,7 +256,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return false;
|
||||
}
|
||||
PotionEffect that = (PotionEffect) obj;
|
||||
@@ -178,7 +165,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,6 +346,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -296,6 +352,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -203,7 +190,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 1;
|
||||
@@ -303,6 +378,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -310,6 +384,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -179,7 +179,7 @@ index 3bc9fa8b68b284516ddbf0ace0c1dc52768307cb..aaef58468a3c31f35e5067ed4263e9dd
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index aa60e6db5705764c8b9e766460c692260a2e8fb3..63bf1d70cce9176f47a158a4a767b1bf38d60dbd 100644
|
||||
index b71a5a3f9a97e348f073635eb35f7a5df52e1814..3679c3b8d31ab8de08ecabd56bf92ffc062f971c 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -4016,6 +4016,76 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -260,10 +260,10 @@ index aa60e6db5705764c8b9e766460c692260a2e8fb3..63bf1d70cce9176f47a158a4a767b1bf
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 407940174a485d082350f01e7e5e2b879fb911b5..11ef2a302586e276a11360caa7d75101939988ab 100644
|
||||
index d8faa01ed7a62ef60c2dded9632f137885a3c82e..5b0610ae47f350891935351fdd4eb5e7487d9083 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3321,5 +3321,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3326,5 +3326,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param invulnerableTicks Invulnerable ticks remaining
|
||||
*/
|
||||
void setSpawnInvulnerableTicks(int invulnerableTicks);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add death screen API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 11ef2a302586e276a11360caa7d75101939988ab..d3d5d2c78cc4ee36beaa355ef7e61ef13332abab 100644
|
||||
index 5b0610ae47f350891935351fdd4eb5e7487d9083..b52cc06ced39b90f0c91b203753ec635567c9c4c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3391,5 +3391,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3396,5 +3396,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Clears all debug block highlights
|
||||
*/
|
||||
void clearBlockHighlights();
|
||||
|
||||
Reference in New Issue
Block a user